authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-07-16 19:02:51-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-07-16 19:02:51-04:00
logf70ce707e2d35a5ed8349d03b6aa8d493792e180
tree141e080030bc6205de9a863fa84ce6d045c423f8
parentb1f8b53d208723663f14b54d7f4863a54f999553
signaturelock-open Commit is signed but in an unrecognized format.

update musl headers to musl v1.1.23


381 files changed, 1836 insertions(+), 141156 deletions(-)

lib/libc/include/aarch64-linux-musl/bits/endian.h created+5
...@@ -0,0 +1,5 @@
1#if __AARCH64EB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/fcntl.h created+38
...@@ -0,0 +1,38 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27#define F_GETLK 5
28#define F_SETLK 6
29#define F_SETLKW 7
30#define F_SETOWN 8
31#define F_GETOWN 9
32#define F_SETSIG 10
33#define F_GETSIG 11
34
35#define F_SETOWN_EX 15
36#define F_GETOWN_EX 16
37
38#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/fenv.h created+19
...@@ -0,0 +1,19 @@
1#define FE_INVALID 1
2#define FE_DIVBYZERO 2
3#define FE_OVERFLOW 4
4#define FE_UNDERFLOW 8
5#define FE_INEXACT 16
6#define FE_ALL_EXCEPT 31
7#define FE_TONEAREST 0
8#define FE_DOWNWARD 0x800000
9#define FE_UPWARD 0x400000
10#define FE_TOWARDZERO 0xc00000
11
12typedef unsigned int fexcept_t;
13
14typedef struct {
15 unsigned int __fpcr;
16 unsigned int __fpsr;
17} fenv_t;
18
19#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/float.h created+16
...@@ -0,0 +1,16 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/hwcap.h created+32
...@@ -0,0 +1,32 @@
1#define HWCAP_FP (1 << 0)
2#define HWCAP_ASIMD (1 << 1)
3#define HWCAP_EVTSTRM (1 << 2)
4#define HWCAP_AES (1 << 3)
5#define HWCAP_PMULL (1 << 4)
6#define HWCAP_SHA1 (1 << 5)
7#define HWCAP_SHA2 (1 << 6)
8#define HWCAP_CRC32 (1 << 7)
9#define HWCAP_ATOMICS (1 << 8)
10#define HWCAP_FPHP (1 << 9)
11#define HWCAP_ASIMDHP (1 << 10)
12#define HWCAP_CPUID (1 << 11)
13#define HWCAP_ASIMDRDM (1 << 12)
14#define HWCAP_JSCVT (1 << 13)
15#define HWCAP_FCMA (1 << 14)
16#define HWCAP_LRCPC (1 << 15)
17#define HWCAP_DCPOP (1 << 16)
18#define HWCAP_SHA3 (1 << 17)
19#define HWCAP_SM3 (1 << 18)
20#define HWCAP_SM4 (1 << 19)
21#define HWCAP_ASIMDDP (1 << 20)
22#define HWCAP_SHA512 (1 << 21)
23#define HWCAP_SVE (1 << 22)
24#define HWCAP_ASIMDFHM (1 << 23)
25#define HWCAP_DIT (1 << 24)
26#define HWCAP_USCAT (1 << 25)
27#define HWCAP_ILRCPC (1 << 26)
28#define HWCAP_FLAGM (1 << 27)
29#define HWCAP_SSBS (1 << 28)
30#define HWCAP_SB (1 << 29)
31#define HWCAP_PACA (1 << 30)
32#define HWCAP_PACG (1UL << 31)
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/ipc.h created+14
...@@ -0,0 +1,14 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 unsigned short __ipc_perm_seq;
9
10 unsigned long __pad1;
11 unsigned long __pad2;
12};
13
14#define IPC_64 0
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/limits.h created+7
...@@ -0,0 +1,7 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/posix.h created+2
...@@ -0,0 +1,2 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/reg.h created+2
...@@ -0,0 +1,2 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/sem.h created+14
...@@ -0,0 +1,14 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 time_t __unused3;
13 time_t __unused4;
14};
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/setjmp.h created+1
...@@ -0,0 +1 @@
1typedef unsigned long __jmp_buf[22];
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/signal.h created+153
...@@ -0,0 +1,153 @@
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 6144
6#define SIGSTKSZ 12288
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long greg_t;
11typedef unsigned long gregset_t[34];
12
13typedef struct {
14 long double vregs[32];
15 unsigned int fpsr;
16 unsigned int fpcr;
17} fpregset_t;
18typedef struct sigcontext {
19 unsigned long fault_address;
20 unsigned long regs[31];
21 unsigned long sp, pc, pstate;
22 long double __reserved[256];
23} mcontext_t;
24
25#define FPSIMD_MAGIC 0x46508001
26#define ESR_MAGIC 0x45535201
27#define EXTRA_MAGIC 0x45585401
28#define SVE_MAGIC 0x53564501
29struct _aarch64_ctx {
30 unsigned int magic;
31 unsigned int size;
32};
33struct fpsimd_context {
34 struct _aarch64_ctx head;
35 unsigned int fpsr;
36 unsigned int fpcr;
37 long double vregs[32];
38};
39struct esr_context {
40 struct _aarch64_ctx head;
41 unsigned long esr;
42};
43struct extra_context {
44 struct _aarch64_ctx head;
45 unsigned long datap;
46 unsigned int size;
47 unsigned int __reserved[3];
48};
49struct sve_context {
50 struct _aarch64_ctx head;
51 unsigned short vl;
52 unsigned short __reserved[3];
53};
54#define SVE_VQ_BYTES 16
55#define SVE_VQ_MIN 1
56#define SVE_VQ_MAX 512
57#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
58#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
59#define SVE_NUM_ZREGS 32
60#define SVE_NUM_PREGS 16
61#define sve_vl_valid(vl) \
62 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
63#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
64#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
65#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
66#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
67#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
68#define SVE_SIG_REGS_OFFSET \
69 ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
70 / SVE_VQ_BYTES * SVE_VQ_BYTES)
71#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
72#define SVE_SIG_ZREG_OFFSET(vq, n) \
73 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
74#define SVE_SIG_ZREGS_SIZE(vq) \
75 (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
76#define SVE_SIG_PREGS_OFFSET(vq) \
77 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
78#define SVE_SIG_PREG_OFFSET(vq, n) \
79 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
80#define SVE_SIG_PREGS_SIZE(vq) \
81 (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
82#define SVE_SIG_FFR_OFFSET(vq) \
83 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
84#define SVE_SIG_REGS_SIZE(vq) \
85 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
86#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
87#else
88typedef struct {
89 long double __regs[18+256];
90} mcontext_t;
91#endif
92
93struct sigaltstack {
94 void *ss_sp;
95 int ss_flags;
96 size_t ss_size;
97};
98
99typedef struct __ucontext {
100 unsigned long uc_flags;
101 struct __ucontext *uc_link;
102 stack_t uc_stack;
103 sigset_t uc_sigmask;
104 mcontext_t uc_mcontext;
105} ucontext_t;
106
107#define SA_NOCLDSTOP 1
108#define SA_NOCLDWAIT 2
109#define SA_SIGINFO 4
110#define SA_ONSTACK 0x08000000
111#define SA_RESTART 0x10000000
112#define SA_NODEFER 0x40000000
113#define SA_RESETHAND 0x80000000
114#define SA_RESTORER 0x04000000
115
116#endif
117
118#define SIGHUP 1
119#define SIGINT 2
120#define SIGQUIT 3
121#define SIGILL 4
122#define SIGTRAP 5
123#define SIGABRT 6
124#define SIGIOT SIGABRT
125#define SIGBUS 7
126#define SIGFPE 8
127#define SIGKILL 9
128#define SIGUSR1 10
129#define SIGSEGV 11
130#define SIGUSR2 12
131#define SIGPIPE 13
132#define SIGALRM 14
133#define SIGTERM 15
134#define SIGSTKFLT 16
135#define SIGCHLD 17
136#define SIGCONT 18
137#define SIGSTOP 19
138#define SIGTSTP 20
139#define SIGTTIN 21
140#define SIGTTOU 22
141#define SIGURG 23
142#define SIGXCPU 24
143#define SIGXFSZ 25
144#define SIGVTALRM 26
145#define SIGPROF 27
146#define SIGWINCH 28
147#define SIGIO 29
148#define SIGPOLL 29
149#define SIGPWR 30
150#define SIGSYS 31
151#define SIGUNUSED SIGSYS
152
153#define _NSIG 65
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/socket.h created+33
...@@ -0,0 +1,33 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/stat.h created+18
...@@ -0,0 +1,18 @@
1struct stat {
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 struct timespec st_atim;
15 struct timespec st_mtim;
16 struct timespec st_ctim;
17 unsigned __unused[2];
18};
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/user.h created+16
...@@ -0,0 +1,16 @@
1struct user_regs_struct {
2 unsigned long long regs[31];
3 unsigned long long sp;
4 unsigned long long pc;
5 unsigned long long pstate;
6};
7
8struct user_fpsimd_struct {
9 long double vregs[32];
10 unsigned int fpsr;
11 unsigned int fpcr;
12};
13
14#define ELF_NREG 34
15typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NREG];
16typedef struct user_fpsimd_struct elf_fpregset_t;
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for aarch64-linux-musleabi-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/alltypes.h deleted-401
...@@ -1,401 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef unsigned wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
22#endif
23#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
24typedef unsigned wint_t;
25#define __DEFINED_wint_t
26#endif
27
28
29#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
30typedef int blksize_t;
31#define __DEFINED_blksize_t
32#endif
33
34#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
35typedef unsigned int nlink_t;
36#define __DEFINED_nlink_t
37#endif
38
39
40#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
41typedef float float_t;
42#define __DEFINED_float_t
43#endif
44
45#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
46typedef double double_t;
47#define __DEFINED_double_t
48#endif
49
50
51#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
52typedef struct { long long __ll; long double __ld; } max_align_t;
53#define __DEFINED_max_align_t
54#endif
55
56
57#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
58typedef long time_t;
59#define __DEFINED_time_t
60#endif
61
62#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
63typedef long suseconds_t;
64#define __DEFINED_suseconds_t
65#endif
66
67
68#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
69typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
70#define __DEFINED_pthread_attr_t
71#endif
72
73#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
74typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
75#define __DEFINED_pthread_mutex_t
76#endif
77
78#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
79typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
80#define __DEFINED_mtx_t
81#endif
82
83#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
84typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
85#define __DEFINED_pthread_cond_t
86#endif
87
88#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
89typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
90#define __DEFINED_cnd_t
91#endif
92
93#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
94typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
95#define __DEFINED_pthread_rwlock_t
96#endif
97
98#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
99typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
100#define __DEFINED_pthread_barrier_t
101#endif
102
103#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
104typedef unsigned _Addr size_t;
105#define __DEFINED_size_t
106#endif
107
108#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
109typedef unsigned _Addr uintptr_t;
110#define __DEFINED_uintptr_t
111#endif
112
113#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
114typedef _Addr ptrdiff_t;
115#define __DEFINED_ptrdiff_t
116#endif
117
118#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
119typedef _Addr ssize_t;
120#define __DEFINED_ssize_t
121#endif
122
123#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
124typedef _Addr intptr_t;
125#define __DEFINED_intptr_t
126#endif
127
128#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
129typedef _Addr regoff_t;
130#define __DEFINED_regoff_t
131#endif
132
133#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
134typedef _Reg register_t;
135#define __DEFINED_register_t
136#endif
137
138
139#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
140typedef signed char int8_t;
141#define __DEFINED_int8_t
142#endif
143
144#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
145typedef signed short int16_t;
146#define __DEFINED_int16_t
147#endif
148
149#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
150typedef signed int int32_t;
151#define __DEFINED_int32_t
152#endif
153
154#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
155typedef signed _Int64 int64_t;
156#define __DEFINED_int64_t
157#endif
158
159#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
160typedef signed _Int64 intmax_t;
161#define __DEFINED_intmax_t
162#endif
163
164#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
165typedef unsigned char uint8_t;
166#define __DEFINED_uint8_t
167#endif
168
169#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
170typedef unsigned short uint16_t;
171#define __DEFINED_uint16_t
172#endif
173
174#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
175typedef unsigned int uint32_t;
176#define __DEFINED_uint32_t
177#endif
178
179#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
180typedef unsigned _Int64 uint64_t;
181#define __DEFINED_uint64_t
182#endif
183
184#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
185typedef unsigned _Int64 u_int64_t;
186#define __DEFINED_u_int64_t
187#endif
188
189#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
190typedef unsigned _Int64 uintmax_t;
191#define __DEFINED_uintmax_t
192#endif
193
194
195#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
196typedef unsigned mode_t;
197#define __DEFINED_mode_t
198#endif
199
200#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
201typedef unsigned _Reg nlink_t;
202#define __DEFINED_nlink_t
203#endif
204
205#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
206typedef _Int64 off_t;
207#define __DEFINED_off_t
208#endif
209
210#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
211typedef unsigned _Int64 ino_t;
212#define __DEFINED_ino_t
213#endif
214
215#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
216typedef unsigned _Int64 dev_t;
217#define __DEFINED_dev_t
218#endif
219
220#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
221typedef long blksize_t;
222#define __DEFINED_blksize_t
223#endif
224
225#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
226typedef _Int64 blkcnt_t;
227#define __DEFINED_blkcnt_t
228#endif
229
230#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
231typedef unsigned _Int64 fsblkcnt_t;
232#define __DEFINED_fsblkcnt_t
233#endif
234
235#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
236typedef unsigned _Int64 fsfilcnt_t;
237#define __DEFINED_fsfilcnt_t
238#endif
239
240
241#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
242typedef unsigned wint_t;
243#define __DEFINED_wint_t
244#endif
245
246#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
247typedef unsigned long wctype_t;
248#define __DEFINED_wctype_t
249#endif
250
251
252#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
253typedef void * timer_t;
254#define __DEFINED_timer_t
255#endif
256
257#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
258typedef int clockid_t;
259#define __DEFINED_clockid_t
260#endif
261
262#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
263typedef long clock_t;
264#define __DEFINED_clock_t
265#endif
266
267#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
268struct timeval { time_t tv_sec; suseconds_t tv_usec; };
269#define __DEFINED_struct_timeval
270#endif
271
272#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
273struct timespec { time_t tv_sec; long tv_nsec; };
274#define __DEFINED_struct_timespec
275#endif
276
277
278#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
279typedef int pid_t;
280#define __DEFINED_pid_t
281#endif
282
283#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
284typedef unsigned id_t;
285#define __DEFINED_id_t
286#endif
287
288#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
289typedef unsigned uid_t;
290#define __DEFINED_uid_t
291#endif
292
293#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
294typedef unsigned gid_t;
295#define __DEFINED_gid_t
296#endif
297
298#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
299typedef int key_t;
300#define __DEFINED_key_t
301#endif
302
303#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
304typedef unsigned useconds_t;
305#define __DEFINED_useconds_t
306#endif
307
308
309#ifdef __cplusplus
310#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
311typedef unsigned long pthread_t;
312#define __DEFINED_pthread_t
313#endif
314
315#else
316#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
317typedef struct __pthread * pthread_t;
318#define __DEFINED_pthread_t
319#endif
320
321#endif
322#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
323typedef int pthread_once_t;
324#define __DEFINED_pthread_once_t
325#endif
326
327#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
328typedef unsigned pthread_key_t;
329#define __DEFINED_pthread_key_t
330#endif
331
332#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
333typedef int pthread_spinlock_t;
334#define __DEFINED_pthread_spinlock_t
335#endif
336
337#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
338typedef struct { unsigned __attr; } pthread_mutexattr_t;
339#define __DEFINED_pthread_mutexattr_t
340#endif
341
342#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
343typedef struct { unsigned __attr; } pthread_condattr_t;
344#define __DEFINED_pthread_condattr_t
345#endif
346
347#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
348typedef struct { unsigned __attr; } pthread_barrierattr_t;
349#define __DEFINED_pthread_barrierattr_t
350#endif
351
352#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
353typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
354#define __DEFINED_pthread_rwlockattr_t
355#endif
356
357
358#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
359typedef struct _IO_FILE FILE;
360#define __DEFINED_FILE
361#endif
362
363
364#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
365typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
366#define __DEFINED_mbstate_t
367#endif
368
369
370#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
371typedef struct __locale_struct * locale_t;
372#define __DEFINED_locale_t
373#endif
374
375
376#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
377typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
378#define __DEFINED_sigset_t
379#endif
380
381
382#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
383struct iovec { void *iov_base; size_t iov_len; };
384#define __DEFINED_struct_iovec
385#endif
386
387
388#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
389typedef unsigned socklen_t;
390#define __DEFINED_socklen_t
391#endif
392
393#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
394typedef unsigned short sa_family_t;
395#define __DEFINED_sa_family_t
396#endif
397
398
399#undef _Addr
400#undef _Int64
401#undef _Reg
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if __AARCH64EB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/fenv.h deleted-19
...@@ -1,19 +0,0 @@
1#define FE_INVALID 1
2#define FE_DIVBYZERO 2
3#define FE_OVERFLOW 4
4#define FE_UNDERFLOW 8
5#define FE_INEXACT 16
6#define FE_ALL_EXCEPT 31
7#define FE_TONEAREST 0
8#define FE_DOWNWARD 0x800000
9#define FE_UPWARD 0x400000
10#define FE_TOWARDZERO 0xc00000
11
12typedef unsigned int fexcept_t;
13
14typedef struct {
15 unsigned int __fpcr;
16 unsigned int __fpsr;
17} fenv_t;
18
19#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/hwcap.h deleted-28
...@@ -1,28 +0,0 @@
1#define HWCAP_FP (1 << 0)
2#define HWCAP_ASIMD (1 << 1)
3#define HWCAP_EVTSTRM (1 << 2)
4#define HWCAP_AES (1 << 3)
5#define HWCAP_PMULL (1 << 4)
6#define HWCAP_SHA1 (1 << 5)
7#define HWCAP_SHA2 (1 << 6)
8#define HWCAP_CRC32 (1 << 7)
9#define HWCAP_ATOMICS (1 << 8)
10#define HWCAP_FPHP (1 << 9)
11#define HWCAP_ASIMDHP (1 << 10)
12#define HWCAP_CPUID (1 << 11)
13#define HWCAP_ASIMDRDM (1 << 12)
14#define HWCAP_JSCVT (1 << 13)
15#define HWCAP_FCMA (1 << 14)
16#define HWCAP_LRCPC (1 << 15)
17#define HWCAP_DCPOP (1 << 16)
18#define HWCAP_SHA3 (1 << 17)
19#define HWCAP_SM3 (1 << 18)
20#define HWCAP_SM4 (1 << 19)
21#define HWCAP_ASIMDDP (1 << 20)
22#define HWCAP_SHA512 (1 << 21)
23#define HWCAP_SVE (1 << 22)
24#define HWCAP_ASIMDFHM (1 << 23)
25#define HWCAP_DIT (1 << 24)
26#define HWCAP_USCAT (1 << 25)
27#define HWCAP_ILRCPC (1 << 26)
28#define HWCAP_FLAGM (1 << 27)
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/ipc.h deleted-14
...@@ -1,14 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 unsigned short __ipc_perm_seq;
9
10 unsigned long __pad1;
11 unsigned long __pad2;
12};
13
14#define IPC_64 0
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/limits.h deleted-7
...@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/reg.h deleted-2
...@@ -1,2 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/sem.h deleted-14
...@@ -1,14 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 time_t __unused3;
13 time_t __unused4;
14};
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[22];
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/signal.h deleted-153
...@@ -1,153 +0,0 @@
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 6144
6#define SIGSTKSZ 12288
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long greg_t;
11typedef unsigned long gregset_t[34];
12
13typedef struct {
14 long double vregs[32];
15 unsigned int fpsr;
16 unsigned int fpcr;
17} fpregset_t;
18typedef struct sigcontext {
19 unsigned long fault_address;
20 unsigned long regs[31];
21 unsigned long sp, pc, pstate;
22 long double __reserved[256];
23} mcontext_t;
24
25#define FPSIMD_MAGIC 0x46508001
26#define ESR_MAGIC 0x45535201
27#define EXTRA_MAGIC 0x45585401
28#define SVE_MAGIC 0x53564501
29struct _aarch64_ctx {
30 unsigned int magic;
31 unsigned int size;
32};
33struct fpsimd_context {
34 struct _aarch64_ctx head;
35 unsigned int fpsr;
36 unsigned int fpcr;
37 long double vregs[32];
38};
39struct esr_context {
40 struct _aarch64_ctx head;
41 unsigned long esr;
42};
43struct extra_context {
44 struct _aarch64_ctx head;
45 unsigned long datap;
46 unsigned int size;
47 unsigned int __reserved[3];
48};
49struct sve_context {
50 struct _aarch64_ctx head;
51 unsigned short vl;
52 unsigned short __reserved[3];
53};
54#define SVE_VQ_BYTES 16
55#define SVE_VQ_MIN 1
56#define SVE_VQ_MAX 512
57#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
58#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
59#define SVE_NUM_ZREGS 32
60#define SVE_NUM_PREGS 16
61#define sve_vl_valid(vl) \
62 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
63#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
64#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
65#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
66#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
67#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
68#define SVE_SIG_REGS_OFFSET \
69 ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
70 / SVE_VQ_BYTES * SVE_VQ_BYTES)
71#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
72#define SVE_SIG_ZREG_OFFSET(vq, n) \
73 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
74#define SVE_SIG_ZREGS_SIZE(vq) \
75 (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
76#define SVE_SIG_PREGS_OFFSET(vq) \
77 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
78#define SVE_SIG_PREG_OFFSET(vq, n) \
79 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
80#define SVE_SIG_PREGS_SIZE(vq) \
81 (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
82#define SVE_SIG_FFR_OFFSET(vq) \
83 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
84#define SVE_SIG_REGS_SIZE(vq) \
85 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
86#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
87#else
88typedef struct {
89 long double __regs[18+256];
90} mcontext_t;
91#endif
92
93struct sigaltstack {
94 void *ss_sp;
95 int ss_flags;
96 size_t ss_size;
97};
98
99typedef struct __ucontext {
100 unsigned long uc_flags;
101 struct __ucontext *uc_link;
102 stack_t uc_stack;
103 sigset_t uc_sigmask;
104 mcontext_t uc_mcontext;
105} ucontext_t;
106
107#define SA_NOCLDSTOP 1
108#define SA_NOCLDWAIT 2
109#define SA_SIGINFO 4
110#define SA_ONSTACK 0x08000000
111#define SA_RESTART 0x10000000
112#define SA_NODEFER 0x40000000
113#define SA_RESETHAND 0x80000000
114#define SA_RESTORER 0x04000000
115
116#endif
117
118#define SIGHUP 1
119#define SIGINT 2
120#define SIGQUIT 3
121#define SIGILL 4
122#define SIGTRAP 5
123#define SIGABRT 6
124#define SIGIOT SIGABRT
125#define SIGBUS 7
126#define SIGFPE 8
127#define SIGKILL 9
128#define SIGUSR1 10
129#define SIGSEGV 11
130#define SIGUSR2 12
131#define SIGPIPE 13
132#define SIGALRM 14
133#define SIGTERM 15
134#define SIGSTKFLT 16
135#define SIGCHLD 17
136#define SIGCONT 18
137#define SIGSTOP 19
138#define SIGTSTP 20
139#define SIGTTIN 21
140#define SIGTTOU 22
141#define SIGURG 23
142#define SIGXCPU 24
143#define SIGXFSZ 25
144#define SIGVTALRM 26
145#define SIGPROF 27
146#define SIGWINCH 28
147#define SIGIO 29
148#define SIGPOLL 29
149#define SIGPWR 30
150#define SIGSYS 31
151#define SIGUNUSED SIGSYS
152
153#define _NSIG 65
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/socket.h deleted-33
...@@ -1,33 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/stat.h deleted-18
...@@ -1,18 +0,0 @@
1struct stat {
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 struct timespec st_atim;
15 struct timespec st_mtim;
16 struct timespec st_ctim;
17 unsigned __unused[2];
18};
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/syscall.h deleted-555
...@@ -1,555 +0,0 @@
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_newfstatat 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_range 84
86#define __NR_timerfd_create 85
87#define __NR_timerfd_settime 86
88#define __NR_timerfd_gettime 87
89#define __NR_utimensat 88
90#define __NR_acct 89
91#define __NR_capget 90
92#define __NR_capset 91
93#define __NR_personality 92
94#define __NR_exit 93
95#define __NR_exit_group 94
96#define __NR_waitid 95
97#define __NR_set_tid_address 96
98#define __NR_unshare 97
99#define __NR_futex 98
100#define __NR_set_robust_list 99
101#define __NR_get_robust_list 100
102#define __NR_nanosleep 101
103#define __NR_getitimer 102
104#define __NR_setitimer 103
105#define __NR_kexec_load 104
106#define __NR_init_module 105
107#define __NR_delete_module 106
108#define __NR_timer_create 107
109#define __NR_timer_gettime 108
110#define __NR_timer_getoverrun 109
111#define __NR_timer_settime 110
112#define __NR_timer_delete 111
113#define __NR_clock_settime 112
114#define __NR_clock_gettime 113
115#define __NR_clock_getres 114
116#define __NR_clock_nanosleep 115
117#define __NR_syslog 116
118#define __NR_ptrace 117
119#define __NR_sched_setparam 118
120#define __NR_sched_setscheduler 119
121#define __NR_sched_getscheduler 120
122#define __NR_sched_getparam 121
123#define __NR_sched_setaffinity 122
124#define __NR_sched_getaffinity 123
125#define __NR_sched_yield 124
126#define __NR_sched_get_priority_max 125
127#define __NR_sched_get_priority_min 126
128#define __NR_sched_rr_get_interval 127
129#define __NR_restart_syscall 128
130#define __NR_kill 129
131#define __NR_tkill 130
132#define __NR_tgkill 131
133#define __NR_sigaltstack 132
134#define __NR_rt_sigsuspend 133
135#define __NR_rt_sigaction 134
136#define __NR_rt_sigprocmask 135
137#define __NR_rt_sigpending 136
138#define __NR_rt_sigtimedwait 137
139#define __NR_rt_sigqueueinfo 138
140#define __NR_rt_sigreturn 139
141#define __NR_setpriority 140
142#define __NR_getpriority 141
143#define __NR_reboot 142
144#define __NR_setregid 143
145#define __NR_setgid 144
146#define __NR_setreuid 145
147#define __NR_setuid 146
148#define __NR_setresuid 147
149#define __NR_getresuid 148
150#define __NR_setresgid 149
151#define __NR_getresgid 150
152#define __NR_setfsuid 151
153#define __NR_setfsgid 152
154#define __NR_times 153
155#define __NR_setpgid 154
156#define __NR_getpgid 155
157#define __NR_getsid 156
158#define __NR_setsid 157
159#define __NR_getgroups 158
160#define __NR_setgroups 159
161#define __NR_uname 160
162#define __NR_sethostname 161
163#define __NR_setdomainname 162
164#define __NR_getrlimit 163
165#define __NR_setrlimit 164
166#define __NR_getrusage 165
167#define __NR_umask 166
168#define __NR_prctl 167
169#define __NR_getcpu 168
170#define __NR_gettimeofday 169
171#define __NR_settimeofday 170
172#define __NR_adjtimex 171
173#define __NR_getpid 172
174#define __NR_getppid 173
175#define __NR_getuid 174
176#define __NR_geteuid 175
177#define __NR_getgid 176
178#define __NR_getegid 177
179#define __NR_gettid 178
180#define __NR_sysinfo 179
181#define __NR_mq_open 180
182#define __NR_mq_unlink 181
183#define __NR_mq_timedsend 182
184#define __NR_mq_timedreceive 183
185#define __NR_mq_notify 184
186#define __NR_mq_getsetattr 185
187#define __NR_msgget 186
188#define __NR_msgctl 187
189#define __NR_msgrcv 188
190#define __NR_msgsnd 189
191#define __NR_semget 190
192#define __NR_semctl 191
193#define __NR_semtimedop 192
194#define __NR_semop 193
195#define __NR_shmget 194
196#define __NR_shmctl 195
197#define __NR_shmat 196
198#define __NR_shmdt 197
199#define __NR_socket 198
200#define __NR_socketpair 199
201#define __NR_bind 200
202#define __NR_listen 201
203#define __NR_accept 202
204#define __NR_connect 203
205#define __NR_getsockname 204
206#define __NR_getpeername 205
207#define __NR_sendto 206
208#define __NR_recvfrom 207
209#define __NR_setsockopt 208
210#define __NR_getsockopt 209
211#define __NR_shutdown 210
212#define __NR_sendmsg 211
213#define __NR_recvmsg 212
214#define __NR_readahead 213
215#define __NR_brk 214
216#define __NR_munmap 215
217#define __NR_mremap 216
218#define __NR_add_key 217
219#define __NR_request_key 218
220#define __NR_keyctl 219
221#define __NR_clone 220
222#define __NR_execve 221
223#define __NR_mmap 222
224#define __NR_fadvise64 223
225#define __NR_swapon 224
226#define __NR_swapoff 225
227#define __NR_mprotect 226
228#define __NR_msync 227
229#define __NR_mlock 228
230#define __NR_munlock 229
231#define __NR_mlockall 230
232#define __NR_munlockall 231
233#define __NR_mincore 232
234#define __NR_madvise 233
235#define __NR_remap_file_pages 234
236#define __NR_mbind 235
237#define __NR_get_mempolicy 236
238#define __NR_set_mempolicy 237
239#define __NR_migrate_pages 238
240#define __NR_move_pages 239
241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_perf_event_open 241
243#define __NR_accept4 242
244#define __NR_recvmmsg 243
245#define __NR_wait4 260
246#define __NR_prlimit64 261
247#define __NR_fanotify_init 262
248#define __NR_fanotify_mark 263
249#define __NR_name_to_handle_at 264
250#define __NR_open_by_handle_at 265
251#define __NR_clock_adjtime 266
252#define __NR_syncfs 267
253#define __NR_setns 268
254#define __NR_sendmmsg 269
255#define __NR_process_vm_readv 270
256#define __NR_process_vm_writev 271
257#define __NR_kcmp 272
258#define __NR_finit_module 273
259#define __NR_sched_setattr 274
260#define __NR_sched_getattr 275
261#define __NR_renameat2 276
262#define __NR_seccomp 277
263#define __NR_getrandom 278
264#define __NR_memfd_create 279
265#define __NR_bpf 280
266#define __NR_execveat 281
267#define __NR_userfaultfd 282
268#define __NR_membarrier 283
269#define __NR_mlock2 284
270#define __NR_copy_file_range 285
271#define __NR_preadv2 286
272#define __NR_pwritev2 287
273#define __NR_pkey_mprotect 288
274#define __NR_pkey_alloc 289
275#define __NR_pkey_free 290
276#define __NR_statx 291
277#define __NR_io_pgetevents 292
278
279#define SYS_io_setup 0
280#define SYS_io_destroy 1
281#define SYS_io_submit 2
282#define SYS_io_cancel 3
283#define SYS_io_getevents 4
284#define SYS_setxattr 5
285#define SYS_lsetxattr 6
286#define SYS_fsetxattr 7
287#define SYS_getxattr 8
288#define SYS_lgetxattr 9
289#define SYS_fgetxattr 10
290#define SYS_listxattr 11
291#define SYS_llistxattr 12
292#define SYS_flistxattr 13
293#define SYS_removexattr 14
294#define SYS_lremovexattr 15
295#define SYS_fremovexattr 16
296#define SYS_getcwd 17
297#define SYS_lookup_dcookie 18
298#define SYS_eventfd2 19
299#define SYS_epoll_create1 20
300#define SYS_epoll_ctl 21
301#define SYS_epoll_pwait 22
302#define SYS_dup 23
303#define SYS_dup3 24
304#define SYS_fcntl 25
305#define SYS_inotify_init1 26
306#define SYS_inotify_add_watch 27
307#define SYS_inotify_rm_watch 28
308#define SYS_ioctl 29
309#define SYS_ioprio_set 30
310#define SYS_ioprio_get 31
311#define SYS_flock 32
312#define SYS_mknodat 33
313#define SYS_mkdirat 34
314#define SYS_unlinkat 35
315#define SYS_symlinkat 36
316#define SYS_linkat 37
317#define SYS_renameat 38
318#define SYS_umount2 39
319#define SYS_mount 40
320#define SYS_pivot_root 41
321#define SYS_nfsservctl 42
322#define SYS_statfs 43
323#define SYS_fstatfs 44
324#define SYS_truncate 45
325#define SYS_ftruncate 46
326#define SYS_fallocate 47
327#define SYS_faccessat 48
328#define SYS_chdir 49
329#define SYS_fchdir 50
330#define SYS_chroot 51
331#define SYS_fchmod 52
332#define SYS_fchmodat 53
333#define SYS_fchownat 54
334#define SYS_fchown 55
335#define SYS_openat 56
336#define SYS_close 57
337#define SYS_vhangup 58
338#define SYS_pipe2 59
339#define SYS_quotactl 60
340#define SYS_getdents64 61
341#define SYS_lseek 62
342#define SYS_read 63
343#define SYS_write 64
344#define SYS_readv 65
345#define SYS_writev 66
346#define SYS_pread64 67
347#define SYS_pwrite64 68
348#define SYS_preadv 69
349#define SYS_pwritev 70
350#define SYS_sendfile 71
351#define SYS_pselect6 72
352#define SYS_ppoll 73
353#define SYS_signalfd4 74
354#define SYS_vmsplice 75
355#define SYS_splice 76
356#define SYS_tee 77
357#define SYS_readlinkat 78
358#define SYS_newfstatat 79
359#define SYS_fstat 80
360#define SYS_sync 81
361#define SYS_fsync 82
362#define SYS_fdatasync 83
363#define SYS_sync_file_range 84
364#define SYS_timerfd_create 85
365#define SYS_timerfd_settime 86
366#define SYS_timerfd_gettime 87
367#define SYS_utimensat 88
368#define SYS_acct 89
369#define SYS_capget 90
370#define SYS_capset 91
371#define SYS_personality 92
372#define SYS_exit 93
373#define SYS_exit_group 94
374#define SYS_waitid 95
375#define SYS_set_tid_address 96
376#define SYS_unshare 97
377#define SYS_futex 98
378#define SYS_set_robust_list 99
379#define SYS_get_robust_list 100
380#define SYS_nanosleep 101
381#define SYS_getitimer 102
382#define SYS_setitimer 103
383#define SYS_kexec_load 104
384#define SYS_init_module 105
385#define SYS_delete_module 106
386#define SYS_timer_create 107
387#define SYS_timer_gettime 108
388#define SYS_timer_getoverrun 109
389#define SYS_timer_settime 110
390#define SYS_timer_delete 111
391#define SYS_clock_settime 112
392#define SYS_clock_gettime 113
393#define SYS_clock_getres 114
394#define SYS_clock_nanosleep 115
395#define SYS_syslog 116
396#define SYS_ptrace 117
397#define SYS_sched_setparam 118
398#define SYS_sched_setscheduler 119
399#define SYS_sched_getscheduler 120
400#define SYS_sched_getparam 121
401#define SYS_sched_setaffinity 122
402#define SYS_sched_getaffinity 123
403#define SYS_sched_yield 124
404#define SYS_sched_get_priority_max 125
405#define SYS_sched_get_priority_min 126
406#define SYS_sched_rr_get_interval 127
407#define SYS_restart_syscall 128
408#define SYS_kill 129
409#define SYS_tkill 130
410#define SYS_tgkill 131
411#define SYS_sigaltstack 132
412#define SYS_rt_sigsuspend 133
413#define SYS_rt_sigaction 134
414#define SYS_rt_sigprocmask 135
415#define SYS_rt_sigpending 136
416#define SYS_rt_sigtimedwait 137
417#define SYS_rt_sigqueueinfo 138
418#define SYS_rt_sigreturn 139
419#define SYS_setpriority 140
420#define SYS_getpriority 141
421#define SYS_reboot 142
422#define SYS_setregid 143
423#define SYS_setgid 144
424#define SYS_setreuid 145
425#define SYS_setuid 146
426#define SYS_setresuid 147
427#define SYS_getresuid 148
428#define SYS_setresgid 149
429#define SYS_getresgid 150
430#define SYS_setfsuid 151
431#define SYS_setfsgid 152
432#define SYS_times 153
433#define SYS_setpgid 154
434#define SYS_getpgid 155
435#define SYS_getsid 156
436#define SYS_setsid 157
437#define SYS_getgroups 158
438#define SYS_setgroups 159
439#define SYS_uname 160
440#define SYS_sethostname 161
441#define SYS_setdomainname 162
442#define SYS_getrlimit 163
443#define SYS_setrlimit 164
444#define SYS_getrusage 165
445#define SYS_umask 166
446#define SYS_prctl 167
447#define SYS_getcpu 168
448#define SYS_gettimeofday 169
449#define SYS_settimeofday 170
450#define SYS_adjtimex 171
451#define SYS_getpid 172
452#define SYS_getppid 173
453#define SYS_getuid 174
454#define SYS_geteuid 175
455#define SYS_getgid 176
456#define SYS_getegid 177
457#define SYS_gettid 178
458#define SYS_sysinfo 179
459#define SYS_mq_open 180
460#define SYS_mq_unlink 181
461#define SYS_mq_timedsend 182
462#define SYS_mq_timedreceive 183
463#define SYS_mq_notify 184
464#define SYS_mq_getsetattr 185
465#define SYS_msgget 186
466#define SYS_msgctl 187
467#define SYS_msgrcv 188
468#define SYS_msgsnd 189
469#define SYS_semget 190
470#define SYS_semctl 191
471#define SYS_semtimedop 192
472#define SYS_semop 193
473#define SYS_shmget 194
474#define SYS_shmctl 195
475#define SYS_shmat 196
476#define SYS_shmdt 197
477#define SYS_socket 198
478#define SYS_socketpair 199
479#define SYS_bind 200
480#define SYS_listen 201
481#define SYS_accept 202
482#define SYS_connect 203
483#define SYS_getsockname 204
484#define SYS_getpeername 205
485#define SYS_sendto 206
486#define SYS_recvfrom 207
487#define SYS_setsockopt 208
488#define SYS_getsockopt 209
489#define SYS_shutdown 210
490#define SYS_sendmsg 211
491#define SYS_recvmsg 212
492#define SYS_readahead 213
493#define SYS_brk 214
494#define SYS_munmap 215
495#define SYS_mremap 216
496#define SYS_add_key 217
497#define SYS_request_key 218
498#define SYS_keyctl 219
499#define SYS_clone 220
500#define SYS_execve 221
501#define SYS_mmap 222
502#define SYS_fadvise64 223
503#define SYS_swapon 224
504#define SYS_swapoff 225
505#define SYS_mprotect 226
506#define SYS_msync 227
507#define SYS_mlock 228
508#define SYS_munlock 229
509#define SYS_mlockall 230
510#define SYS_munlockall 231
511#define SYS_mincore 232
512#define SYS_madvise 233
513#define SYS_remap_file_pages 234
514#define SYS_mbind 235
515#define SYS_get_mempolicy 236
516#define SYS_set_mempolicy 237
517#define SYS_migrate_pages 238
518#define SYS_move_pages 239
519#define SYS_rt_tgsigqueueinfo 240
520#define SYS_perf_event_open 241
521#define SYS_accept4 242
522#define SYS_recvmmsg 243
523#define SYS_wait4 260
524#define SYS_prlimit64 261
525#define SYS_fanotify_init 262
526#define SYS_fanotify_mark 263
527#define SYS_name_to_handle_at 264
528#define SYS_open_by_handle_at 265
529#define SYS_clock_adjtime 266
530#define SYS_syncfs 267
531#define SYS_setns 268
532#define SYS_sendmmsg 269
533#define SYS_process_vm_readv 270
534#define SYS_process_vm_writev 271
535#define SYS_kcmp 272
536#define SYS_finit_module 273
537#define SYS_sched_setattr 274
538#define SYS_sched_getattr 275
539#define SYS_renameat2 276
540#define SYS_seccomp 277
541#define SYS_getrandom 278
542#define SYS_memfd_create 279
543#define SYS_bpf 280
544#define SYS_execveat 281
545#define SYS_userfaultfd 282
546#define SYS_membarrier 283
547#define SYS_mlock2 284
548#define SYS_copy_file_range 285
549#define SYS_preadv2 286
550#define SYS_pwritev2 287
551#define SYS_pkey_mprotect 288
552#define SYS_pkey_alloc 289
553#define SYS_pkey_free 290
554#define SYS_statx 291
555#define SYS_io_pgetevents 292
\ No newline at end of file
lib/libc/include/aarch64-linux-musleabi/bits/user.h deleted-16
...@@ -1,16 +0,0 @@
1struct user_regs_struct {
2 unsigned long long regs[31];
3 unsigned long long sp;
4 unsigned long long pc;
5 unsigned long long pstate;
6};
7
8struct user_fpsimd_struct {
9 long double vregs[32];
10 unsigned int fpsr;
11 unsigned int fpcr;
12};
13
14#define ELF_NREG 34
15typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NREG];
16typedef struct user_fpsimd_struct elf_fpregset_t;
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for aarch64_be-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/alltypes.h deleted-401
...@@ -1,401 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef unsigned wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
22#endif
23#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
24typedef unsigned wint_t;
25#define __DEFINED_wint_t
26#endif
27
28
29#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
30typedef int blksize_t;
31#define __DEFINED_blksize_t
32#endif
33
34#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
35typedef unsigned int nlink_t;
36#define __DEFINED_nlink_t
37#endif
38
39
40#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
41typedef float float_t;
42#define __DEFINED_float_t
43#endif
44
45#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
46typedef double double_t;
47#define __DEFINED_double_t
48#endif
49
50
51#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
52typedef struct { long long __ll; long double __ld; } max_align_t;
53#define __DEFINED_max_align_t
54#endif
55
56
57#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
58typedef long time_t;
59#define __DEFINED_time_t
60#endif
61
62#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
63typedef long suseconds_t;
64#define __DEFINED_suseconds_t
65#endif
66
67
68#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
69typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
70#define __DEFINED_pthread_attr_t
71#endif
72
73#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
74typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
75#define __DEFINED_pthread_mutex_t
76#endif
77
78#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
79typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
80#define __DEFINED_mtx_t
81#endif
82
83#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
84typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
85#define __DEFINED_pthread_cond_t
86#endif
87
88#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
89typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
90#define __DEFINED_cnd_t
91#endif
92
93#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
94typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
95#define __DEFINED_pthread_rwlock_t
96#endif
97
98#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
99typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
100#define __DEFINED_pthread_barrier_t
101#endif
102
103#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
104typedef unsigned _Addr size_t;
105#define __DEFINED_size_t
106#endif
107
108#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
109typedef unsigned _Addr uintptr_t;
110#define __DEFINED_uintptr_t
111#endif
112
113#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
114typedef _Addr ptrdiff_t;
115#define __DEFINED_ptrdiff_t
116#endif
117
118#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
119typedef _Addr ssize_t;
120#define __DEFINED_ssize_t
121#endif
122
123#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
124typedef _Addr intptr_t;
125#define __DEFINED_intptr_t
126#endif
127
128#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
129typedef _Addr regoff_t;
130#define __DEFINED_regoff_t
131#endif
132
133#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
134typedef _Reg register_t;
135#define __DEFINED_register_t
136#endif
137
138
139#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
140typedef signed char int8_t;
141#define __DEFINED_int8_t
142#endif
143
144#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
145typedef signed short int16_t;
146#define __DEFINED_int16_t
147#endif
148
149#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
150typedef signed int int32_t;
151#define __DEFINED_int32_t
152#endif
153
154#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
155typedef signed _Int64 int64_t;
156#define __DEFINED_int64_t
157#endif
158
159#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
160typedef signed _Int64 intmax_t;
161#define __DEFINED_intmax_t
162#endif
163
164#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
165typedef unsigned char uint8_t;
166#define __DEFINED_uint8_t
167#endif
168
169#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
170typedef unsigned short uint16_t;
171#define __DEFINED_uint16_t
172#endif
173
174#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
175typedef unsigned int uint32_t;
176#define __DEFINED_uint32_t
177#endif
178
179#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
180typedef unsigned _Int64 uint64_t;
181#define __DEFINED_uint64_t
182#endif
183
184#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
185typedef unsigned _Int64 u_int64_t;
186#define __DEFINED_u_int64_t
187#endif
188
189#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
190typedef unsigned _Int64 uintmax_t;
191#define __DEFINED_uintmax_t
192#endif
193
194
195#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
196typedef unsigned mode_t;
197#define __DEFINED_mode_t
198#endif
199
200#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
201typedef unsigned _Reg nlink_t;
202#define __DEFINED_nlink_t
203#endif
204
205#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
206typedef _Int64 off_t;
207#define __DEFINED_off_t
208#endif
209
210#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
211typedef unsigned _Int64 ino_t;
212#define __DEFINED_ino_t
213#endif
214
215#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
216typedef unsigned _Int64 dev_t;
217#define __DEFINED_dev_t
218#endif
219
220#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
221typedef long blksize_t;
222#define __DEFINED_blksize_t
223#endif
224
225#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
226typedef _Int64 blkcnt_t;
227#define __DEFINED_blkcnt_t
228#endif
229
230#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
231typedef unsigned _Int64 fsblkcnt_t;
232#define __DEFINED_fsblkcnt_t
233#endif
234
235#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
236typedef unsigned _Int64 fsfilcnt_t;
237#define __DEFINED_fsfilcnt_t
238#endif
239
240
241#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
242typedef unsigned wint_t;
243#define __DEFINED_wint_t
244#endif
245
246#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
247typedef unsigned long wctype_t;
248#define __DEFINED_wctype_t
249#endif
250
251
252#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
253typedef void * timer_t;
254#define __DEFINED_timer_t
255#endif
256
257#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
258typedef int clockid_t;
259#define __DEFINED_clockid_t
260#endif
261
262#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
263typedef long clock_t;
264#define __DEFINED_clock_t
265#endif
266
267#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
268struct timeval { time_t tv_sec; suseconds_t tv_usec; };
269#define __DEFINED_struct_timeval
270#endif
271
272#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
273struct timespec { time_t tv_sec; long tv_nsec; };
274#define __DEFINED_struct_timespec
275#endif
276
277
278#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
279typedef int pid_t;
280#define __DEFINED_pid_t
281#endif
282
283#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
284typedef unsigned id_t;
285#define __DEFINED_id_t
286#endif
287
288#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
289typedef unsigned uid_t;
290#define __DEFINED_uid_t
291#endif
292
293#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
294typedef unsigned gid_t;
295#define __DEFINED_gid_t
296#endif
297
298#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
299typedef int key_t;
300#define __DEFINED_key_t
301#endif
302
303#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
304typedef unsigned useconds_t;
305#define __DEFINED_useconds_t
306#endif
307
308
309#ifdef __cplusplus
310#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
311typedef unsigned long pthread_t;
312#define __DEFINED_pthread_t
313#endif
314
315#else
316#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
317typedef struct __pthread * pthread_t;
318#define __DEFINED_pthread_t
319#endif
320
321#endif
322#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
323typedef int pthread_once_t;
324#define __DEFINED_pthread_once_t
325#endif
326
327#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
328typedef unsigned pthread_key_t;
329#define __DEFINED_pthread_key_t
330#endif
331
332#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
333typedef int pthread_spinlock_t;
334#define __DEFINED_pthread_spinlock_t
335#endif
336
337#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
338typedef struct { unsigned __attr; } pthread_mutexattr_t;
339#define __DEFINED_pthread_mutexattr_t
340#endif
341
342#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
343typedef struct { unsigned __attr; } pthread_condattr_t;
344#define __DEFINED_pthread_condattr_t
345#endif
346
347#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
348typedef struct { unsigned __attr; } pthread_barrierattr_t;
349#define __DEFINED_pthread_barrierattr_t
350#endif
351
352#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
353typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
354#define __DEFINED_pthread_rwlockattr_t
355#endif
356
357
358#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
359typedef struct _IO_FILE FILE;
360#define __DEFINED_FILE
361#endif
362
363
364#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
365typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
366#define __DEFINED_mbstate_t
367#endif
368
369
370#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
371typedef struct __locale_struct * locale_t;
372#define __DEFINED_locale_t
373#endif
374
375
376#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
377typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
378#define __DEFINED_sigset_t
379#endif
380
381
382#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
383struct iovec { void *iov_base; size_t iov_len; };
384#define __DEFINED_struct_iovec
385#endif
386
387
388#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
389typedef unsigned socklen_t;
390#define __DEFINED_socklen_t
391#endif
392
393#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
394typedef unsigned short sa_family_t;
395#define __DEFINED_sa_family_t
396#endif
397
398
399#undef _Addr
400#undef _Int64
401#undef _Reg
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if __AARCH64EB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/fenv.h deleted-19
...@@ -1,19 +0,0 @@
1#define FE_INVALID 1
2#define FE_DIVBYZERO 2
3#define FE_OVERFLOW 4
4#define FE_UNDERFLOW 8
5#define FE_INEXACT 16
6#define FE_ALL_EXCEPT 31
7#define FE_TONEAREST 0
8#define FE_DOWNWARD 0x800000
9#define FE_UPWARD 0x400000
10#define FE_TOWARDZERO 0xc00000
11
12typedef unsigned int fexcept_t;
13
14typedef struct {
15 unsigned int __fpcr;
16 unsigned int __fpsr;
17} fenv_t;
18
19#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/hwcap.h deleted-28
...@@ -1,28 +0,0 @@
1#define HWCAP_FP (1 << 0)
2#define HWCAP_ASIMD (1 << 1)
3#define HWCAP_EVTSTRM (1 << 2)
4#define HWCAP_AES (1 << 3)
5#define HWCAP_PMULL (1 << 4)
6#define HWCAP_SHA1 (1 << 5)
7#define HWCAP_SHA2 (1 << 6)
8#define HWCAP_CRC32 (1 << 7)
9#define HWCAP_ATOMICS (1 << 8)
10#define HWCAP_FPHP (1 << 9)
11#define HWCAP_ASIMDHP (1 << 10)
12#define HWCAP_CPUID (1 << 11)
13#define HWCAP_ASIMDRDM (1 << 12)
14#define HWCAP_JSCVT (1 << 13)
15#define HWCAP_FCMA (1 << 14)
16#define HWCAP_LRCPC (1 << 15)
17#define HWCAP_DCPOP (1 << 16)
18#define HWCAP_SHA3 (1 << 17)
19#define HWCAP_SM3 (1 << 18)
20#define HWCAP_SM4 (1 << 19)
21#define HWCAP_ASIMDDP (1 << 20)
22#define HWCAP_SHA512 (1 << 21)
23#define HWCAP_SVE (1 << 22)
24#define HWCAP_ASIMDFHM (1 << 23)
25#define HWCAP_DIT (1 << 24)
26#define HWCAP_USCAT (1 << 25)
27#define HWCAP_ILRCPC (1 << 26)
28#define HWCAP_FLAGM (1 << 27)
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/ipc.h deleted-14
...@@ -1,14 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 unsigned short __ipc_perm_seq;
9
10 unsigned long __pad1;
11 unsigned long __pad2;
12};
13
14#define IPC_64 0
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/limits.h deleted-7
...@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/reg.h deleted-2
...@@ -1,2 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/sem.h deleted-14
...@@ -1,14 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 time_t __unused3;
13 time_t __unused4;
14};
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[22];
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/signal.h deleted-153
...@@ -1,153 +0,0 @@
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 6144
6#define SIGSTKSZ 12288
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long greg_t;
11typedef unsigned long gregset_t[34];
12
13typedef struct {
14 long double vregs[32];
15 unsigned int fpsr;
16 unsigned int fpcr;
17} fpregset_t;
18typedef struct sigcontext {
19 unsigned long fault_address;
20 unsigned long regs[31];
21 unsigned long sp, pc, pstate;
22 long double __reserved[256];
23} mcontext_t;
24
25#define FPSIMD_MAGIC 0x46508001
26#define ESR_MAGIC 0x45535201
27#define EXTRA_MAGIC 0x45585401
28#define SVE_MAGIC 0x53564501
29struct _aarch64_ctx {
30 unsigned int magic;
31 unsigned int size;
32};
33struct fpsimd_context {
34 struct _aarch64_ctx head;
35 unsigned int fpsr;
36 unsigned int fpcr;
37 long double vregs[32];
38};
39struct esr_context {
40 struct _aarch64_ctx head;
41 unsigned long esr;
42};
43struct extra_context {
44 struct _aarch64_ctx head;
45 unsigned long datap;
46 unsigned int size;
47 unsigned int __reserved[3];
48};
49struct sve_context {
50 struct _aarch64_ctx head;
51 unsigned short vl;
52 unsigned short __reserved[3];
53};
54#define SVE_VQ_BYTES 16
55#define SVE_VQ_MIN 1
56#define SVE_VQ_MAX 512
57#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
58#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
59#define SVE_NUM_ZREGS 32
60#define SVE_NUM_PREGS 16
61#define sve_vl_valid(vl) \
62 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
63#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
64#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
65#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
66#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
67#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
68#define SVE_SIG_REGS_OFFSET \
69 ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
70 / SVE_VQ_BYTES * SVE_VQ_BYTES)
71#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
72#define SVE_SIG_ZREG_OFFSET(vq, n) \
73 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
74#define SVE_SIG_ZREGS_SIZE(vq) \
75 (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
76#define SVE_SIG_PREGS_OFFSET(vq) \
77 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
78#define SVE_SIG_PREG_OFFSET(vq, n) \
79 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
80#define SVE_SIG_PREGS_SIZE(vq) \
81 (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
82#define SVE_SIG_FFR_OFFSET(vq) \
83 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
84#define SVE_SIG_REGS_SIZE(vq) \
85 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
86#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
87#else
88typedef struct {
89 long double __regs[18+256];
90} mcontext_t;
91#endif
92
93struct sigaltstack {
94 void *ss_sp;
95 int ss_flags;
96 size_t ss_size;
97};
98
99typedef struct __ucontext {
100 unsigned long uc_flags;
101 struct __ucontext *uc_link;
102 stack_t uc_stack;
103 sigset_t uc_sigmask;
104 mcontext_t uc_mcontext;
105} ucontext_t;
106
107#define SA_NOCLDSTOP 1
108#define SA_NOCLDWAIT 2
109#define SA_SIGINFO 4
110#define SA_ONSTACK 0x08000000
111#define SA_RESTART 0x10000000
112#define SA_NODEFER 0x40000000
113#define SA_RESETHAND 0x80000000
114#define SA_RESTORER 0x04000000
115
116#endif
117
118#define SIGHUP 1
119#define SIGINT 2
120#define SIGQUIT 3
121#define SIGILL 4
122#define SIGTRAP 5
123#define SIGABRT 6
124#define SIGIOT SIGABRT
125#define SIGBUS 7
126#define SIGFPE 8
127#define SIGKILL 9
128#define SIGUSR1 10
129#define SIGSEGV 11
130#define SIGUSR2 12
131#define SIGPIPE 13
132#define SIGALRM 14
133#define SIGTERM 15
134#define SIGSTKFLT 16
135#define SIGCHLD 17
136#define SIGCONT 18
137#define SIGSTOP 19
138#define SIGTSTP 20
139#define SIGTTIN 21
140#define SIGTTOU 22
141#define SIGURG 23
142#define SIGXCPU 24
143#define SIGXFSZ 25
144#define SIGVTALRM 26
145#define SIGPROF 27
146#define SIGWINCH 28
147#define SIGIO 29
148#define SIGPOLL 29
149#define SIGPWR 30
150#define SIGSYS 31
151#define SIGUNUSED SIGSYS
152
153#define _NSIG 65
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/socket.h deleted-33
...@@ -1,33 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/stat.h deleted-18
...@@ -1,18 +0,0 @@
1struct stat {
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 struct timespec st_atim;
15 struct timespec st_mtim;
16 struct timespec st_ctim;
17 unsigned __unused[2];
18};
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/syscall.h deleted-555
...@@ -1,555 +0,0 @@
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_newfstatat 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_range 84
86#define __NR_timerfd_create 85
87#define __NR_timerfd_settime 86
88#define __NR_timerfd_gettime 87
89#define __NR_utimensat 88
90#define __NR_acct 89
91#define __NR_capget 90
92#define __NR_capset 91
93#define __NR_personality 92
94#define __NR_exit 93
95#define __NR_exit_group 94
96#define __NR_waitid 95
97#define __NR_set_tid_address 96
98#define __NR_unshare 97
99#define __NR_futex 98
100#define __NR_set_robust_list 99
101#define __NR_get_robust_list 100
102#define __NR_nanosleep 101
103#define __NR_getitimer 102
104#define __NR_setitimer 103
105#define __NR_kexec_load 104
106#define __NR_init_module 105
107#define __NR_delete_module 106
108#define __NR_timer_create 107
109#define __NR_timer_gettime 108
110#define __NR_timer_getoverrun 109
111#define __NR_timer_settime 110
112#define __NR_timer_delete 111
113#define __NR_clock_settime 112
114#define __NR_clock_gettime 113
115#define __NR_clock_getres 114
116#define __NR_clock_nanosleep 115
117#define __NR_syslog 116
118#define __NR_ptrace 117
119#define __NR_sched_setparam 118
120#define __NR_sched_setscheduler 119
121#define __NR_sched_getscheduler 120
122#define __NR_sched_getparam 121
123#define __NR_sched_setaffinity 122
124#define __NR_sched_getaffinity 123
125#define __NR_sched_yield 124
126#define __NR_sched_get_priority_max 125
127#define __NR_sched_get_priority_min 126
128#define __NR_sched_rr_get_interval 127
129#define __NR_restart_syscall 128
130#define __NR_kill 129
131#define __NR_tkill 130
132#define __NR_tgkill 131
133#define __NR_sigaltstack 132
134#define __NR_rt_sigsuspend 133
135#define __NR_rt_sigaction 134
136#define __NR_rt_sigprocmask 135
137#define __NR_rt_sigpending 136
138#define __NR_rt_sigtimedwait 137
139#define __NR_rt_sigqueueinfo 138
140#define __NR_rt_sigreturn 139
141#define __NR_setpriority 140
142#define __NR_getpriority 141
143#define __NR_reboot 142
144#define __NR_setregid 143
145#define __NR_setgid 144
146#define __NR_setreuid 145
147#define __NR_setuid 146
148#define __NR_setresuid 147
149#define __NR_getresuid 148
150#define __NR_setresgid 149
151#define __NR_getresgid 150
152#define __NR_setfsuid 151
153#define __NR_setfsgid 152
154#define __NR_times 153
155#define __NR_setpgid 154
156#define __NR_getpgid 155
157#define __NR_getsid 156
158#define __NR_setsid 157
159#define __NR_getgroups 158
160#define __NR_setgroups 159
161#define __NR_uname 160
162#define __NR_sethostname 161
163#define __NR_setdomainname 162
164#define __NR_getrlimit 163
165#define __NR_setrlimit 164
166#define __NR_getrusage 165
167#define __NR_umask 166
168#define __NR_prctl 167
169#define __NR_getcpu 168
170#define __NR_gettimeofday 169
171#define __NR_settimeofday 170
172#define __NR_adjtimex 171
173#define __NR_getpid 172
174#define __NR_getppid 173
175#define __NR_getuid 174
176#define __NR_geteuid 175
177#define __NR_getgid 176
178#define __NR_getegid 177
179#define __NR_gettid 178
180#define __NR_sysinfo 179
181#define __NR_mq_open 180
182#define __NR_mq_unlink 181
183#define __NR_mq_timedsend 182
184#define __NR_mq_timedreceive 183
185#define __NR_mq_notify 184
186#define __NR_mq_getsetattr 185
187#define __NR_msgget 186
188#define __NR_msgctl 187
189#define __NR_msgrcv 188
190#define __NR_msgsnd 189
191#define __NR_semget 190
192#define __NR_semctl 191
193#define __NR_semtimedop 192
194#define __NR_semop 193
195#define __NR_shmget 194
196#define __NR_shmctl 195
197#define __NR_shmat 196
198#define __NR_shmdt 197
199#define __NR_socket 198
200#define __NR_socketpair 199
201#define __NR_bind 200
202#define __NR_listen 201
203#define __NR_accept 202
204#define __NR_connect 203
205#define __NR_getsockname 204
206#define __NR_getpeername 205
207#define __NR_sendto 206
208#define __NR_recvfrom 207
209#define __NR_setsockopt 208
210#define __NR_getsockopt 209
211#define __NR_shutdown 210
212#define __NR_sendmsg 211
213#define __NR_recvmsg 212
214#define __NR_readahead 213
215#define __NR_brk 214
216#define __NR_munmap 215
217#define __NR_mremap 216
218#define __NR_add_key 217
219#define __NR_request_key 218
220#define __NR_keyctl 219
221#define __NR_clone 220
222#define __NR_execve 221
223#define __NR_mmap 222
224#define __NR_fadvise64 223
225#define __NR_swapon 224
226#define __NR_swapoff 225
227#define __NR_mprotect 226
228#define __NR_msync 227
229#define __NR_mlock 228
230#define __NR_munlock 229
231#define __NR_mlockall 230
232#define __NR_munlockall 231
233#define __NR_mincore 232
234#define __NR_madvise 233
235#define __NR_remap_file_pages 234
236#define __NR_mbind 235
237#define __NR_get_mempolicy 236
238#define __NR_set_mempolicy 237
239#define __NR_migrate_pages 238
240#define __NR_move_pages 239
241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_perf_event_open 241
243#define __NR_accept4 242
244#define __NR_recvmmsg 243
245#define __NR_wait4 260
246#define __NR_prlimit64 261
247#define __NR_fanotify_init 262
248#define __NR_fanotify_mark 263
249#define __NR_name_to_handle_at 264
250#define __NR_open_by_handle_at 265
251#define __NR_clock_adjtime 266
252#define __NR_syncfs 267
253#define __NR_setns 268
254#define __NR_sendmmsg 269
255#define __NR_process_vm_readv 270
256#define __NR_process_vm_writev 271
257#define __NR_kcmp 272
258#define __NR_finit_module 273
259#define __NR_sched_setattr 274
260#define __NR_sched_getattr 275
261#define __NR_renameat2 276
262#define __NR_seccomp 277
263#define __NR_getrandom 278
264#define __NR_memfd_create 279
265#define __NR_bpf 280
266#define __NR_execveat 281
267#define __NR_userfaultfd 282
268#define __NR_membarrier 283
269#define __NR_mlock2 284
270#define __NR_copy_file_range 285
271#define __NR_preadv2 286
272#define __NR_pwritev2 287
273#define __NR_pkey_mprotect 288
274#define __NR_pkey_alloc 289
275#define __NR_pkey_free 290
276#define __NR_statx 291
277#define __NR_io_pgetevents 292
278
279#define SYS_io_setup 0
280#define SYS_io_destroy 1
281#define SYS_io_submit 2
282#define SYS_io_cancel 3
283#define SYS_io_getevents 4
284#define SYS_setxattr 5
285#define SYS_lsetxattr 6
286#define SYS_fsetxattr 7
287#define SYS_getxattr 8
288#define SYS_lgetxattr 9
289#define SYS_fgetxattr 10
290#define SYS_listxattr 11
291#define SYS_llistxattr 12
292#define SYS_flistxattr 13
293#define SYS_removexattr 14
294#define SYS_lremovexattr 15
295#define SYS_fremovexattr 16
296#define SYS_getcwd 17
297#define SYS_lookup_dcookie 18
298#define SYS_eventfd2 19
299#define SYS_epoll_create1 20
300#define SYS_epoll_ctl 21
301#define SYS_epoll_pwait 22
302#define SYS_dup 23
303#define SYS_dup3 24
304#define SYS_fcntl 25
305#define SYS_inotify_init1 26
306#define SYS_inotify_add_watch 27
307#define SYS_inotify_rm_watch 28
308#define SYS_ioctl 29
309#define SYS_ioprio_set 30
310#define SYS_ioprio_get 31
311#define SYS_flock 32
312#define SYS_mknodat 33
313#define SYS_mkdirat 34
314#define SYS_unlinkat 35
315#define SYS_symlinkat 36
316#define SYS_linkat 37
317#define SYS_renameat 38
318#define SYS_umount2 39
319#define SYS_mount 40
320#define SYS_pivot_root 41
321#define SYS_nfsservctl 42
322#define SYS_statfs 43
323#define SYS_fstatfs 44
324#define SYS_truncate 45
325#define SYS_ftruncate 46
326#define SYS_fallocate 47
327#define SYS_faccessat 48
328#define SYS_chdir 49
329#define SYS_fchdir 50
330#define SYS_chroot 51
331#define SYS_fchmod 52
332#define SYS_fchmodat 53
333#define SYS_fchownat 54
334#define SYS_fchown 55
335#define SYS_openat 56
336#define SYS_close 57
337#define SYS_vhangup 58
338#define SYS_pipe2 59
339#define SYS_quotactl 60
340#define SYS_getdents64 61
341#define SYS_lseek 62
342#define SYS_read 63
343#define SYS_write 64
344#define SYS_readv 65
345#define SYS_writev 66
346#define SYS_pread64 67
347#define SYS_pwrite64 68
348#define SYS_preadv 69
349#define SYS_pwritev 70
350#define SYS_sendfile 71
351#define SYS_pselect6 72
352#define SYS_ppoll 73
353#define SYS_signalfd4 74
354#define SYS_vmsplice 75
355#define SYS_splice 76
356#define SYS_tee 77
357#define SYS_readlinkat 78
358#define SYS_newfstatat 79
359#define SYS_fstat 80
360#define SYS_sync 81
361#define SYS_fsync 82
362#define SYS_fdatasync 83
363#define SYS_sync_file_range 84
364#define SYS_timerfd_create 85
365#define SYS_timerfd_settime 86
366#define SYS_timerfd_gettime 87
367#define SYS_utimensat 88
368#define SYS_acct 89
369#define SYS_capget 90
370#define SYS_capset 91
371#define SYS_personality 92
372#define SYS_exit 93
373#define SYS_exit_group 94
374#define SYS_waitid 95
375#define SYS_set_tid_address 96
376#define SYS_unshare 97
377#define SYS_futex 98
378#define SYS_set_robust_list 99
379#define SYS_get_robust_list 100
380#define SYS_nanosleep 101
381#define SYS_getitimer 102
382#define SYS_setitimer 103
383#define SYS_kexec_load 104
384#define SYS_init_module 105
385#define SYS_delete_module 106
386#define SYS_timer_create 107
387#define SYS_timer_gettime 108
388#define SYS_timer_getoverrun 109
389#define SYS_timer_settime 110
390#define SYS_timer_delete 111
391#define SYS_clock_settime 112
392#define SYS_clock_gettime 113
393#define SYS_clock_getres 114
394#define SYS_clock_nanosleep 115
395#define SYS_syslog 116
396#define SYS_ptrace 117
397#define SYS_sched_setparam 118
398#define SYS_sched_setscheduler 119
399#define SYS_sched_getscheduler 120
400#define SYS_sched_getparam 121
401#define SYS_sched_setaffinity 122
402#define SYS_sched_getaffinity 123
403#define SYS_sched_yield 124
404#define SYS_sched_get_priority_max 125
405#define SYS_sched_get_priority_min 126
406#define SYS_sched_rr_get_interval 127
407#define SYS_restart_syscall 128
408#define SYS_kill 129
409#define SYS_tkill 130
410#define SYS_tgkill 131
411#define SYS_sigaltstack 132
412#define SYS_rt_sigsuspend 133
413#define SYS_rt_sigaction 134
414#define SYS_rt_sigprocmask 135
415#define SYS_rt_sigpending 136
416#define SYS_rt_sigtimedwait 137
417#define SYS_rt_sigqueueinfo 138
418#define SYS_rt_sigreturn 139
419#define SYS_setpriority 140
420#define SYS_getpriority 141
421#define SYS_reboot 142
422#define SYS_setregid 143
423#define SYS_setgid 144
424#define SYS_setreuid 145
425#define SYS_setuid 146
426#define SYS_setresuid 147
427#define SYS_getresuid 148
428#define SYS_setresgid 149
429#define SYS_getresgid 150
430#define SYS_setfsuid 151
431#define SYS_setfsgid 152
432#define SYS_times 153
433#define SYS_setpgid 154
434#define SYS_getpgid 155
435#define SYS_getsid 156
436#define SYS_setsid 157
437#define SYS_getgroups 158
438#define SYS_setgroups 159
439#define SYS_uname 160
440#define SYS_sethostname 161
441#define SYS_setdomainname 162
442#define SYS_getrlimit 163
443#define SYS_setrlimit 164
444#define SYS_getrusage 165
445#define SYS_umask 166
446#define SYS_prctl 167
447#define SYS_getcpu 168
448#define SYS_gettimeofday 169
449#define SYS_settimeofday 170
450#define SYS_adjtimex 171
451#define SYS_getpid 172
452#define SYS_getppid 173
453#define SYS_getuid 174
454#define SYS_geteuid 175
455#define SYS_getgid 176
456#define SYS_getegid 177
457#define SYS_gettid 178
458#define SYS_sysinfo 179
459#define SYS_mq_open 180
460#define SYS_mq_unlink 181
461#define SYS_mq_timedsend 182
462#define SYS_mq_timedreceive 183
463#define SYS_mq_notify 184
464#define SYS_mq_getsetattr 185
465#define SYS_msgget 186
466#define SYS_msgctl 187
467#define SYS_msgrcv 188
468#define SYS_msgsnd 189
469#define SYS_semget 190
470#define SYS_semctl 191
471#define SYS_semtimedop 192
472#define SYS_semop 193
473#define SYS_shmget 194
474#define SYS_shmctl 195
475#define SYS_shmat 196
476#define SYS_shmdt 197
477#define SYS_socket 198
478#define SYS_socketpair 199
479#define SYS_bind 200
480#define SYS_listen 201
481#define SYS_accept 202
482#define SYS_connect 203
483#define SYS_getsockname 204
484#define SYS_getpeername 205
485#define SYS_sendto 206
486#define SYS_recvfrom 207
487#define SYS_setsockopt 208
488#define SYS_getsockopt 209
489#define SYS_shutdown 210
490#define SYS_sendmsg 211
491#define SYS_recvmsg 212
492#define SYS_readahead 213
493#define SYS_brk 214
494#define SYS_munmap 215
495#define SYS_mremap 216
496#define SYS_add_key 217
497#define SYS_request_key 218
498#define SYS_keyctl 219
499#define SYS_clone 220
500#define SYS_execve 221
501#define SYS_mmap 222
502#define SYS_fadvise64 223
503#define SYS_swapon 224
504#define SYS_swapoff 225
505#define SYS_mprotect 226
506#define SYS_msync 227
507#define SYS_mlock 228
508#define SYS_munlock 229
509#define SYS_mlockall 230
510#define SYS_munlockall 231
511#define SYS_mincore 232
512#define SYS_madvise 233
513#define SYS_remap_file_pages 234
514#define SYS_mbind 235
515#define SYS_get_mempolicy 236
516#define SYS_set_mempolicy 237
517#define SYS_migrate_pages 238
518#define SYS_move_pages 239
519#define SYS_rt_tgsigqueueinfo 240
520#define SYS_perf_event_open 241
521#define SYS_accept4 242
522#define SYS_recvmmsg 243
523#define SYS_wait4 260
524#define SYS_prlimit64 261
525#define SYS_fanotify_init 262
526#define SYS_fanotify_mark 263
527#define SYS_name_to_handle_at 264
528#define SYS_open_by_handle_at 265
529#define SYS_clock_adjtime 266
530#define SYS_syncfs 267
531#define SYS_setns 268
532#define SYS_sendmmsg 269
533#define SYS_process_vm_readv 270
534#define SYS_process_vm_writev 271
535#define SYS_kcmp 272
536#define SYS_finit_module 273
537#define SYS_sched_setattr 274
538#define SYS_sched_getattr 275
539#define SYS_renameat2 276
540#define SYS_seccomp 277
541#define SYS_getrandom 278
542#define SYS_memfd_create 279
543#define SYS_bpf 280
544#define SYS_execveat 281
545#define SYS_userfaultfd 282
546#define SYS_membarrier 283
547#define SYS_mlock2 284
548#define SYS_copy_file_range 285
549#define SYS_preadv2 286
550#define SYS_pwritev2 287
551#define SYS_pkey_mprotect 288
552#define SYS_pkey_alloc 289
553#define SYS_pkey_free 290
554#define SYS_statx 291
555#define SYS_io_pgetevents 292
\ No newline at end of file
lib/libc/include/aarch64_be-linux-musl/bits/user.h deleted-16
...@@ -1,16 +0,0 @@
1struct user_regs_struct {
2 unsigned long long regs[31];
3 unsigned long long sp;
4 unsigned long long pc;
5 unsigned long long pstate;
6};
7
8struct user_fpsimd_struct {
9 long double vregs[32];
10 unsigned int fpsr;
11 unsigned int fpcr;
12};
13
14#define ELF_NREG 34
15typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NREG];
16typedef struct user_fpsimd_struct elf_fpregset_t;
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/endian.h created+5
...@@ -0,0 +1,5 @@
1#if __ARMEB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/fcntl.h created+40
...@@ -0,0 +1,40 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/fenv.h created+23
...@@ -0,0 +1,23 @@
1#ifndef __ARM_PCS_VFP
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INVALID 1
6#define FE_DIVBYZERO 2
7#define FE_OVERFLOW 4
8#define FE_UNDERFLOW 8
9#define FE_INEXACT 16
10#define FE_ALL_EXCEPT 31
11#define FE_TONEAREST 0
12#define FE_DOWNWARD 0x800000
13#define FE_UPWARD 0x400000
14#define FE_TOWARDZERO 0xc00000
15#endif
16
17typedef unsigned long fexcept_t;
18
19typedef struct {
20 unsigned long __cw;
21} fenv_t;
22
23#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/hwcap.h created+53
...@@ -0,0 +1,53 @@
1#define HWCAP_SWP (1 << 0)
2#define HWCAP_HALF (1 << 1)
3#define HWCAP_THUMB (1 << 2)
4#define HWCAP_26BIT (1 << 3)
5#define HWCAP_FAST_MULT (1 << 4)
6#define HWCAP_FPA (1 << 5)
7#define HWCAP_VFP (1 << 6)
8#define HWCAP_EDSP (1 << 7)
9#define HWCAP_JAVA (1 << 8)
10#define HWCAP_IWMMXT (1 << 9)
11#define HWCAP_CRUNCH (1 << 10)
12#define HWCAP_THUMBEE (1 << 11)
13#define HWCAP_NEON (1 << 12)
14#define HWCAP_VFPv3 (1 << 13)
15#define HWCAP_VFPv3D16 (1 << 14)
16#define HWCAP_TLS (1 << 15)
17#define HWCAP_VFPv4 (1 << 16)
18#define HWCAP_IDIVA (1 << 17)
19#define HWCAP_IDIVT (1 << 18)
20#define HWCAP_VFPD32 (1 << 19)
21#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
22#define HWCAP_LPAE (1 << 20)
23#define HWCAP_EVTSTRM (1 << 21)
24
25#define HWCAP2_AES (1 << 0)
26#define HWCAP2_PMULL (1 << 1)
27#define HWCAP2_SHA1 (1 << 2)
28#define HWCAP2_SHA2 (1 << 3)
29#define HWCAP2_CRC32 (1 << 4)
30
31#define HWCAP_ARM_SWP (1 << 0)
32#define HWCAP_ARM_HALF (1 << 1)
33#define HWCAP_ARM_THUMB (1 << 2)
34#define HWCAP_ARM_26BIT (1 << 3)
35#define HWCAP_ARM_FAST_MULT (1 << 4)
36#define HWCAP_ARM_FPA (1 << 5)
37#define HWCAP_ARM_VFP (1 << 6)
38#define HWCAP_ARM_EDSP (1 << 7)
39#define HWCAP_ARM_JAVA (1 << 8)
40#define HWCAP_ARM_IWMMXT (1 << 9)
41#define HWCAP_ARM_CRUNCH (1 << 10)
42#define HWCAP_ARM_THUMBEE (1 << 11)
43#define HWCAP_ARM_NEON (1 << 12)
44#define HWCAP_ARM_VFPv3 (1 << 13)
45#define HWCAP_ARM_VFPv3D16 (1 << 14)
46#define HWCAP_ARM_TLS (1 << 15)
47#define HWCAP_ARM_VFPv4 (1 << 16)
48#define HWCAP_ARM_IDIVA (1 << 17)
49#define HWCAP_ARM_IDIVT (1 << 18)
50#define HWCAP_ARM_VFPD32 (1 << 19)
51#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
52#define HWCAP_ARM_LPAE (1 << 20)
53#define HWCAP_ARM_EVTSTRM (1 << 21)
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/ioctl_fix.h created+2
...@@ -0,0 +1,2 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/msg.h created+15
...@@ -0,0 +1,15 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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};
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/ptrace.h created+25
...@@ -0,0 +1,25 @@
1#define PTRACE_GETWMMXREGS 18
2#define PTRACE_SETWMMXREGS 19
3#define PTRACE_GET_THREAD_AREA 22
4#define PTRACE_SET_SYSCALL 23
5#define PTRACE_GETCRUNCHREGS 25
6#define PTRACE_SETCRUNCHREGS 26
7#define PTRACE_GETVFPREGS 27
8#define PTRACE_SETVFPREGS 28
9#define PTRACE_GETHBPREGS 29
10#define PTRACE_SETHBPREGS 30
11#define PTRACE_GETFDPIC 31
12#define PTRACE_GETFDPIC_EXEC 0
13#define PTRACE_GETFDPIC_INTERP 1
14
15#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
16#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
17#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
18#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
19#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
20#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
21#define PT_GETVFPREGS PTRACE_GETVFPREGS
22#define PT_SETVFPREGS PTRACE_SETVFPREGS
23#define PT_GETHBPREGS PTRACE_GETHBPREGS
24#define PT_SETHBPREGS PTRACE_SETHBPREGS
25#define PT_GETFDPIC PTRACE_GETFDPIC
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/setjmp.h created+1
...@@ -0,0 +1 @@
1typedef unsigned long long __jmp_buf[32];
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/shm.h created+27
...@@ -0,0 +1,27 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17};
18
19struct shminfo {
20 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
21};
22
23struct shm_info {
24 int __used_ids;
25 unsigned long shm_tot, shm_rss, shm_swp;
26 unsigned long __swap_attempts, __swap_successes;
27};
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/signal.h created+86
...@@ -0,0 +1,86 @@
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 unsigned long trap_no, error_code, oldmask;
13 unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
14 unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
15 unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
16 unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
17 unsigned long arm_cpsr, fault_address;
18} mcontext_t;
19#else
20typedef struct {
21 unsigned long __regs[21];
22} mcontext_t;
23#endif
24
25struct sigaltstack {
26 void *ss_sp;
27 int ss_flags;
28 size_t ss_size;
29};
30
31typedef struct __ucontext {
32 unsigned long uc_flags;
33 struct __ucontext *uc_link;
34 stack_t uc_stack;
35 mcontext_t uc_mcontext;
36 sigset_t uc_sigmask;
37 unsigned long long uc_regspace[64];
38} ucontext_t;
39
40#define SA_NOCLDSTOP 1
41#define SA_NOCLDWAIT 2
42#define SA_SIGINFO 4
43#define SA_ONSTACK 0x08000000
44#define SA_RESTART 0x10000000
45#define SA_NODEFER 0x40000000
46#define SA_RESETHAND 0x80000000
47#define SA_RESTORER 0x04000000
48
49#endif
50
51#define SIGHUP 1
52#define SIGINT 2
53#define SIGQUIT 3
54#define SIGILL 4
55#define SIGTRAP 5
56#define SIGABRT 6
57#define SIGIOT SIGABRT
58#define SIGBUS 7
59#define SIGFPE 8
60#define SIGKILL 9
61#define SIGUSR1 10
62#define SIGSEGV 11
63#define SIGUSR2 12
64#define SIGPIPE 13
65#define SIGALRM 14
66#define SIGTERM 15
67#define SIGSTKFLT 16
68#define SIGCHLD 17
69#define SIGCONT 18
70#define SIGSTOP 19
71#define SIGTSTP 20
72#define SIGTTIN 21
73#define SIGTTOU 22
74#define SIGURG 23
75#define SIGXCPU 24
76#define SIGXFSZ 25
77#define SIGVTALRM 26
78#define SIGPROF 27
79#define SIGWINCH 28
80#define SIGIO 29
81#define SIGPOLL 29
82#define SIGPWR 30
83#define SIGSYS 31
84#define SIGUNUSED SIGSYS
85
86#define _NSIG 65
\ No newline at end of file
lib/libc/include/arm-linux-musl/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
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/user.h created+36
...@@ -0,0 +1,36 @@
1typedef struct user_fpregs {
2 struct fp_reg {
3 unsigned sign1:1;
4 unsigned unused:15;
5 unsigned sign2:1;
6 unsigned exponent:14;
7 unsigned j:1;
8 unsigned mantissa1:31;
9 unsigned mantissa0:32;
10 } fpregs[8];
11 unsigned fpsr:32;
12 unsigned fpcr:32;
13 unsigned char ftype[8];
14 unsigned int init_flag;
15} elf_fpregset_t;
16
17struct user_regs {
18 unsigned long uregs[18];
19};
20#define ELF_NGREG 18
21typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
22
23struct user {
24 struct user_regs regs;
25 int u_fpvalid;
26 unsigned long u_tsize, u_dsize, u_ssize;
27 unsigned long start_code, start_stack;
28 long signal;
29 int reserved;
30 struct user_regs *u_ar0;
31 unsigned long magic;
32 char u_comm[32];
33 int u_debugreg[8];
34 struct user_fpregs u_fp;
35 struct user_fpregs *u_fp0;
36};
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 32
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for arm-linux-musleabi-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/hwcap.h deleted-53
...@@ -1,53 +0,0 @@
1#define HWCAP_SWP (1 << 0)
2#define HWCAP_HALF (1 << 1)
3#define HWCAP_THUMB (1 << 2)
4#define HWCAP_26BIT (1 << 3)
5#define HWCAP_FAST_MULT (1 << 4)
6#define HWCAP_FPA (1 << 5)
7#define HWCAP_VFP (1 << 6)
8#define HWCAP_EDSP (1 << 7)
9#define HWCAP_JAVA (1 << 8)
10#define HWCAP_IWMMXT (1 << 9)
11#define HWCAP_CRUNCH (1 << 10)
12#define HWCAP_THUMBEE (1 << 11)
13#define HWCAP_NEON (1 << 12)
14#define HWCAP_VFPv3 (1 << 13)
15#define HWCAP_VFPv3D16 (1 << 14)
16#define HWCAP_TLS (1 << 15)
17#define HWCAP_VFPv4 (1 << 16)
18#define HWCAP_IDIVA (1 << 17)
19#define HWCAP_IDIVT (1 << 18)
20#define HWCAP_VFPD32 (1 << 19)
21#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
22#define HWCAP_LPAE (1 << 20)
23#define HWCAP_EVTSTRM (1 << 21)
24
25#define HWCAP2_AES (1 << 0)
26#define HWCAP2_PMULL (1 << 1)
27#define HWCAP2_SHA1 (1 << 2)
28#define HWCAP2_SHA2 (1 << 3)
29#define HWCAP2_CRC32 (1 << 4)
30
31#define HWCAP_ARM_SWP (1 << 0)
32#define HWCAP_ARM_HALF (1 << 1)
33#define HWCAP_ARM_THUMB (1 << 2)
34#define HWCAP_ARM_26BIT (1 << 3)
35#define HWCAP_ARM_FAST_MULT (1 << 4)
36#define HWCAP_ARM_FPA (1 << 5)
37#define HWCAP_ARM_VFP (1 << 6)
38#define HWCAP_ARM_EDSP (1 << 7)
39#define HWCAP_ARM_JAVA (1 << 8)
40#define HWCAP_ARM_IWMMXT (1 << 9)
41#define HWCAP_ARM_CRUNCH (1 << 10)
42#define HWCAP_ARM_THUMBEE (1 << 11)
43#define HWCAP_ARM_NEON (1 << 12)
44#define HWCAP_ARM_VFPv3 (1 << 13)
45#define HWCAP_ARM_VFPv3D16 (1 << 14)
46#define HWCAP_ARM_TLS (1 << 15)
47#define HWCAP_ARM_VFPv4 (1 << 16)
48#define HWCAP_ARM_IDIVA (1 << 17)
49#define HWCAP_ARM_IDIVT (1 << 18)
50#define HWCAP_ARM_VFPD32 (1 << 19)
51#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
52#define HWCAP_ARM_LPAE (1 << 20)
53#define HWCAP_ARM_EVTSTRM (1 << 21)
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/ioctl_fix.h deleted-2
...@@ -1,2 +0,0 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/msg.h deleted-15
...@@ -1,15 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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};
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETWMMXREGS 18
2#define PTRACE_SETWMMXREGS 19
3#define PTRACE_GET_THREAD_AREA 22
4#define PTRACE_SET_SYSCALL 23
5#define PTRACE_GETCRUNCHREGS 25
6#define PTRACE_SETCRUNCHREGS 26
7#define PTRACE_GETVFPREGS 27
8#define PTRACE_SETVFPREGS 28
9#define PTRACE_GETHBPREGS 29
10#define PTRACE_SETHBPREGS 30
11#define PTRACE_GETFDPIC 31
12#define PTRACE_GETFDPIC_EXEC 0
13#define PTRACE_GETFDPIC_INTERP 1
14
15#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
16#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
17#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
18#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
19#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
20#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
21#define PT_GETVFPREGS PTRACE_GETVFPREGS
22#define PT_SETVFPREGS PTRACE_SETVFPREGS
23#define PT_GETHBPREGS PTRACE_GETHBPREGS
24#define PT_SETHBPREGS PTRACE_SETHBPREGS
25#define PT_GETFDPIC PTRACE_GETFDPIC
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/shm.h deleted-27
...@@ -1,27 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17};
18
19struct shminfo {
20 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
21};
22
23struct shm_info {
24 int __used_ids;
25 unsigned long shm_tot, shm_rss, shm_swp;
26 unsigned long __swap_attempts, __swap_successes;
27};
\ No newline at end of file
lib/libc/include/arm-linux-musleabi/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
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
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 32
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for arm-linux-musleabihf-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/hwcap.h deleted-53
...@@ -1,53 +0,0 @@
1#define HWCAP_SWP (1 << 0)
2#define HWCAP_HALF (1 << 1)
3#define HWCAP_THUMB (1 << 2)
4#define HWCAP_26BIT (1 << 3)
5#define HWCAP_FAST_MULT (1 << 4)
6#define HWCAP_FPA (1 << 5)
7#define HWCAP_VFP (1 << 6)
8#define HWCAP_EDSP (1 << 7)
9#define HWCAP_JAVA (1 << 8)
10#define HWCAP_IWMMXT (1 << 9)
11#define HWCAP_CRUNCH (1 << 10)
12#define HWCAP_THUMBEE (1 << 11)
13#define HWCAP_NEON (1 << 12)
14#define HWCAP_VFPv3 (1 << 13)
15#define HWCAP_VFPv3D16 (1 << 14)
16#define HWCAP_TLS (1 << 15)
17#define HWCAP_VFPv4 (1 << 16)
18#define HWCAP_IDIVA (1 << 17)
19#define HWCAP_IDIVT (1 << 18)
20#define HWCAP_VFPD32 (1 << 19)
21#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
22#define HWCAP_LPAE (1 << 20)
23#define HWCAP_EVTSTRM (1 << 21)
24
25#define HWCAP2_AES (1 << 0)
26#define HWCAP2_PMULL (1 << 1)
27#define HWCAP2_SHA1 (1 << 2)
28#define HWCAP2_SHA2 (1 << 3)
29#define HWCAP2_CRC32 (1 << 4)
30
31#define HWCAP_ARM_SWP (1 << 0)
32#define HWCAP_ARM_HALF (1 << 1)
33#define HWCAP_ARM_THUMB (1 << 2)
34#define HWCAP_ARM_26BIT (1 << 3)
35#define HWCAP_ARM_FAST_MULT (1 << 4)
36#define HWCAP_ARM_FPA (1 << 5)
37#define HWCAP_ARM_VFP (1 << 6)
38#define HWCAP_ARM_EDSP (1 << 7)
39#define HWCAP_ARM_JAVA (1 << 8)
40#define HWCAP_ARM_IWMMXT (1 << 9)
41#define HWCAP_ARM_CRUNCH (1 << 10)
42#define HWCAP_ARM_THUMBEE (1 << 11)
43#define HWCAP_ARM_NEON (1 << 12)
44#define HWCAP_ARM_VFPv3 (1 << 13)
45#define HWCAP_ARM_VFPv3D16 (1 << 14)
46#define HWCAP_ARM_TLS (1 << 15)
47#define HWCAP_ARM_VFPv4 (1 << 16)
48#define HWCAP_ARM_IDIVA (1 << 17)
49#define HWCAP_ARM_IDIVT (1 << 18)
50#define HWCAP_ARM_VFPD32 (1 << 19)
51#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
52#define HWCAP_ARM_LPAE (1 << 20)
53#define HWCAP_ARM_EVTSTRM (1 << 21)
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/ioctl_fix.h deleted-2
...@@ -1,2 +0,0 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/msg.h deleted-15
...@@ -1,15 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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};
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETWMMXREGS 18
2#define PTRACE_SETWMMXREGS 19
3#define PTRACE_GET_THREAD_AREA 22
4#define PTRACE_SET_SYSCALL 23
5#define PTRACE_GETCRUNCHREGS 25
6#define PTRACE_SETCRUNCHREGS 26
7#define PTRACE_GETVFPREGS 27
8#define PTRACE_SETVFPREGS 28
9#define PTRACE_GETHBPREGS 29
10#define PTRACE_SETHBPREGS 30
11#define PTRACE_GETFDPIC 31
12#define PTRACE_GETFDPIC_EXEC 0
13#define PTRACE_GETFDPIC_INTERP 1
14
15#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
16#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
17#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
18#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
19#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
20#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
21#define PT_GETVFPREGS PTRACE_GETVFPREGS
22#define PT_SETVFPREGS PTRACE_SETVFPREGS
23#define PT_GETHBPREGS PTRACE_GETHBPREGS
24#define PT_SETHBPREGS PTRACE_SETHBPREGS
25#define PT_GETFDPIC PTRACE_GETFDPIC
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/shm.h deleted-27
...@@ -1,27 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17};
18
19struct shminfo {
20 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
21};
22
23struct shm_info {
24 int __used_ids;
25 unsigned long shm_tot, shm_rss, shm_swp;
26 unsigned long __swap_attempts, __swap_successes;
27};
\ No newline at end of file
lib/libc/include/arm-linux-musleabihf/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
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
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 32
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for armeb-linux-musleabi-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/hwcap.h deleted-53
...@@ -1,53 +0,0 @@
1#define HWCAP_SWP (1 << 0)
2#define HWCAP_HALF (1 << 1)
3#define HWCAP_THUMB (1 << 2)
4#define HWCAP_26BIT (1 << 3)
5#define HWCAP_FAST_MULT (1 << 4)
6#define HWCAP_FPA (1 << 5)
7#define HWCAP_VFP (1 << 6)
8#define HWCAP_EDSP (1 << 7)
9#define HWCAP_JAVA (1 << 8)
10#define HWCAP_IWMMXT (1 << 9)
11#define HWCAP_CRUNCH (1 << 10)
12#define HWCAP_THUMBEE (1 << 11)
13#define HWCAP_NEON (1 << 12)
14#define HWCAP_VFPv3 (1 << 13)
15#define HWCAP_VFPv3D16 (1 << 14)
16#define HWCAP_TLS (1 << 15)
17#define HWCAP_VFPv4 (1 << 16)
18#define HWCAP_IDIVA (1 << 17)
19#define HWCAP_IDIVT (1 << 18)
20#define HWCAP_VFPD32 (1 << 19)
21#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
22#define HWCAP_LPAE (1 << 20)
23#define HWCAP_EVTSTRM (1 << 21)
24
25#define HWCAP2_AES (1 << 0)
26#define HWCAP2_PMULL (1 << 1)
27#define HWCAP2_SHA1 (1 << 2)
28#define HWCAP2_SHA2 (1 << 3)
29#define HWCAP2_CRC32 (1 << 4)
30
31#define HWCAP_ARM_SWP (1 << 0)
32#define HWCAP_ARM_HALF (1 << 1)
33#define HWCAP_ARM_THUMB (1 << 2)
34#define HWCAP_ARM_26BIT (1 << 3)
35#define HWCAP_ARM_FAST_MULT (1 << 4)
36#define HWCAP_ARM_FPA (1 << 5)
37#define HWCAP_ARM_VFP (1 << 6)
38#define HWCAP_ARM_EDSP (1 << 7)
39#define HWCAP_ARM_JAVA (1 << 8)
40#define HWCAP_ARM_IWMMXT (1 << 9)
41#define HWCAP_ARM_CRUNCH (1 << 10)
42#define HWCAP_ARM_THUMBEE (1 << 11)
43#define HWCAP_ARM_NEON (1 << 12)
44#define HWCAP_ARM_VFPv3 (1 << 13)
45#define HWCAP_ARM_VFPv3D16 (1 << 14)
46#define HWCAP_ARM_TLS (1 << 15)
47#define HWCAP_ARM_VFPv4 (1 << 16)
48#define HWCAP_ARM_IDIVA (1 << 17)
49#define HWCAP_ARM_IDIVT (1 << 18)
50#define HWCAP_ARM_VFPD32 (1 << 19)
51#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
52#define HWCAP_ARM_LPAE (1 << 20)
53#define HWCAP_ARM_EVTSTRM (1 << 21)
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/ioctl_fix.h deleted-2
...@@ -1,2 +0,0 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/msg.h deleted-15
...@@ -1,15 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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};
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETWMMXREGS 18
2#define PTRACE_SETWMMXREGS 19
3#define PTRACE_GET_THREAD_AREA 22
4#define PTRACE_SET_SYSCALL 23
5#define PTRACE_GETCRUNCHREGS 25
6#define PTRACE_SETCRUNCHREGS 26
7#define PTRACE_GETVFPREGS 27
8#define PTRACE_SETVFPREGS 28
9#define PTRACE_GETHBPREGS 29
10#define PTRACE_SETHBPREGS 30
11#define PTRACE_GETFDPIC 31
12#define PTRACE_GETFDPIC_EXEC 0
13#define PTRACE_GETFDPIC_INTERP 1
14
15#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
16#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
17#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
18#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
19#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
20#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
21#define PT_GETVFPREGS PTRACE_GETVFPREGS
22#define PT_SETVFPREGS PTRACE_SETVFPREGS
23#define PT_GETHBPREGS PTRACE_GETHBPREGS
24#define PT_SETHBPREGS PTRACE_SETHBPREGS
25#define PT_GETFDPIC PTRACE_GETFDPIC
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/shm.h deleted-27
...@@ -1,27 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17};
18
19struct shminfo {
20 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
21};
22
23struct shm_info {
24 int __used_ids;
25 unsigned long shm_tot, shm_rss, shm_swp;
26 unsigned long __swap_attempts, __swap_successes;
27};
\ No newline at end of file
lib/libc/include/armeb-linux-musleabi/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
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
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 32
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for armeb-linux-musleabihf-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/hwcap.h deleted-53
...@@ -1,53 +0,0 @@
1#define HWCAP_SWP (1 << 0)
2#define HWCAP_HALF (1 << 1)
3#define HWCAP_THUMB (1 << 2)
4#define HWCAP_26BIT (1 << 3)
5#define HWCAP_FAST_MULT (1 << 4)
6#define HWCAP_FPA (1 << 5)
7#define HWCAP_VFP (1 << 6)
8#define HWCAP_EDSP (1 << 7)
9#define HWCAP_JAVA (1 << 8)
10#define HWCAP_IWMMXT (1 << 9)
11#define HWCAP_CRUNCH (1 << 10)
12#define HWCAP_THUMBEE (1 << 11)
13#define HWCAP_NEON (1 << 12)
14#define HWCAP_VFPv3 (1 << 13)
15#define HWCAP_VFPv3D16 (1 << 14)
16#define HWCAP_TLS (1 << 15)
17#define HWCAP_VFPv4 (1 << 16)
18#define HWCAP_IDIVA (1 << 17)
19#define HWCAP_IDIVT (1 << 18)
20#define HWCAP_VFPD32 (1 << 19)
21#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
22#define HWCAP_LPAE (1 << 20)
23#define HWCAP_EVTSTRM (1 << 21)
24
25#define HWCAP2_AES (1 << 0)
26#define HWCAP2_PMULL (1 << 1)
27#define HWCAP2_SHA1 (1 << 2)
28#define HWCAP2_SHA2 (1 << 3)
29#define HWCAP2_CRC32 (1 << 4)
30
31#define HWCAP_ARM_SWP (1 << 0)
32#define HWCAP_ARM_HALF (1 << 1)
33#define HWCAP_ARM_THUMB (1 << 2)
34#define HWCAP_ARM_26BIT (1 << 3)
35#define HWCAP_ARM_FAST_MULT (1 << 4)
36#define HWCAP_ARM_FPA (1 << 5)
37#define HWCAP_ARM_VFP (1 << 6)
38#define HWCAP_ARM_EDSP (1 << 7)
39#define HWCAP_ARM_JAVA (1 << 8)
40#define HWCAP_ARM_IWMMXT (1 << 9)
41#define HWCAP_ARM_CRUNCH (1 << 10)
42#define HWCAP_ARM_THUMBEE (1 << 11)
43#define HWCAP_ARM_NEON (1 << 12)
44#define HWCAP_ARM_VFPv3 (1 << 13)
45#define HWCAP_ARM_VFPv3D16 (1 << 14)
46#define HWCAP_ARM_TLS (1 << 15)
47#define HWCAP_ARM_VFPv4 (1 << 16)
48#define HWCAP_ARM_IDIVA (1 << 17)
49#define HWCAP_ARM_IDIVT (1 << 18)
50#define HWCAP_ARM_VFPD32 (1 << 19)
51#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
52#define HWCAP_ARM_LPAE (1 << 20)
53#define HWCAP_ARM_EVTSTRM (1 << 21)
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/ioctl_fix.h deleted-2
...@@ -1,2 +0,0 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/msg.h deleted-15
...@@ -1,15 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 int __unused1;
5 time_t msg_rtime;
6 int __unused2;
7 time_t msg_ctime;
8 int __unused3;
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};
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETWMMXREGS 18
2#define PTRACE_SETWMMXREGS 19
3#define PTRACE_GET_THREAD_AREA 22
4#define PTRACE_SET_SYSCALL 23
5#define PTRACE_GETCRUNCHREGS 25
6#define PTRACE_SETCRUNCHREGS 26
7#define PTRACE_GETVFPREGS 27
8#define PTRACE_SETVFPREGS 28
9#define PTRACE_GETHBPREGS 29
10#define PTRACE_SETHBPREGS 30
11#define PTRACE_GETFDPIC 31
12#define PTRACE_GETFDPIC_EXEC 0
13#define PTRACE_GETFDPIC_INTERP 1
14
15#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
16#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
17#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
18#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
19#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
20#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
21#define PT_GETVFPREGS PTRACE_GETVFPREGS
22#define PT_SETVFPREGS PTRACE_SETVFPREGS
23#define PT_GETHBPREGS PTRACE_GETHBPREGS
24#define PT_SETHBPREGS PTRACE_SETHBPREGS
25#define PT_GETFDPIC PTRACE_GETFDPIC
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/shm.h deleted-27
...@@ -1,27 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 time_t shm_atime;
7 int __unused1;
8 time_t shm_dtime;
9 int __unused2;
10 time_t shm_ctime;
11 int __unused3;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17};
18
19struct shminfo {
20 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
21};
22
23struct shm_info {
24 int __used_ids;
25 unsigned long shm_tot, shm_rss, shm_swp;
26 unsigned long __swap_attempts, __swap_successes;
27};
\ No newline at end of file
lib/libc/include/armeb-linux-musleabihf/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
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
\ No newline at end of file
lib/libc/include/generic-musl/ansidecl.h deleted-402
...@@ -1,402 +0,0 @@
1/* ANSI and traditional C compatability macros
2 Copyright (C) 1991-2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
18
19/* ANSI and traditional C compatibility macros
20
21 ANSI C is assumed if __STDC__ is #defined.
22
23 Macro ANSI C definition Traditional C definition
24 ----- ---- - ---------- ----------- - ----------
25 PTR `void *' `char *'
26 const not defined `'
27 volatile not defined `'
28 signed not defined `'
29
30 For ease of writing code which uses GCC extensions but needs to be
31 portable to other compilers, we provide the GCC_VERSION macro that
32 simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
33 wrappers around __attribute__. Also, __extension__ will be #defined
34 to nothing if it doesn't work. See below. */
35
36#ifndef _ANSIDECL_H
37#define _ANSIDECL_H 1
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/* Every source file includes this file,
44 so they will all get the switch for lint. */
45/* LINTLIBRARY */
46
47/* Using MACRO(x,y) in cpp #if conditionals does not work with some
48 older preprocessors. Thus we can't define something like this:
49
50#define HAVE_GCC_VERSION(MAJOR, MINOR) \
51 (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
52
53and then test "#if HAVE_GCC_VERSION(2,7)".
54
55So instead we use the macro below and test it against specific values. */
56
57/* This macro simplifies testing whether we are using gcc, and if it
58 is of a particular minimum version. (Both major & minor numbers are
59 significant.) This macro will evaluate to 0 if we are not using
60 gcc at all. */
61#ifndef GCC_VERSION
62#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
63#endif /* GCC_VERSION */
64
65#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
66/* All known AIX compilers implement these things (but don't always
67 define __STDC__). The RISC/OS MIPS compiler defines these things
68 in SVR4 mode, but does not define __STDC__. */
69/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
70 C++ compilers, does not define __STDC__, though it acts as if this
71 was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
72
73#define PTR void *
74
75#undef const
76#undef volatile
77#undef signed
78
79/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
80 it too, but it's not in C89. */
81#undef inline
82#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
83/* it's a keyword */
84#else
85# if GCC_VERSION >= 2007
86# define inline __inline__ /* __inline__ prevents -pedantic warnings */
87# else
88# define inline /* nothing */
89# endif
90#endif
91
92#else /* Not ANSI C. */
93
94#define PTR char *
95
96/* some systems define these in header files for non-ansi mode */
97#undef const
98#undef volatile
99#undef signed
100#undef inline
101#define const
102#define volatile
103#define signed
104#define inline
105
106#endif /* ANSI C. */
107
108/* Define macros for some gcc attributes. This permits us to use the
109 macros freely, and know that they will come into play for the
110 version of gcc in which they are supported. */
111
112#if (GCC_VERSION < 2007)
113# define __attribute__(x)
114#endif
115
116/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
117#ifndef ATTRIBUTE_MALLOC
118# if (GCC_VERSION >= 2096)
119# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
120# else
121# define ATTRIBUTE_MALLOC
122# endif /* GNUC >= 2.96 */
123#endif /* ATTRIBUTE_MALLOC */
124
125/* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For
126 g++ an attribute on a label must be followed by a semicolon. */
127#ifndef ATTRIBUTE_UNUSED_LABEL
128# ifndef __cplusplus
129# if GCC_VERSION >= 2093
130# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
131# else
132# define ATTRIBUTE_UNUSED_LABEL
133# endif
134# else
135# if GCC_VERSION >= 4005
136# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ;
137# else
138# define ATTRIBUTE_UNUSED_LABEL
139# endif
140# endif
141#endif
142
143/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend
144 couldn't parse attributes placed after the identifier name, and now
145 the entire compiler is built with C++. */
146#ifndef ATTRIBUTE_UNUSED
147#if GCC_VERSION >= 3004
148# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
149#else
150#define ATTRIBUTE_UNUSED
151#endif
152#endif /* ATTRIBUTE_UNUSED */
153
154/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
155 identifier name. */
156#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
157# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
158#else /* !__cplusplus || GNUC >= 3.4 */
159# define ARG_UNUSED(NAME) NAME
160#endif /* !__cplusplus || GNUC >= 3.4 */
161
162#ifndef ATTRIBUTE_NORETURN
163#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
164#endif /* ATTRIBUTE_NORETURN */
165
166/* Attribute `nonnull' was valid as of gcc 3.3. */
167#ifndef ATTRIBUTE_NONNULL
168# if (GCC_VERSION >= 3003)
169# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
170# else
171# define ATTRIBUTE_NONNULL(m)
172# endif /* GNUC >= 3.3 */
173#endif /* ATTRIBUTE_NONNULL */
174
175/* Attribute `returns_nonnull' was valid as of gcc 4.9. */
176#ifndef ATTRIBUTE_RETURNS_NONNULL
177# if (GCC_VERSION >= 4009)
178# define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
179# else
180# define ATTRIBUTE_RETURNS_NONNULL
181# endif /* GNUC >= 4.9 */
182#endif /* ATTRIBUTE_RETURNS_NONNULL */
183
184/* Attribute `pure' was valid as of gcc 3.0. */
185#ifndef ATTRIBUTE_PURE
186# if (GCC_VERSION >= 3000)
187# define ATTRIBUTE_PURE __attribute__ ((__pure__))
188# else
189# define ATTRIBUTE_PURE
190# endif /* GNUC >= 3.0 */
191#endif /* ATTRIBUTE_PURE */
192
193/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
194 This was the case for the `printf' format attribute by itself
195 before GCC 3.3, but as of 3.3 we need to add the `nonnull'
196 attribute to retain this behavior. */
197#ifndef ATTRIBUTE_PRINTF
198#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
199#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
200#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
201#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
202#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
203#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
204#endif /* ATTRIBUTE_PRINTF */
205
206/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on
207 a function pointer. Format attributes were allowed on function
208 pointers as of gcc 3.1. */
209#ifndef ATTRIBUTE_FPTR_PRINTF
210# if (GCC_VERSION >= 3001)
211# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n)
212# else
213# define ATTRIBUTE_FPTR_PRINTF(m, n)
214# endif /* GNUC >= 3.1 */
215# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2)
216# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3)
217# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4)
218# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5)
219# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6)
220#endif /* ATTRIBUTE_FPTR_PRINTF */
221
222/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
223 NULL format specifier was allowed as of gcc 3.3. */
224#ifndef ATTRIBUTE_NULL_PRINTF
225# if (GCC_VERSION >= 3003)
226# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
227# else
228# define ATTRIBUTE_NULL_PRINTF(m, n)
229# endif /* GNUC >= 3.3 */
230# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
231# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
232# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
233# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
234# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
235#endif /* ATTRIBUTE_NULL_PRINTF */
236
237/* Attribute `sentinel' was valid as of gcc 3.5. */
238#ifndef ATTRIBUTE_SENTINEL
239# if (GCC_VERSION >= 3005)
240# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
241# else
242# define ATTRIBUTE_SENTINEL
243# endif /* GNUC >= 3.5 */
244#endif /* ATTRIBUTE_SENTINEL */
245
246
247#ifndef ATTRIBUTE_ALIGNED_ALIGNOF
248# if (GCC_VERSION >= 3000)
249# define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
250# else
251# define ATTRIBUTE_ALIGNED_ALIGNOF(m)
252# endif /* GNUC >= 3.0 */
253#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
254
255/* Useful for structures whose layout must match some binary specification
256 regardless of the alignment and padding qualities of the compiler. */
257#ifndef ATTRIBUTE_PACKED
258# define ATTRIBUTE_PACKED __attribute__ ((packed))
259#endif
260
261/* Attribute `hot' and `cold' was valid as of gcc 4.3. */
262#ifndef ATTRIBUTE_COLD
263# if (GCC_VERSION >= 4003)
264# define ATTRIBUTE_COLD __attribute__ ((__cold__))
265# else
266# define ATTRIBUTE_COLD
267# endif /* GNUC >= 4.3 */
268#endif /* ATTRIBUTE_COLD */
269#ifndef ATTRIBUTE_HOT
270# if (GCC_VERSION >= 4003)
271# define ATTRIBUTE_HOT __attribute__ ((__hot__))
272# else
273# define ATTRIBUTE_HOT
274# endif /* GNUC >= 4.3 */
275#endif /* ATTRIBUTE_HOT */
276
277/* Attribute 'no_sanitize_undefined' was valid as of gcc 4.9. */
278#ifndef ATTRIBUTE_NO_SANITIZE_UNDEFINED
279# if (GCC_VERSION >= 4009)
280# define ATTRIBUTE_NO_SANITIZE_UNDEFINED __attribute__ ((no_sanitize_undefined))
281# else
282# define ATTRIBUTE_NO_SANITIZE_UNDEFINED
283# endif /* GNUC >= 4.9 */
284#endif /* ATTRIBUTE_NO_SANITIZE_UNDEFINED */
285
286/* Attribute 'nonstring' was valid as of gcc 8. */
287#ifndef ATTRIBUTE_NONSTRING
288# if GCC_VERSION >= 8000
289# define ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
290# else
291# define ATTRIBUTE_NONSTRING
292# endif
293#endif
294
295/* We use __extension__ in some places to suppress -pedantic warnings
296 about GCC extensions. This feature didn't work properly before
297 gcc 2.8. */
298#if GCC_VERSION < 2008
299#define __extension__
300#endif
301
302/* This is used to declare a const variable which should be visible
303 outside of the current compilation unit. Use it as
304 EXPORTED_CONST int i = 1;
305 This is because the semantics of const are different in C and C++.
306 "extern const" is permitted in C but it looks strange, and gcc
307 warns about it when -Wc++-compat is not used. */
308#ifdef __cplusplus
309#define EXPORTED_CONST extern const
310#else
311#define EXPORTED_CONST const
312#endif
313
314/* Be conservative and only use enum bitfields with C++ or GCC.
315 FIXME: provide a complete autoconf test for buggy enum bitfields. */
316
317#ifdef __cplusplus
318#define ENUM_BITFIELD(TYPE) enum TYPE
319#elif (GCC_VERSION > 2000)
320#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
321#else
322#define ENUM_BITFIELD(TYPE) unsigned int
323#endif
324
325#if __cpp_constexpr >= 200704
326#define CONSTEXPR constexpr
327#else
328#define CONSTEXPR
329#endif
330
331/* C++11 adds the ability to add "override" after an implementation of a
332 virtual function in a subclass, to:
333 (A) document that this is an override of a virtual function
334 (B) allow the compiler to issue a warning if it isn't (e.g. a mismatch
335 of the type signature).
336
337 Similarly, it allows us to add a "final" to indicate that no subclass
338 may subsequently override the vfunc.
339
340 Provide OVERRIDE and FINAL as macros, allowing us to get these benefits
341 when compiling with C++11 support, but without requiring C++11.
342
343 For gcc, use "-std=c++11" to enable C++11 support; gcc 6 onwards enables
344 this by default (actually GNU++14). */
345
346#if defined __cplusplus
347# if __cplusplus >= 201103
348 /* C++11 claims to be available: use it. Final/override were only
349 implemented in 4.7, though. */
350# if GCC_VERSION < 4007
351# define OVERRIDE
352# define FINAL
353# else
354# define OVERRIDE override
355# define FINAL final
356# endif
357# elif GCC_VERSION >= 4007
358 /* G++ 4.7 supports __final in C++98. */
359# define OVERRIDE
360# define FINAL __final
361# else
362 /* No C++11 support; leave the macros empty. */
363# define OVERRIDE
364# define FINAL
365# endif
366#else
367 /* No C++11 support; leave the macros empty. */
368# define OVERRIDE
369# define FINAL
370#endif
371
372/* A macro to disable the copy constructor and assignment operator.
373 When building with C++11 and above, the methods are explicitly
374 deleted, causing a compile-time error if something tries to copy.
375 For C++03, this just declares the methods, causing a link-time
376 error if the methods end up called (assuming you don't
377 define them). For C++03, for best results, place the macro
378 under the private: access specifier, like this,
379
380 class name_lookup
381 {
382 private:
383 DISABLE_COPY_AND_ASSIGN (name_lookup);
384 };
385
386 so that most attempts at copy are caught at compile-time. */
387
388#if __cplusplus >= 201103
389#define DISABLE_COPY_AND_ASSIGN(TYPE) \
390 TYPE (const TYPE&) = delete; \
391 void operator= (const TYPE &) = delete
392 #else
393#define DISABLE_COPY_AND_ASSIGN(TYPE) \
394 TYPE (const TYPE&); \
395 void operator= (const TYPE &)
396#endif /* __cplusplus >= 201103 */
397
398#ifdef __cplusplus
399}
400#endif
401
402#endif /* ansidecl.h */
\ No newline at end of file
lib/libc/include/generic-musl/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 64
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 64
93
94#define BFD_HOST_64BIT_LONG 1
95#define BFD_HOST_64BIT_LONG_LONG 0
96#if 1
97#define BFD_HOST_64_BIT long
98#define BFD_HOST_U_64_BIT unsigned long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/generic-musl/bfdlink.h deleted-958
...@@ -1,958 +0,0 @@
1/* bfdlink.h -- header file for BFD link routines
2 Copyright (C) 1993-2019 Free Software Foundation, Inc.
3 Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
4
5 This file is part of BFD, the Binary File Descriptor library.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22#ifndef BFDLINK_H
23#define BFDLINK_H
24
25/* Which symbols to strip during a link. */
26enum bfd_link_strip
27{
28 strip_none, /* Don't strip any symbols. */
29 strip_debugger, /* Strip debugging symbols. */
30 strip_some, /* keep_hash is the list of symbols to keep. */
31 strip_all /* Strip all symbols. */
32};
33
34/* Which local symbols to discard during a link. This is irrelevant
35 if strip_all is used. */
36enum bfd_link_discard
37{
38 discard_sec_merge, /* Discard local temporary symbols in SEC_MERGE
39 sections. */
40 discard_none, /* Don't discard any locals. */
41 discard_l, /* Discard local temporary symbols. */
42 discard_all /* Discard all locals. */
43};
44
45/* Whether to generate ELF common symbols with the STT_COMMON type
46 during a relocatable link. */
47enum bfd_link_elf_stt_common
48{
49 unchanged,
50 elf_stt_common,
51 no_elf_stt_common
52};
53
54/* Describes the type of hash table entry structure being used.
55 Different hash table structure have different fields and so
56 support different linking features. */
57enum bfd_link_hash_table_type
58 {
59 bfd_link_generic_hash_table,
60 bfd_link_elf_hash_table
61 };
62
63/* These are the possible types of an entry in the BFD link hash
64 table. */
65
66enum bfd_link_hash_type
67{
68 bfd_link_hash_new, /* Symbol is new. */
69 bfd_link_hash_undefined, /* Symbol seen before, but undefined. */
70 bfd_link_hash_undefweak, /* Symbol is weak and undefined. */
71 bfd_link_hash_defined, /* Symbol is defined. */
72 bfd_link_hash_defweak, /* Symbol is weak and defined. */
73 bfd_link_hash_common, /* Symbol is common. */
74 bfd_link_hash_indirect, /* Symbol is an indirect link. */
75 bfd_link_hash_warning /* Like indirect, but warn if referenced. */
76};
77
78enum bfd_link_common_skip_ar_symbols
79{
80 bfd_link_common_skip_none,
81 bfd_link_common_skip_text,
82 bfd_link_common_skip_data,
83 bfd_link_common_skip_all
84};
85
86struct bfd_link_hash_common_entry
87 {
88 unsigned int alignment_power; /* Alignment. */
89 asection *section; /* Symbol section. */
90 };
91
92/* The linking routines use a hash table which uses this structure for
93 its elements. */
94
95struct bfd_link_hash_entry
96{
97 /* Base hash table entry structure. */
98 struct bfd_hash_entry root;
99
100 /* Type of this entry. */
101 ENUM_BITFIELD (bfd_link_hash_type) type : 8;
102
103 /* Symbol is referenced in a normal regular object file,
104 as distinct from a LTO IR object file. */
105 unsigned int non_ir_ref_regular : 1;
106
107 /* Symbol is referenced in a normal dynamic object file,
108 as distinct from a LTO IR object file. */
109 unsigned int non_ir_ref_dynamic : 1;
110
111 /* Symbol is a built-in define. These will be overridden by PROVIDE
112 in a linker script. */
113 unsigned int linker_def : 1;
114
115 /* Symbol defined in a linker script. */
116 unsigned int ldscript_def : 1;
117
118 /* Symbol will be converted from absolute to section-relative. Set for
119 symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
120 outside of an output section statement. */
121 unsigned int rel_from_abs : 1;
122
123 /* A union of information depending upon the type. */
124 union
125 {
126 /* Nothing is kept for bfd_hash_new. */
127 /* bfd_link_hash_undefined, bfd_link_hash_undefweak. */
128 struct
129 {
130 /* Undefined and common symbols are kept in a linked list through
131 this field. This field is present in all of the union element
132 so that we don't need to remove entries from the list when we
133 change their type. Removing entries would either require the
134 list to be doubly linked, which would waste more memory, or
135 require a traversal. When an undefined or common symbol is
136 created, it should be added to this list, the head of which is in
137 the link hash table itself. As symbols are defined, they need
138 not be removed from the list; anything which reads the list must
139 doublecheck the symbol type.
140
141 Weak symbols are not kept on this list.
142
143 Defined and defweak symbols use this field as a reference marker.
144 If the field is not NULL, or this structure is the tail of the
145 undefined symbol list, the symbol has been referenced. If the
146 symbol is undefined and becomes defined, this field will
147 automatically be non-NULL since the symbol will have been on the
148 undefined symbol list. */
149 struct bfd_link_hash_entry *next;
150 /* BFD symbol was found in. */
151 bfd *abfd;
152 } undef;
153 /* bfd_link_hash_defined, bfd_link_hash_defweak. */
154 struct
155 {
156 struct bfd_link_hash_entry *next;
157 /* Symbol section. */
158 asection *section;
159 /* Symbol value. */
160 bfd_vma value;
161 } def;
162 /* bfd_link_hash_indirect, bfd_link_hash_warning. */
163 struct
164 {
165 struct bfd_link_hash_entry *next;
166 /* Real symbol. */
167 struct bfd_link_hash_entry *link;
168 /* Warning message (bfd_link_hash_warning only). */
169 const char *warning;
170 } i;
171 /* bfd_link_hash_common. */
172 struct
173 {
174 struct bfd_link_hash_entry *next;
175 /* The linker needs to know three things about common
176 symbols: the size, the alignment, and the section in
177 which the symbol should be placed. We store the size
178 here, and we allocate a small structure to hold the
179 section and the alignment. The alignment is stored as a
180 power of two. We don't store all the information
181 directly because we don't want to increase the size of
182 the union; this structure is a major space user in the
183 linker. */
184 struct bfd_link_hash_common_entry *p;
185 /* Common symbol size. */
186 bfd_size_type size;
187 } c;
188 } u;
189};
190
191/* This is the link hash table. It is a derived class of
192 bfd_hash_table. */
193
194struct bfd_link_hash_table
195{
196 /* The hash table itself. */
197 struct bfd_hash_table table;
198 /* A linked list of undefined and common symbols, linked through the
199 next field in the bfd_link_hash_entry structure. */
200 struct bfd_link_hash_entry *undefs;
201 /* Entries are added to the tail of the undefs list. */
202 struct bfd_link_hash_entry *undefs_tail;
203 /* Function to free the hash table on closing BFD. */
204 void (*hash_table_free) (bfd *);
205 /* The type of the link hash table. */
206 enum bfd_link_hash_table_type type;
207};
208
209/* Look up an entry in a link hash table. If FOLLOW is TRUE, this
210 follows bfd_link_hash_indirect and bfd_link_hash_warning links to
211 the real symbol. */
212extern struct bfd_link_hash_entry *bfd_link_hash_lookup
213 (struct bfd_link_hash_table *, const char *, bfd_boolean create,
214 bfd_boolean copy, bfd_boolean follow);
215
216/* Look up an entry in the main linker hash table if the symbol might
217 be wrapped. This should only be used for references to an
218 undefined symbol, not for definitions of a symbol. */
219
220extern struct bfd_link_hash_entry *bfd_wrapped_link_hash_lookup
221 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
222 bfd_boolean, bfd_boolean);
223
224/* If H is a wrapped symbol, ie. the symbol name starts with "__wrap_"
225 and the remainder is found in wrap_hash, return the real symbol. */
226
227extern struct bfd_link_hash_entry *unwrap_hash_lookup
228 (struct bfd_link_info *, bfd *, struct bfd_link_hash_entry *);
229
230/* Traverse a link hash table. */
231extern void bfd_link_hash_traverse
232 (struct bfd_link_hash_table *,
233 bfd_boolean (*) (struct bfd_link_hash_entry *, void *),
234 void *);
235
236/* Add an entry to the undefs list. */
237extern void bfd_link_add_undef
238 (struct bfd_link_hash_table *, struct bfd_link_hash_entry *);
239
240/* Remove symbols from the undefs list that don't belong there. */
241extern void bfd_link_repair_undef_list
242 (struct bfd_link_hash_table *table);
243
244/* Read symbols and cache symbol pointer array in outsymbols. */
245extern bfd_boolean bfd_generic_link_read_symbols (bfd *);
246
247/* Check the relocs in the BFD. Called after all the input
248 files have been loaded, and garbage collection has tagged
249 any unneeded sections. */
250extern bfd_boolean bfd_link_check_relocs (bfd *,struct bfd_link_info *);
251
252struct bfd_sym_chain
253{
254 struct bfd_sym_chain *next;
255 const char *name;
256};
257
258/* How to handle unresolved symbols.
259 There are four possibilities which are enumerated below: */
260enum report_method
261{
262 /* This is the initial value when then link_info structure is created.
263 It allows the various stages of the linker to determine whether they
264 allowed to set the value. */
265 RM_NOT_YET_SET = 0,
266 RM_IGNORE,
267 RM_GENERATE_WARNING,
268 RM_GENERATE_ERROR
269};
270
271typedef enum {with_flags, without_flags} flag_type;
272
273/* A section flag list. */
274struct flag_info_list
275{
276 flag_type with;
277 const char *name;
278 bfd_boolean valid;
279 struct flag_info_list *next;
280};
281
282/* Section flag info. */
283struct flag_info
284{
285 flagword only_with_flags;
286 flagword not_with_flags;
287 struct flag_info_list *flag_list;
288 bfd_boolean flags_initialized;
289};
290
291struct bfd_elf_dynamic_list;
292struct bfd_elf_version_tree;
293
294/* Types of output. */
295
296enum output_type
297{
298 type_pde,
299 type_pie,
300 type_relocatable,
301 type_dll,
302};
303
304#define bfd_link_pde(info) ((info)->type == type_pde)
305#define bfd_link_dll(info) ((info)->type == type_dll)
306#define bfd_link_relocatable(info) ((info)->type == type_relocatable)
307#define bfd_link_pie(info) ((info)->type == type_pie)
308#define bfd_link_executable(info) (bfd_link_pde (info) || bfd_link_pie (info))
309#define bfd_link_pic(info) (bfd_link_dll (info) || bfd_link_pie (info))
310
311/* This structure holds all the information needed to communicate
312 between BFD and the linker when doing a link. */
313
314struct bfd_link_info
315{
316 /* Output type. */
317 ENUM_BITFIELD (output_type) type : 2;
318
319 /* TRUE if BFD should pre-bind symbols in a shared object. */
320 unsigned int symbolic: 1;
321
322 /* TRUE if executable should not contain copy relocs.
323 Setting this true may result in a non-sharable text segment. */
324 unsigned int nocopyreloc: 1;
325
326 /* TRUE if BFD should export all symbols in the dynamic symbol table
327 of an executable, rather than only those used. */
328 unsigned int export_dynamic: 1;
329
330 /* TRUE if a default symbol version should be created and used for
331 exported symbols. */
332 unsigned int create_default_symver: 1;
333
334 /* TRUE if unreferenced sections should be removed. */
335 unsigned int gc_sections: 1;
336
337 /* TRUE if exported symbols should be kept during section gc. */
338 unsigned int gc_keep_exported: 1;
339
340 /* TRUE if every symbol should be reported back via the notice
341 callback. */
342 unsigned int notice_all: 1;
343
344 /* TRUE if the LTO plugin is active. */
345 unsigned int lto_plugin_active: 1;
346
347 /* TRUE if global symbols in discarded sections should be stripped. */
348 unsigned int strip_discarded: 1;
349
350 /* TRUE if all data symbols should be dynamic. */
351 unsigned int dynamic_data: 1;
352
353 /* TRUE if section groups should be resolved. */
354 unsigned int resolve_section_groups: 1;
355
356 /* Which symbols to strip. */
357 ENUM_BITFIELD (bfd_link_strip) strip : 2;
358
359 /* Which local symbols to discard. */
360 ENUM_BITFIELD (bfd_link_discard) discard : 2;
361
362 /* Whether to generate ELF common symbols with the STT_COMMON type. */
363 ENUM_BITFIELD (bfd_link_elf_stt_common) elf_stt_common : 2;
364
365 /* Criteria for skipping symbols when determining
366 whether to include an object from an archive. */
367 ENUM_BITFIELD (bfd_link_common_skip_ar_symbols) common_skip_ar_symbols : 2;
368
369 /* What to do with unresolved symbols in an object file.
370 When producing executables the default is GENERATE_ERROR.
371 When producing shared libraries the default is IGNORE. The
372 assumption with shared libraries is that the reference will be
373 resolved at load/execution time. */
374 ENUM_BITFIELD (report_method) unresolved_syms_in_objects : 2;
375
376 /* What to do with unresolved symbols in a shared library.
377 The same defaults apply. */
378 ENUM_BITFIELD (report_method) unresolved_syms_in_shared_libs : 2;
379
380 /* TRUE if shared objects should be linked directly, not shared. */
381 unsigned int static_link: 1;
382
383 /* TRUE if symbols should be retained in memory, FALSE if they
384 should be freed and reread. */
385 unsigned int keep_memory: 1;
386
387 /* TRUE if BFD should generate relocation information in the final
388 executable. */
389 unsigned int emitrelocations: 1;
390
391 /* TRUE if PT_GNU_RELRO segment should be created. */
392 unsigned int relro: 1;
393
394 /* TRUE if separate code segment should be created. */
395 unsigned int separate_code: 1;
396
397 /* Nonzero if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
398 should be created. 1 for DWARF2 tables, 2 for compact tables. */
399 unsigned int eh_frame_hdr_type: 2;
400
401 /* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
402 unsigned int warn_shared_textrel: 1;
403
404 /* TRUE if we should error when adding a DT_TEXTREL. */
405 unsigned int error_textrel: 1;
406
407 /* TRUE if .hash section should be created. */
408 unsigned int emit_hash: 1;
409
410 /* TRUE if .gnu.hash section should be created. */
411 unsigned int emit_gnu_hash: 1;
412
413 /* If TRUE reduce memory overheads, at the expense of speed. This will
414 cause map file generation to use an O(N^2) algorithm and disable
415 caching ELF symbol buffer. */
416 unsigned int reduce_memory_overheads: 1;
417
418 /* TRUE if the output file should be in a traditional format. This
419 is equivalent to the setting of the BFD_TRADITIONAL_FORMAT flag
420 on the output file, but may be checked when reading the input
421 files. */
422 unsigned int traditional_format: 1;
423
424 /* TRUE if non-PLT relocs should be merged into one reloc section
425 and sorted so that relocs against the same symbol come together. */
426 unsigned int combreloc: 1;
427
428 /* TRUE if a default symbol version should be created and used for
429 imported symbols. */
430 unsigned int default_imported_symver: 1;
431
432 /* TRUE if the new ELF dynamic tags are enabled. */
433 unsigned int new_dtags: 1;
434
435 /* FALSE if .eh_frame unwind info should be generated for PLT and other
436 linker created sections, TRUE if it should be omitted. */
437 unsigned int no_ld_generated_unwind_info: 1;
438
439 /* TRUE if BFD should generate a "task linked" object file,
440 similar to relocatable but also with globals converted to
441 statics. */
442 unsigned int task_link: 1;
443
444 /* TRUE if ok to have multiple definition. */
445 unsigned int allow_multiple_definition: 1;
446
447 /* TRUE if ok to have prohibit multiple definition of absolute symbols. */
448 unsigned int prohibit_multiple_definition_absolute: 1;
449
450 /* TRUE if ok to have version with no definition. */
451 unsigned int allow_undefined_version: 1;
452
453 /* TRUE if some symbols have to be dynamic, controlled by
454 --dynamic-list command line options. */
455 unsigned int dynamic: 1;
456
457 /* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W|PF_X
458 flags. */
459 unsigned int execstack: 1;
460
461 /* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W
462 flags. */
463 unsigned int noexecstack: 1;
464
465 /* TRUE if we want to produced optimized output files. This might
466 need much more time and therefore must be explicitly selected. */
467 unsigned int optimize: 1;
468
469 /* TRUE if user should be informed of removed unreferenced sections. */
470 unsigned int print_gc_sections: 1;
471
472 /* TRUE if we should warn alternate ELF machine code. */
473 unsigned int warn_alternate_em: 1;
474
475 /* TRUE if the linker script contained an explicit PHDRS command. */
476 unsigned int user_phdrs: 1;
477
478 /* TRUE if program headers ought to be loaded. */
479 unsigned int load_phdrs: 1;
480
481 /* TRUE if we should check relocations after all input files have
482 been opened. */
483 unsigned int check_relocs_after_open_input: 1;
484
485 /* TRUE if BND prefix in PLT entries is always generated. */
486 unsigned int bndplt: 1;
487
488 /* TRUE if IBT-enabled PLT entries should be generated. */
489 unsigned int ibtplt: 1;
490
491 /* TRUE if GNU_PROPERTY_X86_FEATURE_1_IBT should be generated. */
492 unsigned int ibt: 1;
493
494 /* TRUE if GNU_PROPERTY_X86_FEATURE_1_SHSTK should be generated. */
495 unsigned int shstk: 1;
496
497 /* TRUE if generation of .interp/PT_INTERP should be suppressed. */
498 unsigned int nointerp: 1;
499
500 /* TRUE if we shouldn't check relocation overflow. */
501 unsigned int no_reloc_overflow_check: 1;
502
503 /* TRUE if generate a 1-byte NOP as suffix for x86 call instruction. */
504 unsigned int call_nop_as_suffix : 1;
505
506 /* TRUE if common symbols should be treated as undefined. */
507 unsigned int inhibit_common_definition : 1;
508
509 /* TRUE if "-Map map" is passed to linker. */
510 unsigned int has_map_file : 1;
511
512 /* The 1-byte NOP for x86 call instruction. */
513 char call_nop_byte;
514
515 /* Char that may appear as the first char of a symbol, but should be
516 skipped (like symbol_leading_char) when looking up symbols in
517 wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
518 char wrap_char;
519
520 /* Separator between archive and filename in linker script filespecs. */
521 char path_separator;
522
523 /* Compress DWARF debug sections. */
524 enum compressed_debug_section_type compress_debug;
525
526 /* Default stack size. Zero means default (often zero itself), -1
527 means explicitly zero-sized. */
528 bfd_signed_vma stacksize;
529
530 /* Enable or disable target specific optimizations.
531
532 Not all targets have optimizations to enable.
533
534 Normally these optimizations are disabled by default but some targets
535 prefer to enable them by default. So this field is a tri-state variable.
536 The values are:
537
538 zero: Enable the optimizations (either from --relax being specified on
539 the command line or the backend's before_allocation emulation function.
540
541 positive: The user has requested that these optimizations be disabled.
542 (Via the --no-relax command line option).
543
544 negative: The optimizations are disabled. (Set when initializing the
545 args_type structure in ldmain.c:main. */
546 signed int disable_target_specific_optimizations;
547
548 /* Function callbacks. */
549 const struct bfd_link_callbacks *callbacks;
550
551 /* Hash table handled by BFD. */
552 struct bfd_link_hash_table *hash;
553
554 /* Hash table of symbols to keep. This is NULL unless strip is
555 strip_some. */
556 struct bfd_hash_table *keep_hash;
557
558 /* Hash table of symbols to report back via the notice callback. If
559 this is NULL, and notice_all is FALSE, then no symbols are
560 reported back. */
561 struct bfd_hash_table *notice_hash;
562
563 /* Hash table of symbols which are being wrapped (the --wrap linker
564 option). If this is NULL, no symbols are being wrapped. */
565 struct bfd_hash_table *wrap_hash;
566
567 /* Hash table of symbols which may be left unresolved during
568 a link. If this is NULL, no symbols can be left unresolved. */
569 struct bfd_hash_table *ignore_hash;
570
571 /* The output BFD. */
572 bfd *output_bfd;
573
574 /* The import library generated. */
575 bfd *out_implib_bfd;
576
577 /* The list of input BFD's involved in the link. These are chained
578 together via the link.next field. */
579 bfd *input_bfds;
580 bfd **input_bfds_tail;
581
582 /* If a symbol should be created for each input BFD, this is section
583 where those symbols should be placed. It must be a section in
584 the output BFD. It may be NULL, in which case no such symbols
585 will be created. This is to support CREATE_OBJECT_SYMBOLS in the
586 linker command language. */
587 asection *create_object_symbols_section;
588
589 /* List of global symbol names that are starting points for marking
590 sections against garbage collection. */
591 struct bfd_sym_chain *gc_sym_list;
592
593 /* If a base output file is wanted, then this points to it */
594 void *base_file;
595
596 /* The function to call when the executable or shared object is
597 loaded. */
598 const char *init_function;
599
600 /* The function to call when the executable or shared object is
601 unloaded. */
602 const char *fini_function;
603
604 /* Number of relaxation passes. Usually only one relaxation pass
605 is needed. But a backend can have as many relaxation passes as
606 necessary. During bfd_relax_section call, it is set to the
607 current pass, starting from 0. */
608 int relax_pass;
609
610 /* Number of relaxation trips. This number is incremented every
611 time the relaxation pass is restarted due to a previous
612 relaxation returning true in *AGAIN. */
613 int relax_trip;
614
615 /* > 0 to treat protected data defined in the shared library as
616 reference external. 0 to treat it as internal. -1 to let
617 backend to decide. */
618 int extern_protected_data;
619
620 /* 1 to make undefined weak symbols dynamic when building a dynamic
621 object. 0 to resolve undefined weak symbols to zero. -1 to let
622 the backend decide. */
623 int dynamic_undefined_weak;
624
625 /* Non-zero if auto-import thunks for DATA items in pei386 DLLs
626 should be generated/linked against. Set to 1 if this feature
627 is explicitly requested by the user, -1 if enabled by default. */
628 int pei386_auto_import;
629
630 /* Non-zero if runtime relocs for DATA items with non-zero addends
631 in pei386 DLLs should be generated. Set to 1 if this feature
632 is explicitly requested by the user, -1 if enabled by default. */
633 int pei386_runtime_pseudo_reloc;
634
635 /* How many spare .dynamic DT_NULL entries should be added? */
636 unsigned int spare_dynamic_tags;
637
638 /* May be used to set DT_FLAGS for ELF. */
639 bfd_vma flags;
640
641 /* May be used to set DT_FLAGS_1 for ELF. */
642 bfd_vma flags_1;
643
644 /* Start and end of RELRO region. */
645 bfd_vma relro_start, relro_end;
646
647 /* List of symbols should be dynamic. */
648 struct bfd_elf_dynamic_list *dynamic_list;
649
650 /* The version information. */
651 struct bfd_elf_version_tree *version_info;
652};
653
654/* This structures holds a set of callback functions. These are called
655 by the BFD linker routines. */
656
657struct bfd_link_callbacks
658{
659 /* A function which is called when an object is added from an
660 archive. ABFD is the archive element being added. NAME is the
661 name of the symbol which caused the archive element to be pulled
662 in. This function may set *SUBSBFD to point to an alternative
663 BFD from which symbols should in fact be added in place of the
664 original BFD's symbols. Returns TRUE if the object should be
665 added, FALSE if it should be skipped. */
666 bfd_boolean (*add_archive_element)
667 (struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
668 /* A function which is called when a symbol is found with multiple
669 definitions. H is the symbol which is defined multiple times.
670 NBFD is the new BFD, NSEC is the new section, and NVAL is the new
671 value. NSEC may be bfd_com_section or bfd_ind_section. */
672 void (*multiple_definition)
673 (struct bfd_link_info *, struct bfd_link_hash_entry *h,
674 bfd *nbfd, asection *nsec, bfd_vma nval);
675 /* A function which is called when a common symbol is defined
676 multiple times. H is the symbol appearing multiple times.
677 NBFD is the BFD of the new symbol. NTYPE is the type of the new
678 symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or
679 bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
680 is the size of the new symbol. */
681 void (*multiple_common)
682 (struct bfd_link_info *, struct bfd_link_hash_entry *h,
683 bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
684 /* A function which is called to add a symbol to a set. ENTRY is
685 the link hash table entry for the set itself (e.g.,
686 __CTOR_LIST__). RELOC is the relocation to use for an entry in
687 the set when generating a relocatable file, and is also used to
688 get the size of the entry when generating an executable file.
689 ABFD, SEC and VALUE identify the value to add to the set. */
690 void (*add_to_set)
691 (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
692 bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value);
693 /* A function which is called when the name of a g++ constructor or
694 destructor is found. This is only called by some object file
695 formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a
696 destructor. This will use BFD_RELOC_CTOR when generating a
697 relocatable file. NAME is the name of the symbol found. ABFD,
698 SECTION and VALUE are the value of the symbol. */
699 void (*constructor)
700 (struct bfd_link_info *, bfd_boolean constructor, const char *name,
701 bfd *abfd, asection *sec, bfd_vma value);
702 /* A function which is called to issue a linker warning. For
703 example, this is called when there is a reference to a warning
704 symbol. WARNING is the warning to be issued. SYMBOL is the name
705 of the symbol which triggered the warning; it may be NULL if
706 there is none. ABFD, SECTION and ADDRESS identify the location
707 which trigerred the warning; either ABFD or SECTION or both may
708 be NULL if the location is not known. */
709 void (*warning)
710 (struct bfd_link_info *, const char *warning, const char *symbol,
711 bfd *abfd, asection *section, bfd_vma address);
712 /* A function which is called when a relocation is attempted against
713 an undefined symbol. NAME is the symbol which is undefined.
714 ABFD, SECTION and ADDRESS identify the location from which the
715 reference is made. IS_FATAL indicates whether an undefined symbol is
716 a fatal error or not. In some cases SECTION may be NULL. */
717 void (*undefined_symbol)
718 (struct bfd_link_info *, const char *name, bfd *abfd,
719 asection *section, bfd_vma address, bfd_boolean is_fatal);
720 /* A function which is called when a reloc overflow occurs. ENTRY is
721 the link hash table entry for the symbol the reloc is against.
722 NAME is the name of the local symbol or section the reloc is
723 against, RELOC_NAME is the name of the relocation, and ADDEND is
724 any addend that is used. ABFD, SECTION and ADDRESS identify the
725 location at which the overflow occurs; if this is the result of a
726 bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
727 ABFD will be NULL. */
728 void (*reloc_overflow)
729 (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
730 const char *name, const char *reloc_name, bfd_vma addend,
731 bfd *abfd, asection *section, bfd_vma address);
732 /* A function which is called when a dangerous reloc is performed.
733 MESSAGE is an appropriate message.
734 ABFD, SECTION and ADDRESS identify the location at which the
735 problem occurred; if this is the result of a
736 bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
737 ABFD will be NULL. */
738 void (*reloc_dangerous)
739 (struct bfd_link_info *, const char *message,
740 bfd *abfd, asection *section, bfd_vma address);
741 /* A function which is called when a reloc is found to be attached
742 to a symbol which is not being written out. NAME is the name of
743 the symbol. ABFD, SECTION and ADDRESS identify the location of
744 the reloc; if this is the result of a
745 bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
746 ABFD will be NULL. */
747 void (*unattached_reloc)
748 (struct bfd_link_info *, const char *name,
749 bfd *abfd, asection *section, bfd_vma address);
750 /* A function which is called when a symbol in notice_hash is
751 defined or referenced. H is the symbol, INH the indirect symbol
752 if applicable. ABFD, SECTION and ADDRESS are the (new) value of
753 the symbol. If SECTION is bfd_und_section, this is a reference.
754 FLAGS are the symbol BSF_* flags. */
755 bfd_boolean (*notice)
756 (struct bfd_link_info *, struct bfd_link_hash_entry *h,
757 struct bfd_link_hash_entry *inh,
758 bfd *abfd, asection *section, bfd_vma address, flagword flags);
759 /* Error or warning link info message. */
760 void (*einfo)
761 (const char *fmt, ...);
762 /* General link info message. */
763 void (*info)
764 (const char *fmt, ...);
765 /* Message to be printed in linker map file. */
766 void (*minfo)
767 (const char *fmt, ...);
768 /* This callback provides a chance for users of the BFD library to
769 override its decision about whether to place two adjacent sections
770 into the same segment. */
771 bfd_boolean (*override_segment_assignment)
772 (struct bfd_link_info *, bfd * abfd,
773 asection * current_section, asection * previous_section,
774 bfd_boolean new_segment);
775};
776
777/* The linker builds link_order structures which tell the code how to
778 include input data in the output file. */
779
780/* These are the types of link_order structures. */
781
782enum bfd_link_order_type
783{
784 bfd_undefined_link_order, /* Undefined. */
785 bfd_indirect_link_order, /* Built from a section. */
786 bfd_data_link_order, /* Set to explicit data. */
787 bfd_section_reloc_link_order, /* Relocate against a section. */
788 bfd_symbol_reloc_link_order /* Relocate against a symbol. */
789};
790
791/* This is the link_order structure itself. These form a chain
792 attached to the output section whose contents they are describing. */
793
794struct bfd_link_order
795{
796 /* Next link_order in chain. */
797 struct bfd_link_order *next;
798 /* Type of link_order. */
799 enum bfd_link_order_type type;
800 /* Offset within output section. */
801 bfd_vma offset;
802 /* Size within output section. */
803 bfd_size_type size;
804 /* Type specific information. */
805 union
806 {
807 struct
808 {
809 /* Section to include. If this is used, then
810 section->output_section must be the section the
811 link_order is attached to, section->output_offset must
812 equal the link_order offset field, and section->size
813 must equal the link_order size field. Maybe these
814 restrictions should be relaxed someday. */
815 asection *section;
816 } indirect;
817 struct
818 {
819 /* Size of contents, or zero when contents should be filled by
820 the architecture-dependent fill function.
821 A non-zero value allows filling of the output section
822 with an arbitrary repeated pattern. */
823 unsigned int size;
824 /* Data to put into file. */
825 bfd_byte *contents;
826 } data;
827 struct
828 {
829 /* Description of reloc to generate. Used for
830 bfd_section_reloc_link_order and
831 bfd_symbol_reloc_link_order. */
832 struct bfd_link_order_reloc *p;
833 } reloc;
834 } u;
835};
836
837/* A linker order of type bfd_section_reloc_link_order or
838 bfd_symbol_reloc_link_order means to create a reloc against a
839 section or symbol, respectively. This is used to implement -Ur to
840 generate relocs for the constructor tables. The
841 bfd_link_order_reloc structure describes the reloc that BFD should
842 create. It is similar to a arelent, but I didn't use arelent
843 because the linker does not know anything about most symbols, and
844 any asymbol structure it creates will be partially meaningless.
845 This information could logically be in the bfd_link_order struct,
846 but I didn't want to waste the space since these types of relocs
847 are relatively rare. */
848
849struct bfd_link_order_reloc
850{
851 /* Reloc type. */
852 bfd_reloc_code_real_type reloc;
853
854 union
855 {
856 /* For type bfd_section_reloc_link_order, this is the section
857 the reloc should be against. This must be a section in the
858 output BFD, not any of the input BFDs. */
859 asection *section;
860 /* For type bfd_symbol_reloc_link_order, this is the name of the
861 symbol the reloc should be against. */
862 const char *name;
863 } u;
864
865 /* Addend to use. The object file should contain zero. The BFD
866 backend is responsible for filling in the contents of the object
867 file correctly. For some object file formats (e.g., COFF) the
868 addend must be stored into in the object file, and for some
869 (e.g., SPARC a.out) it is kept in the reloc. */
870 bfd_vma addend;
871};
872
873/* Allocate a new link_order for a section. */
874extern struct bfd_link_order *bfd_new_link_order (bfd *, asection *);
875
876/* These structures are used to describe version information for the
877 ELF linker. These structures could be manipulated entirely inside
878 BFD, but it would be a pain. Instead, the regular linker sets up
879 these structures, and then passes them into BFD. */
880
881/* Glob pattern for a version. */
882
883struct bfd_elf_version_expr
884{
885 /* Next glob pattern for this version. */
886 struct bfd_elf_version_expr *next;
887 /* Glob pattern. */
888 const char *pattern;
889 /* Set if pattern is not a glob. */
890 unsigned int literal : 1;
891 /* Defined by ".symver". */
892 unsigned int symver : 1;
893 /* Defined by version script. */
894 unsigned int script : 1;
895 /* Pattern type. */
896#define BFD_ELF_VERSION_C_TYPE 1
897#define BFD_ELF_VERSION_CXX_TYPE 2
898#define BFD_ELF_VERSION_JAVA_TYPE 4
899 unsigned int mask : 3;
900};
901
902struct bfd_elf_version_expr_head
903{
904 /* List of all patterns, both wildcards and non-wildcards. */
905 struct bfd_elf_version_expr *list;
906 /* Hash table for non-wildcards. */
907 void *htab;
908 /* Remaining patterns. */
909 struct bfd_elf_version_expr *remaining;
910 /* What kind of pattern types are present in list (bitmask). */
911 unsigned int mask;
912};
913
914/* Version dependencies. */
915
916struct bfd_elf_version_deps
917{
918 /* Next dependency for this version. */
919 struct bfd_elf_version_deps *next;
920 /* The version which this version depends upon. */
921 struct bfd_elf_version_tree *version_needed;
922};
923
924/* A node in the version tree. */
925
926struct bfd_elf_version_tree
927{
928 /* Next version. */
929 struct bfd_elf_version_tree *next;
930 /* Name of this version. */
931 const char *name;
932 /* Version number. */
933 unsigned int vernum;
934 /* Regular expressions for global symbols in this version. */
935 struct bfd_elf_version_expr_head globals;
936 /* Regular expressions for local symbols in this version. */
937 struct bfd_elf_version_expr_head locals;
938 /* List of versions which this version depends upon. */
939 struct bfd_elf_version_deps *deps;
940 /* Index of the version name. This is used within BFD. */
941 unsigned int name_indx;
942 /* Whether this version tree was used. This is used within BFD. */
943 int used;
944 /* Matching hook. */
945 struct bfd_elf_version_expr *(*match)
946 (struct bfd_elf_version_expr_head *head,
947 struct bfd_elf_version_expr *prev, const char *sym);
948};
949
950struct bfd_elf_dynamic_list
951{
952 struct bfd_elf_version_expr_head head;
953 struct bfd_elf_version_expr *(*match)
954 (struct bfd_elf_version_expr_head *head,
955 struct bfd_elf_version_expr *prev, const char *sym);
956};
957
958#endif
\ No newline at end of file
lib/libc/include/generic-musl/bits/alltypes.h+31-10
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1#define _Addr int1#define _Addr long
2#define _Int64 long long2#define _Int64 long
3#define _Reg int3#define _Reg long
44
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;6typedef __builtin_va_list va_list;
...@@ -20,6 +20,22 @@ typedef unsigned wchar_t;...@@ -20,6 +20,22 @@ typedef unsigned wchar_t;
20#endif20#endif
2121
22#endif22#endif
23#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
24typedef unsigned wint_t;
25#define __DEFINED_wint_t
26#endif
27
28
29#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
30typedef int blksize_t;
31#define __DEFINED_blksize_t
32#endif
33
34#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
35typedef unsigned int nlink_t;
36#define __DEFINED_nlink_t
37#endif
38
2339
24#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)40#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
25typedef float float_t;41typedef float float_t;
...@@ -50,37 +66,37 @@ typedef long suseconds_t;...@@ -50,37 +66,37 @@ typedef long suseconds_t;
5066
5167
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)68#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;69typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t70#define __DEFINED_pthread_attr_t
55#endif71#endif
5672
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)73#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;74typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t75#define __DEFINED_pthread_mutex_t
60#endif76#endif
6177
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)78#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;79typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
64#define __DEFINED_mtx_t80#define __DEFINED_mtx_t
65#endif81#endif
6682
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)83#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;84typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t85#define __DEFINED_pthread_cond_t
70#endif86#endif
7187
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)88#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;89typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
74#define __DEFINED_cnd_t90#define __DEFINED_cnd_t
75#endif91#endif
7692
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)93#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;94typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t95#define __DEFINED_pthread_rwlock_t
80#endif96#endif
8197
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)98#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;99typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t100#define __DEFINED_pthread_barrier_t
85#endif101#endif
86102
...@@ -339,6 +355,11 @@ typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;...@@ -339,6 +355,11 @@ typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
339#endif355#endif
340356
341357
358#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
359struct _IO_FILE { char __x; };
360#define __DEFINED_struct__IO_FILE
361#endif
362
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)363#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;364typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE365#define __DEFINED_FILE
lib/libc/include/generic-musl/bits/endian.h+1-5
...@@ -1,5 +1 @@...@@ -1,5 +1 @@
1#if __ARMEB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
1#define __BYTE_ORDER __LITTLE_ENDIAN
\ No newline at end of file
lib/libc/include/generic-musl/bits/fcntl.h deleted-38
...@@ -1,38 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27#define F_GETLK 5
28#define F_SETLK 6
29#define F_SETLKW 7
30#define F_SETOWN 8
31#define F_GETOWN 9
32#define F_SETSIG 10
33#define F_GETSIG 11
34
35#define F_SETOWN_EX 15
36#define F_GETOWN_EX 16
37
38#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/generic-musl/bits/fenv.h deleted-23
...@@ -1,23 +0,0 @@
1#ifndef __ARM_PCS_VFP
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INVALID 1
6#define FE_DIVBYZERO 2
7#define FE_OVERFLOW 4
8#define FE_UNDERFLOW 8
9#define FE_INEXACT 16
10#define FE_ALL_EXCEPT 31
11#define FE_TONEAREST 0
12#define FE_DOWNWARD 0x800000
13#define FE_UPWARD 0x400000
14#define FE_TOWARDZERO 0xc00000
15#endif
16
17typedef unsigned long fexcept_t;
18
19typedef struct {
20 unsigned long __cw;
21} fenv_t;
22
23#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/generic-musl/bits/ioctl.h+2-98
...@@ -64,6 +64,8 @@...@@ -64,6 +64,8 @@
64#define TIOCGPTLCK 0x8004543964#define TIOCGPTLCK 0x80045439
65#define TIOCGEXCL 0x8004544065#define TIOCGEXCL 0x80045440
66#define TIOCGPTPEER 0x544166#define TIOCGPTPEER 0x5441
67#define TIOCGISO7816 0x80285442
68#define TIOCSISO7816 0xc0285443
6769
68#define FIONCLEX 0x545070#define FIONCLEX 0x5450
69#define FIOCLEX 0x545171#define FIOCLEX 0x5451
...@@ -82,24 +84,6 @@...@@ -82,24 +84,6 @@
82#define TIOCGICOUNT 0x545D84#define TIOCGICOUNT 0x545D
83#define FIOQSIZE 0x546085#define FIOQSIZE 0x5460
8486
85#define TIOCPKT_DATA 0
86#define TIOCPKT_FLUSHREAD 1
87#define TIOCPKT_FLUSHWRITE 2
88#define TIOCPKT_STOP 4
89#define TIOCPKT_START 8
90#define TIOCPKT_NOSTOP 16
91#define TIOCPKT_DOSTOP 32
92#define TIOCPKT_IOCTL 64
93
94#define TIOCSER_TEMT 0x01
95
96struct winsize {
97 unsigned short ws_row;
98 unsigned short ws_col;
99 unsigned short ws_xpixel;
100 unsigned short ws_ypixel;
101};
102
103#define TIOCM_LE 0x00187#define TIOCM_LE 0x001
104#define TIOCM_DTR 0x00288#define TIOCM_DTR 0x002
105#define TIOCM_RTS 0x00489#define TIOCM_RTS 0x004
...@@ -115,23 +99,6 @@ struct winsize {...@@ -115,23 +99,6 @@ struct winsize {
115#define TIOCM_OUT2 0x400099#define TIOCM_OUT2 0x4000
116#define TIOCM_LOOP 0x8000100#define TIOCM_LOOP 0x8000
117101
118#define N_TTY 0
119#define N_SLIP 1
120#define N_MOUSE 2
121#define N_PPP 3
122#define N_STRIP 4
123#define N_AX25 5
124#define N_X25 6
125#define N_6PACK 7
126#define N_MASC 8
127#define N_R3964 9
128#define N_PROFIBUS_FDL 10
129#define N_IRDA 11
130#define N_SMSBLOCK 12
131#define N_HDLC 13
132#define N_SYNC_PPP 14
133#define N_HCI 15
134
135#define FIOSETOWN 0x8901102#define FIOSETOWN 0x8901
136#define SIOCSPGRP 0x8902103#define SIOCSPGRP 0x8902
137#define FIOGETOWN 0x8903104#define FIOGETOWN 0x8903
...@@ -140,67 +107,4 @@ struct winsize {...@@ -140,67 +107,4 @@ struct winsize {
140#define SIOCGSTAMP 0x8906107#define SIOCGSTAMP 0x8906
141#define SIOCGSTAMPNS 0x8907108#define SIOCGSTAMPNS 0x8907
142109
143#define SIOCADDRT 0x890B
144#define SIOCDELRT 0x890C
145#define SIOCRTMSG 0x890D
146
147#define SIOCGIFNAME 0x8910
148#define SIOCSIFLINK 0x8911
149#define SIOCGIFCONF 0x8912
150#define SIOCGIFFLAGS 0x8913
151#define SIOCSIFFLAGS 0x8914
152#define SIOCGIFADDR 0x8915
153#define SIOCSIFADDR 0x8916
154#define SIOCGIFDSTADDR 0x8917
155#define SIOCSIFDSTADDR 0x8918
156#define SIOCGIFBRDADDR 0x8919
157#define SIOCSIFBRDADDR 0x891a
158#define SIOCGIFNETMASK 0x891b
159#define SIOCSIFNETMASK 0x891c
160#define SIOCGIFMETRIC 0x891d
161#define SIOCSIFMETRIC 0x891e
162#define SIOCGIFMEM 0x891f
163#define SIOCSIFMEM 0x8920
164#define SIOCGIFMTU 0x8921
165#define SIOCSIFMTU 0x8922
166#define SIOCSIFNAME 0x8923
167#define SIOCSIFHWADDR 0x8924
168#define SIOCGIFENCAP 0x8925
169#define SIOCSIFENCAP 0x8926
170#define SIOCGIFHWADDR 0x8927
171#define SIOCGIFSLAVE 0x8929
172#define SIOCSIFSLAVE 0x8930
173#define SIOCADDMULTI 0x8931
174#define SIOCDELMULTI 0x8932
175#define SIOCGIFINDEX 0x8933
176#define SIOGIFINDEX SIOCGIFINDEX
177#define SIOCSIFPFLAGS 0x8934
178#define SIOCGIFPFLAGS 0x8935
179#define SIOCDIFADDR 0x8936
180#define SIOCSIFHWBROADCAST 0x8937
181#define SIOCGIFCOUNT 0x8938
182
183#define SIOCGIFBR 0x8940
184#define SIOCSIFBR 0x8941
185
186#define SIOCGIFTXQLEN 0x8942
187#define SIOCSIFTXQLEN 0x8943
188
189#define SIOCDARP 0x8953
190#define SIOCGARP 0x8954
191#define SIOCSARP 0x8955
192
193#define SIOCDRARP 0x8960
194#define SIOCGRARP 0x8961
195#define SIOCSRARP 0x8962
196
197#define SIOCGIFMAP 0x8970
198#define SIOCSIFMAP 0x8971
199
200#define SIOCADDDLCI 0x8980
201#define SIOCDELDLCI 0x8981
202
203#define SIOCDEVPRIVATE 0x89F0
204#define SIOCPROTOPRIVATE 0x89E0
205
206#include <bits/ioctl_fix.h>110#include <bits/ioctl_fix.h>
\ No newline at end of file
lib/libc/include/generic-musl/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[32];
\ No newline at end of file
lib/libc/include/generic-musl/bits/signal.h deleted-86
...@@ -1,86 +0,0 @@
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 unsigned long trap_no, error_code, oldmask;
13 unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
14 unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
15 unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
16 unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
17 unsigned long arm_cpsr, fault_address;
18} mcontext_t;
19#else
20typedef struct {
21 unsigned long __regs[21];
22} mcontext_t;
23#endif
24
25struct sigaltstack {
26 void *ss_sp;
27 int ss_flags;
28 size_t ss_size;
29};
30
31typedef struct __ucontext {
32 unsigned long uc_flags;
33 struct __ucontext *uc_link;
34 stack_t uc_stack;
35 mcontext_t uc_mcontext;
36 sigset_t uc_sigmask;
37 unsigned long long uc_regspace[64];
38} ucontext_t;
39
40#define SA_NOCLDSTOP 1
41#define SA_NOCLDWAIT 2
42#define SA_SIGINFO 4
43#define SA_ONSTACK 0x08000000
44#define SA_RESTART 0x10000000
45#define SA_NODEFER 0x40000000
46#define SA_RESETHAND 0x80000000
47#define SA_RESTORER 0x04000000
48
49#endif
50
51#define SIGHUP 1
52#define SIGINT 2
53#define SIGQUIT 3
54#define SIGILL 4
55#define SIGTRAP 5
56#define SIGABRT 6
57#define SIGIOT SIGABRT
58#define SIGBUS 7
59#define SIGFPE 8
60#define SIGKILL 9
61#define SIGUSR1 10
62#define SIGSEGV 11
63#define SIGUSR2 12
64#define SIGPIPE 13
65#define SIGALRM 14
66#define SIGTERM 15
67#define SIGSTKFLT 16
68#define SIGCHLD 17
69#define SIGCONT 18
70#define SIGSTOP 19
71#define SIGTSTP 20
72#define SIGTTIN 21
73#define SIGTTOU 22
74#define SIGURG 23
75#define SIGXCPU 24
76#define SIGXFSZ 25
77#define SIGVTALRM 26
78#define SIGPROF 27
79#define SIGWINCH 28
80#define SIGIO 29
81#define SIGPOLL 29
82#define SIGPWR 30
83#define SIGSYS 31
84#define SIGUNUSED SIGSYS
85
86#define _NSIG 65
\ No newline at end of file
lib/libc/include/generic-musl/bits/syscall.h+566-719
...@@ -1,720 +1,567 @@...@@ -1,720 +1,567 @@
1#define __NR_restart_syscall 01#define __NR_io_setup 0
2#define __NR_exit 12#define __NR_io_destroy 1
3#define __NR_fork 23#define __NR_io_submit 2
4#define __NR_read 34#define __NR_io_cancel 3
5#define __NR_write 45#define __NR_io_getevents 4
6#define __NR_open 56#define __NR_setxattr 5
7#define __NR_close 67#define __NR_lsetxattr 6
8#define __NR_creat 88#define __NR_fsetxattr 7
9#define __NR_link 99#define __NR_getxattr 8
10#define __NR_unlink 1010#define __NR_lgetxattr 9
11#define __NR_execve 1111#define __NR_fgetxattr 10
12#define __NR_chdir 1212#define __NR_listxattr 11
13#define __NR_mknod 1413#define __NR_llistxattr 12
14#define __NR_chmod 1514#define __NR_flistxattr 13
15#define __NR_lchown 1615#define __NR_removexattr 14
16#define __NR_lseek 1916#define __NR_lremovexattr 15
17#define __NR_getpid 2017#define __NR_fremovexattr 16
18#define __NR_mount 2118#define __NR_getcwd 17
19#define __NR_setuid 2319#define __NR_lookup_dcookie 18
20#define __NR_getuid 2420#define __NR_eventfd2 19
21#define __NR_ptrace 2621#define __NR_epoll_create1 20
22#define __NR_pause 2922#define __NR_epoll_ctl 21
23#define __NR_access 3323#define __NR_epoll_pwait 22
24#define __NR_nice 3424#define __NR_dup 23
25#define __NR_sync 3625#define __NR_dup3 24
26#define __NR_kill 3726#define __NR_fcntl 25
27#define __NR_rename 3827#define __NR_inotify_init1 26
28#define __NR_mkdir 3928#define __NR_inotify_add_watch 27
29#define __NR_rmdir 4029#define __NR_inotify_rm_watch 28
30#define __NR_dup 4130#define __NR_ioctl 29
31#define __NR_pipe 4231#define __NR_ioprio_set 30
32#define __NR_times 4332#define __NR_ioprio_get 31
33#define __NR_brk 4533#define __NR_flock 32
34#define __NR_setgid 4634#define __NR_mknodat 33
35#define __NR_getgid 4735#define __NR_mkdirat 34
36#define __NR_geteuid 4936#define __NR_unlinkat 35
37#define __NR_getegid 5037#define __NR_symlinkat 36
38#define __NR_acct 5138#define __NR_linkat 37
39#define __NR_umount2 5239#define __NR_renameat 38
40#define __NR_ioctl 5440#define __NR_umount2 39
41#define __NR_fcntl 5541#define __NR_mount 40
42#define __NR_setpgid 5742#define __NR_pivot_root 41
43#define __NR_umask 6043#define __NR_nfsservctl 42
44#define __NR_chroot 6144#define __NR_statfs 43
45#define __NR_ustat 6245#define __NR_fstatfs 44
46#define __NR_dup2 6346#define __NR_truncate 45
47#define __NR_getppid 6447#define __NR_ftruncate 46
48#define __NR_getpgrp 6548#define __NR_fallocate 47
49#define __NR_setsid 6649#define __NR_faccessat 48
50#define __NR_sigaction 6750#define __NR_chdir 49
51#define __NR_setreuid 7051#define __NR_fchdir 50
52#define __NR_setregid 7152#define __NR_chroot 51
53#define __NR_sigsuspend 7253#define __NR_fchmod 52
54#define __NR_sigpending 7354#define __NR_fchmodat 53
55#define __NR_sethostname 7455#define __NR_fchownat 54
56#define __NR_setrlimit 7556#define __NR_fchown 55
57#define __NR_getrusage 7757#define __NR_openat 56
58#define __NR_gettimeofday 7858#define __NR_close 57
59#define __NR_settimeofday 7959#define __NR_vhangup 58
60#define __NR_getgroups 8060#define __NR_pipe2 59
61#define __NR_setgroups 8161#define __NR_quotactl 60
62#define __NR_symlink 8362#define __NR_getdents64 61
63#define __NR_readlink 8563#define __NR_lseek 62
64#define __NR_uselib 8664#define __NR_read 63
65#define __NR_swapon 8765#define __NR_write 64
66#define __NR_reboot 8866#define __NR_readv 65
67#define __NR_munmap 9167#define __NR_writev 66
68#define __NR_truncate 9268#define __NR_pread64 67
69#define __NR_ftruncate 9369#define __NR_pwrite64 68
70#define __NR_fchmod 9470#define __NR_preadv 69
71#define __NR_fchown 9571#define __NR_pwritev 70
72#define __NR_getpriority 9672#define __NR_sendfile 71
73#define __NR_setpriority 9773#define __NR_pselect6 72
74#define __NR_statfs 9974#define __NR_ppoll 73
75#define __NR_fstatfs 10075#define __NR_signalfd4 74
76#define __NR_syslog 10376#define __NR_vmsplice 75
77#define __NR_setitimer 10477#define __NR_splice 76
78#define __NR_getitimer 10578#define __NR_tee 77
79#define __NR_stat 10679#define __NR_readlinkat 78
80#define __NR_lstat 10780#define __NR_newfstatat 79
81#define __NR_fstat 10881#define __NR_fstat 80
82#define __NR_vhangup 11182#define __NR_sync 81
83#define __NR_wait4 11483#define __NR_fsync 82
84#define __NR_swapoff 11584#define __NR_fdatasync 83
85#define __NR_sysinfo 11685#define __NR_sync_file_range 84
86#define __NR_fsync 11886#define __NR_timerfd_create 85
87#define __NR_sigreturn 11987#define __NR_timerfd_settime 86
88#define __NR_clone 12088#define __NR_timerfd_gettime 87
89#define __NR_setdomainname 12189#define __NR_utimensat 88
90#define __NR_uname 12290#define __NR_acct 89
91#define __NR_adjtimex 12491#define __NR_capget 90
92#define __NR_mprotect 12592#define __NR_capset 91
93#define __NR_sigprocmask 12693#define __NR_personality 92
94#define __NR_init_module 12894#define __NR_exit 93
95#define __NR_delete_module 12995#define __NR_exit_group 94
96#define __NR_quotactl 13196#define __NR_waitid 95
97#define __NR_getpgid 13297#define __NR_set_tid_address 96
98#define __NR_fchdir 13398#define __NR_unshare 97
99#define __NR_bdflush 13499#define __NR_futex 98
100#define __NR_sysfs 135100#define __NR_set_robust_list 99
101#define __NR_personality 136101#define __NR_get_robust_list 100
102#define __NR_setfsuid 138102#define __NR_nanosleep 101
103#define __NR_setfsgid 139103#define __NR_getitimer 102
104#define __NR__llseek 140104#define __NR_setitimer 103
105#define __NR_getdents 141105#define __NR_kexec_load 104
106#define __NR__newselect 142106#define __NR_init_module 105
107#define __NR_flock 143107#define __NR_delete_module 106
108#define __NR_msync 144108#define __NR_timer_create 107
109#define __NR_readv 145109#define __NR_timer_gettime 108
110#define __NR_writev 146110#define __NR_timer_getoverrun 109
111#define __NR_getsid 147111#define __NR_timer_settime 110
112#define __NR_fdatasync 148112#define __NR_timer_delete 111
113#define __NR__sysctl 149113#define __NR_clock_settime 112
114#define __NR_mlock 150114#define __NR_clock_gettime 113
115#define __NR_munlock 151115#define __NR_clock_getres 114
116#define __NR_mlockall 152116#define __NR_clock_nanosleep 115
117#define __NR_munlockall 153117#define __NR_syslog 116
118#define __NR_sched_setparam 154118#define __NR_ptrace 117
119#define __NR_sched_getparam 155119#define __NR_sched_setparam 118
120#define __NR_sched_setscheduler 156120#define __NR_sched_setscheduler 119
121#define __NR_sched_getscheduler 157121#define __NR_sched_getscheduler 120
122#define __NR_sched_yield 158122#define __NR_sched_getparam 121
123#define __NR_sched_get_priority_max 159123#define __NR_sched_setaffinity 122
124#define __NR_sched_get_priority_min 160124#define __NR_sched_getaffinity 123
125#define __NR_sched_rr_get_interval 161125#define __NR_sched_yield 124
126#define __NR_nanosleep 162126#define __NR_sched_get_priority_max 125
127#define __NR_mremap 163127#define __NR_sched_get_priority_min 126
128#define __NR_setresuid 164128#define __NR_sched_rr_get_interval 127
129#define __NR_getresuid 165129#define __NR_restart_syscall 128
130#define __NR_poll 168130#define __NR_kill 129
131#define __NR_nfsservctl 169131#define __NR_tkill 130
132#define __NR_setresgid 170132#define __NR_tgkill 131
133#define __NR_getresgid 171133#define __NR_sigaltstack 132
134#define __NR_prctl 172134#define __NR_rt_sigsuspend 133
135#define __NR_rt_sigreturn 173135#define __NR_rt_sigaction 134
136#define __NR_rt_sigaction 174136#define __NR_rt_sigprocmask 135
137#define __NR_rt_sigprocmask 175137#define __NR_rt_sigpending 136
138#define __NR_rt_sigpending 176138#define __NR_rt_sigtimedwait 137
139#define __NR_rt_sigtimedwait 177139#define __NR_rt_sigqueueinfo 138
140#define __NR_rt_sigqueueinfo 178140#define __NR_rt_sigreturn 139
141#define __NR_rt_sigsuspend 179141#define __NR_setpriority 140
142#define __NR_pread64 180142#define __NR_getpriority 141
143#define __NR_pwrite64 181143#define __NR_reboot 142
144#define __NR_chown 182144#define __NR_setregid 143
145#define __NR_getcwd 183145#define __NR_setgid 144
146#define __NR_capget 184146#define __NR_setreuid 145
147#define __NR_capset 185147#define __NR_setuid 146
148#define __NR_sigaltstack 186148#define __NR_setresuid 147
149#define __NR_sendfile 187149#define __NR_getresuid 148
150#define __NR_vfork 190150#define __NR_setresgid 149
151#define __NR_ugetrlimit 191151#define __NR_getresgid 150
152#define __NR_mmap2 192152#define __NR_setfsuid 151
153#define __NR_truncate64 193153#define __NR_setfsgid 152
154#define __NR_ftruncate64 194154#define __NR_times 153
155#define __NR_stat64 195155#define __NR_setpgid 154
156#define __NR_lstat64 196156#define __NR_getpgid 155
157#define __NR_fstat64 197157#define __NR_getsid 156
158#define __NR_lchown32 198158#define __NR_setsid 157
159#define __NR_getuid32 199159#define __NR_getgroups 158
160#define __NR_getgid32 200160#define __NR_setgroups 159
161#define __NR_geteuid32 201161#define __NR_uname 160
162#define __NR_getegid32 202162#define __NR_sethostname 161
163#define __NR_setreuid32 203163#define __NR_setdomainname 162
164#define __NR_setregid32 204164#define __NR_getrlimit 163
165#define __NR_getgroups32 205165#define __NR_setrlimit 164
166#define __NR_setgroups32 206166#define __NR_getrusage 165
167#define __NR_fchown32 207167#define __NR_umask 166
168#define __NR_setresuid32 208168#define __NR_prctl 167
169#define __NR_getresuid32 209169#define __NR_getcpu 168
170#define __NR_setresgid32 210170#define __NR_gettimeofday 169
171#define __NR_getresgid32 211171#define __NR_settimeofday 170
172#define __NR_chown32 212172#define __NR_adjtimex 171
173#define __NR_setuid32 213173#define __NR_getpid 172
174#define __NR_setgid32 214174#define __NR_getppid 173
175#define __NR_setfsuid32 215175#define __NR_getuid 174
176#define __NR_setfsgid32 216176#define __NR_geteuid 175
177#define __NR_getdents64 217177#define __NR_getgid 176
178#define __NR_pivot_root 218178#define __NR_getegid 177
179#define __NR_mincore 219179#define __NR_gettid 178
180#define __NR_madvise 220180#define __NR_sysinfo 179
181#define __NR_fcntl64 221181#define __NR_mq_open 180
182#define __NR_gettid 224182#define __NR_mq_unlink 181
183#define __NR_readahead 225183#define __NR_mq_timedsend 182
184#define __NR_setxattr 226184#define __NR_mq_timedreceive 183
185#define __NR_lsetxattr 227185#define __NR_mq_notify 184
186#define __NR_fsetxattr 228186#define __NR_mq_getsetattr 185
187#define __NR_getxattr 229187#define __NR_msgget 186
188#define __NR_lgetxattr 230188#define __NR_msgctl 187
189#define __NR_fgetxattr 231189#define __NR_msgrcv 188
190#define __NR_listxattr 232190#define __NR_msgsnd 189
191#define __NR_llistxattr 233191#define __NR_semget 190
192#define __NR_flistxattr 234192#define __NR_semctl 191
193#define __NR_removexattr 235193#define __NR_semtimedop 192
194#define __NR_lremovexattr 236194#define __NR_semop 193
195#define __NR_fremovexattr 237195#define __NR_shmget 194
196#define __NR_tkill 238196#define __NR_shmctl 195
197#define __NR_sendfile64 239197#define __NR_shmat 196
198#define __NR_futex 240198#define __NR_shmdt 197
199#define __NR_sched_setaffinity 241199#define __NR_socket 198
200#define __NR_sched_getaffinity 242200#define __NR_socketpair 199
201#define __NR_io_setup 243201#define __NR_bind 200
202#define __NR_io_destroy 244202#define __NR_listen 201
203#define __NR_io_getevents 245203#define __NR_accept 202
204#define __NR_io_submit 246204#define __NR_connect 203
205#define __NR_io_cancel 247205#define __NR_getsockname 204
206#define __NR_exit_group 248206#define __NR_getpeername 205
207#define __NR_lookup_dcookie 249207#define __NR_sendto 206
208#define __NR_epoll_create 250208#define __NR_recvfrom 207
209#define __NR_epoll_ctl 251209#define __NR_setsockopt 208
210#define __NR_epoll_wait 252210#define __NR_getsockopt 209
211#define __NR_remap_file_pages 253211#define __NR_shutdown 210
212#define __NR_set_tid_address 256212#define __NR_sendmsg 211
213#define __NR_timer_create 257213#define __NR_recvmsg 212
214#define __NR_timer_settime 258214#define __NR_readahead 213
215#define __NR_timer_gettime 259215#define __NR_brk 214
216#define __NR_timer_getoverrun 260216#define __NR_munmap 215
217#define __NR_timer_delete 261217#define __NR_mremap 216
218#define __NR_clock_settime 262218#define __NR_add_key 217
219#define __NR_clock_gettime 263219#define __NR_request_key 218
220#define __NR_clock_getres 264220#define __NR_keyctl 219
221#define __NR_clock_nanosleep 265221#define __NR_clone 220
222#define __NR_statfs64 266222#define __NR_execve 221
223#define __NR_fstatfs64 267223#define __NR_mmap 222
224#define __NR_tgkill 268224#define __NR_fadvise64 223
225#define __NR_utimes 269225#define __NR_swapon 224
226#define __NR_fadvise64_64 270226#define __NR_swapoff 225
227#define __NR_arm_fadvise64_64 270227#define __NR_mprotect 226
228#define __NR_pciconfig_iobase 271228#define __NR_msync 227
229#define __NR_pciconfig_read 272229#define __NR_mlock 228
230#define __NR_pciconfig_write 273230#define __NR_munlock 229
231#define __NR_mq_open 274231#define __NR_mlockall 230
232#define __NR_mq_unlink 275232#define __NR_munlockall 231
233#define __NR_mq_timedsend 276233#define __NR_mincore 232
234#define __NR_mq_timedreceive 277234#define __NR_madvise 233
235#define __NR_mq_notify 278235#define __NR_remap_file_pages 234
236#define __NR_mq_getsetattr 279236#define __NR_mbind 235
237#define __NR_waitid 280237#define __NR_get_mempolicy 236
238#define __NR_socket 281238#define __NR_set_mempolicy 237
239#define __NR_bind 282239#define __NR_migrate_pages 238
240#define __NR_connect 283240#define __NR_move_pages 239
241#define __NR_listen 284241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_accept 285242#define __NR_perf_event_open 241
243#define __NR_getsockname 286243#define __NR_accept4 242
244#define __NR_getpeername 287244#define __NR_recvmmsg 243
245#define __NR_socketpair 288245#define __NR_wait4 260
246#define __NR_send 289246#define __NR_prlimit64 261
247#define __NR_sendto 290247#define __NR_fanotify_init 262
248#define __NR_recv 291248#define __NR_fanotify_mark 263
249#define __NR_recvfrom 292249#define __NR_name_to_handle_at 264
250#define __NR_shutdown 293250#define __NR_open_by_handle_at 265
251#define __NR_setsockopt 294251#define __NR_clock_adjtime 266
252#define __NR_getsockopt 295252#define __NR_syncfs 267
253#define __NR_sendmsg 296253#define __NR_setns 268
254#define __NR_recvmsg 297254#define __NR_sendmmsg 269
255#define __NR_semop 298255#define __NR_process_vm_readv 270
256#define __NR_semget 299256#define __NR_process_vm_writev 271
257#define __NR_semctl 300257#define __NR_kcmp 272
258#define __NR_msgsnd 301258#define __NR_finit_module 273
259#define __NR_msgrcv 302259#define __NR_sched_setattr 274
260#define __NR_msgget 303260#define __NR_sched_getattr 275
261#define __NR_msgctl 304261#define __NR_renameat2 276
262#define __NR_shmat 305262#define __NR_seccomp 277
263#define __NR_shmdt 306263#define __NR_getrandom 278
264#define __NR_shmget 307264#define __NR_memfd_create 279
265#define __NR_shmctl 308265#define __NR_bpf 280
266#define __NR_add_key 309266#define __NR_execveat 281
267#define __NR_request_key 310267#define __NR_userfaultfd 282
268#define __NR_keyctl 311268#define __NR_membarrier 283
269#define __NR_semtimedop 312269#define __NR_mlock2 284
270#define __NR_vserver 313270#define __NR_copy_file_range 285
271#define __NR_ioprio_set 314271#define __NR_preadv2 286
272#define __NR_ioprio_get 315272#define __NR_pwritev2 287
273#define __NR_inotify_init 316273#define __NR_pkey_mprotect 288
274#define __NR_inotify_add_watch 317274#define __NR_pkey_alloc 289
275#define __NR_inotify_rm_watch 318275#define __NR_pkey_free 290
276#define __NR_mbind 319276#define __NR_statx 291
277#define __NR_get_mempolicy 320277#define __NR_io_pgetevents 292
278#define __NR_set_mempolicy 321278#define __NR_rseq 293
279#define __NR_openat 322279#define __NR_kexec_file_load 294
280#define __NR_mkdirat 323280#define __NR_pidfd_send_signal 424
281#define __NR_mknodat 324281#define __NR_io_uring_setup 425
282#define __NR_fchownat 325282#define __NR_io_uring_enter 426
283#define __NR_futimesat 326283#define __NR_io_uring_register 427
284#define __NR_fstatat64 327
285#define __NR_unlinkat 328
286#define __NR_renameat 329
287#define __NR_linkat 330
288#define __NR_symlinkat 331
289#define __NR_readlinkat 332
290#define __NR_fchmodat 333
291#define __NR_faccessat 334
292#define __NR_pselect6 335
293#define __NR_ppoll 336
294#define __NR_unshare 337
295#define __NR_set_robust_list 338
296#define __NR_get_robust_list 339
297#define __NR_splice 340
298#define __NR_sync_file_range2 341
299#define __NR_arm_sync_file_range 341
300#define __NR_tee 342
301#define __NR_vmsplice 343
302#define __NR_move_pages 344
303#define __NR_getcpu 345
304#define __NR_epoll_pwait 346
305#define __NR_kexec_load 347
306#define __NR_utimensat 348
307#define __NR_signalfd 349
308#define __NR_timerfd_create 350
309#define __NR_eventfd 351
310#define __NR_fallocate 352
311#define __NR_timerfd_settime 353
312#define __NR_timerfd_gettime 354
313#define __NR_signalfd4 355
314#define __NR_eventfd2 356
315#define __NR_epoll_create1 357
316#define __NR_dup3 358
317#define __NR_pipe2 359
318#define __NR_inotify_init1 360
319#define __NR_preadv 361
320#define __NR_pwritev 362
321#define __NR_rt_tgsigqueueinfo 363
322#define __NR_perf_event_open 364
323#define __NR_recvmmsg 365
324#define __NR_accept4 366
325#define __NR_fanotify_init 367
326#define __NR_fanotify_mark 368
327#define __NR_prlimit64 369
328#define __NR_name_to_handle_at 370
329#define __NR_open_by_handle_at 371
330#define __NR_clock_adjtime 372
331#define __NR_syncfs 373
332#define __NR_sendmmsg 374
333#define __NR_setns 375
334#define __NR_process_vm_readv 376
335#define __NR_process_vm_writev 377
336#define __NR_kcmp 378
337#define __NR_finit_module 379
338#define __NR_sched_setattr 380
339#define __NR_sched_getattr 381
340#define __NR_renameat2 382
341#define __NR_seccomp 383
342#define __NR_getrandom 384
343#define __NR_memfd_create 385
344#define __NR_bpf 386
345#define __NR_execveat 387
346#define __NR_userfaultfd 388
347#define __NR_membarrier 389
348#define __NR_mlock2 390
349#define __NR_copy_file_range 391
350#define __NR_preadv2 392
351#define __NR_pwritev2 393
352#define __NR_pkey_mprotect 394
353#define __NR_pkey_alloc 395
354#define __NR_pkey_free 396
355#define __NR_statx 397
356#define __NR_rseq 398
357284
358#define __ARM_NR_breakpoint 0x0f0001
359#define __ARM_NR_cacheflush 0x0f0002
360#define __ARM_NR_usr26 0x0f0003
361#define __ARM_NR_usr32 0x0f0004
362#define __ARM_NR_set_tls 0x0f0005
363#define __ARM_NR_get_tls 0x0f0006
364
365#define SYS_restart_syscall 0
366#define SYS_exit 1
367#define SYS_fork 2
368#define SYS_read 3
369#define SYS_write 4
370#define SYS_open 5
371#define SYS_close 6
372#define SYS_creat 8
373#define SYS_link 9
374#define SYS_unlink 10
375#define SYS_execve 11
376#define SYS_chdir 12
377#define SYS_mknod 14
378#define SYS_chmod 15
379#define SYS_lchown 16
380#define SYS_lseek 19
381#define SYS_getpid 20
382#define SYS_mount 21
383#define SYS_setuid 23
384#define SYS_getuid 24
385#define SYS_ptrace 26
386#define SYS_pause 29
387#define SYS_access 33
388#define SYS_nice 34
389#define SYS_sync 36
390#define SYS_kill 37
391#define SYS_rename 38
392#define SYS_mkdir 39
393#define SYS_rmdir 40
394#define SYS_dup 41
395#define SYS_pipe 42
396#define SYS_times 43
397#define SYS_brk 45
398#define SYS_setgid 46
399#define SYS_getgid 47
400#define SYS_geteuid 49
401#define SYS_getegid 50
402#define SYS_acct 51
403#define SYS_umount2 52
404#define SYS_ioctl 54
405#define SYS_fcntl 55
406#define SYS_setpgid 57
407#define SYS_umask 60
408#define SYS_chroot 61
409#define SYS_ustat 62
410#define SYS_dup2 63
411#define SYS_getppid 64
412#define SYS_getpgrp 65
413#define SYS_setsid 66
414#define SYS_sigaction 67
415#define SYS_setreuid 70
416#define SYS_setregid 71
417#define SYS_sigsuspend 72
418#define SYS_sigpending 73
419#define SYS_sethostname 74
420#define SYS_setrlimit 75
421#define SYS_getrusage 77
422#define SYS_gettimeofday 78
423#define SYS_settimeofday 79
424#define SYS_getgroups 80
425#define SYS_setgroups 81
426#define SYS_symlink 83
427#define SYS_readlink 85
428#define SYS_uselib 86
429#define SYS_swapon 87
430#define SYS_reboot 88
431#define SYS_munmap 91
432#define SYS_truncate 92
433#define SYS_ftruncate 93
434#define SYS_fchmod 94
435#define SYS_fchown 95
436#define SYS_getpriority 96
437#define SYS_setpriority 97
438#define SYS_statfs 99
439#define SYS_fstatfs 100
440#define SYS_syslog 103
441#define SYS_setitimer 104
442#define SYS_getitimer 105
443#define SYS_stat 106
444#define SYS_lstat 107
445#define SYS_fstat 108
446#define SYS_vhangup 111
447#define SYS_wait4 114
448#define SYS_swapoff 115
449#define SYS_sysinfo 116
450#define SYS_fsync 118
451#define SYS_sigreturn 119
452#define SYS_clone 120
453#define SYS_setdomainname 121
454#define SYS_uname 122
455#define SYS_adjtimex 124
456#define SYS_mprotect 125
457#define SYS_sigprocmask 126
458#define SYS_init_module 128
459#define SYS_delete_module 129
460#define SYS_quotactl 131
461#define SYS_getpgid 132
462#define SYS_fchdir 133
463#define SYS_bdflush 134
464#define SYS_sysfs 135
465#define SYS_personality 136
466#define SYS_setfsuid 138
467#define SYS_setfsgid 139
468#define SYS__llseek 140
469#define SYS_getdents 141
470#define SYS__newselect 142
471#define SYS_flock 143
472#define SYS_msync 144
473#define SYS_readv 145
474#define SYS_writev 146
475#define SYS_getsid 147
476#define SYS_fdatasync 148
477#define SYS__sysctl 149
478#define SYS_mlock 150
479#define SYS_munlock 151
480#define SYS_mlockall 152
481#define SYS_munlockall 153
482#define SYS_sched_setparam 154
483#define SYS_sched_getparam 155
484#define SYS_sched_setscheduler 156
485#define SYS_sched_getscheduler 157
486#define SYS_sched_yield 158
487#define SYS_sched_get_priority_max 159
488#define SYS_sched_get_priority_min 160
489#define SYS_sched_rr_get_interval 161
490#define SYS_nanosleep 162
491#define SYS_mremap 163
492#define SYS_setresuid 164
493#define SYS_getresuid 165
494#define SYS_poll 168
495#define SYS_nfsservctl 169
496#define SYS_setresgid 170
497#define SYS_getresgid 171
498#define SYS_prctl 172
499#define SYS_rt_sigreturn 173
500#define SYS_rt_sigaction 174
501#define SYS_rt_sigprocmask 175
502#define SYS_rt_sigpending 176
503#define SYS_rt_sigtimedwait 177
504#define SYS_rt_sigqueueinfo 178
505#define SYS_rt_sigsuspend 179
506#define SYS_pread64 180
507#define SYS_pwrite64 181
508#define SYS_chown 182
509#define SYS_getcwd 183
510#define SYS_capget 184
511#define SYS_capset 185
512#define SYS_sigaltstack 186
513#define SYS_sendfile 187
514#define SYS_vfork 190
515#define SYS_ugetrlimit 191
516#define SYS_mmap2 192
517#define SYS_truncate64 193
518#define SYS_ftruncate64 194
519#define SYS_stat64 195
520#define SYS_lstat64 196
521#define SYS_fstat64 197
522#define SYS_lchown32 198
523#define SYS_getuid32 199
524#define SYS_getgid32 200
525#define SYS_geteuid32 201
526#define SYS_getegid32 202
527#define SYS_setreuid32 203
528#define SYS_setregid32 204
529#define SYS_getgroups32 205
530#define SYS_setgroups32 206
531#define SYS_fchown32 207
532#define SYS_setresuid32 208
533#define SYS_getresuid32 209
534#define SYS_setresgid32 210
535#define SYS_getresgid32 211
536#define SYS_chown32 212
537#define SYS_setuid32 213
538#define SYS_setgid32 214
539#define SYS_setfsuid32 215
540#define SYS_setfsgid32 216
541#define SYS_getdents64 217
542#define SYS_pivot_root 218
543#define SYS_mincore 219
544#define SYS_madvise 220
545#define SYS_fcntl64 221
546#define SYS_gettid 224
547#define SYS_readahead 225
548#define SYS_setxattr 226
549#define SYS_lsetxattr 227
550#define SYS_fsetxattr 228
551#define SYS_getxattr 229
552#define SYS_lgetxattr 230
553#define SYS_fgetxattr 231
554#define SYS_listxattr 232
555#define SYS_llistxattr 233
556#define SYS_flistxattr 234
557#define SYS_removexattr 235
558#define SYS_lremovexattr 236
559#define SYS_fremovexattr 237
560#define SYS_tkill 238
561#define SYS_sendfile64 239
562#define SYS_futex 240
563#define SYS_sched_setaffinity 241
564#define SYS_sched_getaffinity 242
565#define SYS_io_setup 243
566#define SYS_io_destroy 244
567#define SYS_io_getevents 245
568#define SYS_io_submit 246
569#define SYS_io_cancel 247
570#define SYS_exit_group 248
571#define SYS_lookup_dcookie 249
572#define SYS_epoll_create 250
573#define SYS_epoll_ctl 251
574#define SYS_epoll_wait 252
575#define SYS_remap_file_pages 253
576#define SYS_set_tid_address 256
577#define SYS_timer_create 257
578#define SYS_timer_settime 258
579#define SYS_timer_gettime 259
580#define SYS_timer_getoverrun 260
581#define SYS_timer_delete 261
582#define SYS_clock_settime 262
583#define SYS_clock_gettime 263
584#define SYS_clock_getres 264
585#define SYS_clock_nanosleep 265
586#define SYS_statfs64 266
587#define SYS_fstatfs64 267
588#define SYS_tgkill 268
589#define SYS_utimes 269
590#define SYS_fadvise64_64 270
591#define SYS_arm_fadvise64_64 270
592#define SYS_pciconfig_iobase 271
593#define SYS_pciconfig_read 272
594#define SYS_pciconfig_write 273
595#define SYS_mq_open 274
596#define SYS_mq_unlink 275
597#define SYS_mq_timedsend 276
598#define SYS_mq_timedreceive 277
599#define SYS_mq_notify 278
600#define SYS_mq_getsetattr 279
601#define SYS_waitid 280
602#define SYS_socket 281
603#define SYS_bind 282
604#define SYS_connect 283
605#define SYS_listen 284
606#define SYS_accept 285
607#define SYS_getsockname 286
608#define SYS_getpeername 287
609#define SYS_socketpair 288
610#define SYS_send 289
611#define SYS_sendto 290
612#define SYS_recv 291
613#define SYS_recvfrom 292
614#define SYS_shutdown 293
615#define SYS_setsockopt 294
616#define SYS_getsockopt 295
617#define SYS_sendmsg 296
618#define SYS_recvmsg 297
619#define SYS_semop 298
620#define SYS_semget 299
621#define SYS_semctl 300
622#define SYS_msgsnd 301
623#define SYS_msgrcv 302
624#define SYS_msgget 303
625#define SYS_msgctl 304
626#define SYS_shmat 305
627#define SYS_shmdt 306
628#define SYS_shmget 307
629#define SYS_shmctl 308
630#define SYS_add_key 309
631#define SYS_request_key 310
632#define SYS_keyctl 311
633#define SYS_semtimedop 312
634#define SYS_vserver 313
635#define SYS_ioprio_set 314
636#define SYS_ioprio_get 315
637#define SYS_inotify_init 316
638#define SYS_inotify_add_watch 317
639#define SYS_inotify_rm_watch 318
640#define SYS_mbind 319
641#define SYS_get_mempolicy 320
642#define SYS_set_mempolicy 321
643#define SYS_openat 322
644#define SYS_mkdirat 323
645#define SYS_mknodat 324
646#define SYS_fchownat 325
647#define SYS_futimesat 326
648#define SYS_fstatat64 327
649#define SYS_unlinkat 328
650#define SYS_renameat 329
651#define SYS_linkat 330
652#define SYS_symlinkat 331
653#define SYS_readlinkat 332
654#define SYS_fchmodat 333
655#define SYS_faccessat 334
656#define SYS_pselect6 335
657#define SYS_ppoll 336
658#define SYS_unshare 337
659#define SYS_set_robust_list 338
660#define SYS_get_robust_list 339
661#define SYS_splice 340
662#define SYS_sync_file_range2 341
663#define SYS_arm_sync_file_range 341
664#define SYS_tee 342
665#define SYS_vmsplice 343
666#define SYS_move_pages 344
667#define SYS_getcpu 345
668#define SYS_epoll_pwait 346
669#define SYS_kexec_load 347
670#define SYS_utimensat 348
671#define SYS_signalfd 349
672#define SYS_timerfd_create 350
673#define SYS_eventfd 351
674#define SYS_fallocate 352
675#define SYS_timerfd_settime 353
676#define SYS_timerfd_gettime 354
677#define SYS_signalfd4 355
678#define SYS_eventfd2 356
679#define SYS_epoll_create1 357
680#define SYS_dup3 358
681#define SYS_pipe2 359
682#define SYS_inotify_init1 360
683#define SYS_preadv 361
684#define SYS_pwritev 362
685#define SYS_rt_tgsigqueueinfo 363
686#define SYS_perf_event_open 364
687#define SYS_recvmmsg 365
688#define SYS_accept4 366
689#define SYS_fanotify_init 367
690#define SYS_fanotify_mark 368
691#define SYS_prlimit64 369
692#define SYS_name_to_handle_at 370
693#define SYS_open_by_handle_at 371
694#define SYS_clock_adjtime 372
695#define SYS_syncfs 373
696#define SYS_sendmmsg 374
697#define SYS_setns 375
698#define SYS_process_vm_readv 376
699#define SYS_process_vm_writev 377
700#define SYS_kcmp 378
701#define SYS_finit_module 379
702#define SYS_sched_setattr 380
703#define SYS_sched_getattr 381
704#define SYS_renameat2 382
705#define SYS_seccomp 383
706#define SYS_getrandom 384
707#define SYS_memfd_create 385
708#define SYS_bpf 386
709#define SYS_execveat 387
710#define SYS_userfaultfd 388
711#define SYS_membarrier 389
712#define SYS_mlock2 390
713#define SYS_copy_file_range 391
714#define SYS_preadv2 392
715#define SYS_pwritev2 393
716#define SYS_pkey_mprotect 394
717#define SYS_pkey_alloc 395
718#define SYS_pkey_free 396
719#define SYS_statx 397
720#define SYS_rseq 398
\ No newline at end of file
285#define SYS_io_setup 0
286#define SYS_io_destroy 1
287#define SYS_io_submit 2
288#define SYS_io_cancel 3
289#define SYS_io_getevents 4
290#define SYS_setxattr 5
291#define SYS_lsetxattr 6
292#define SYS_fsetxattr 7
293#define SYS_getxattr 8
294#define SYS_lgetxattr 9
295#define SYS_fgetxattr 10
296#define SYS_listxattr 11
297#define SYS_llistxattr 12
298#define SYS_flistxattr 13
299#define SYS_removexattr 14
300#define SYS_lremovexattr 15
301#define SYS_fremovexattr 16
302#define SYS_getcwd 17
303#define SYS_lookup_dcookie 18
304#define SYS_eventfd2 19
305#define SYS_epoll_create1 20
306#define SYS_epoll_ctl 21
307#define SYS_epoll_pwait 22
308#define SYS_dup 23
309#define SYS_dup3 24
310#define SYS_fcntl 25
311#define SYS_inotify_init1 26
312#define SYS_inotify_add_watch 27
313#define SYS_inotify_rm_watch 28
314#define SYS_ioctl 29
315#define SYS_ioprio_set 30
316#define SYS_ioprio_get 31
317#define SYS_flock 32
318#define SYS_mknodat 33
319#define SYS_mkdirat 34
320#define SYS_unlinkat 35
321#define SYS_symlinkat 36
322#define SYS_linkat 37
323#define SYS_renameat 38
324#define SYS_umount2 39
325#define SYS_mount 40
326#define SYS_pivot_root 41
327#define SYS_nfsservctl 42
328#define SYS_statfs 43
329#define SYS_fstatfs 44
330#define SYS_truncate 45
331#define SYS_ftruncate 46
332#define SYS_fallocate 47
333#define SYS_faccessat 48
334#define SYS_chdir 49
335#define SYS_fchdir 50
336#define SYS_chroot 51
337#define SYS_fchmod 52
338#define SYS_fchmodat 53
339#define SYS_fchownat 54
340#define SYS_fchown 55
341#define SYS_openat 56
342#define SYS_close 57
343#define SYS_vhangup 58
344#define SYS_pipe2 59
345#define SYS_quotactl 60
346#define SYS_getdents64 61
347#define SYS_lseek 62
348#define SYS_read 63
349#define SYS_write 64
350#define SYS_readv 65
351#define SYS_writev 66
352#define SYS_pread64 67
353#define SYS_pwrite64 68
354#define SYS_preadv 69
355#define SYS_pwritev 70
356#define SYS_sendfile 71
357#define SYS_pselect6 72
358#define SYS_ppoll 73
359#define SYS_signalfd4 74
360#define SYS_vmsplice 75
361#define SYS_splice 76
362#define SYS_tee 77
363#define SYS_readlinkat 78
364#define SYS_newfstatat 79
365#define SYS_fstat 80
366#define SYS_sync 81
367#define SYS_fsync 82
368#define SYS_fdatasync 83
369#define SYS_sync_file_range 84
370#define SYS_timerfd_create 85
371#define SYS_timerfd_settime 86
372#define SYS_timerfd_gettime 87
373#define SYS_utimensat 88
374#define SYS_acct 89
375#define SYS_capget 90
376#define SYS_capset 91
377#define SYS_personality 92
378#define SYS_exit 93
379#define SYS_exit_group 94
380#define SYS_waitid 95
381#define SYS_set_tid_address 96
382#define SYS_unshare 97
383#define SYS_futex 98
384#define SYS_set_robust_list 99
385#define SYS_get_robust_list 100
386#define SYS_nanosleep 101
387#define SYS_getitimer 102
388#define SYS_setitimer 103
389#define SYS_kexec_load 104
390#define SYS_init_module 105
391#define SYS_delete_module 106
392#define SYS_timer_create 107
393#define SYS_timer_gettime 108
394#define SYS_timer_getoverrun 109
395#define SYS_timer_settime 110
396#define SYS_timer_delete 111
397#define SYS_clock_settime 112
398#define SYS_clock_gettime 113
399#define SYS_clock_getres 114
400#define SYS_clock_nanosleep 115
401#define SYS_syslog 116
402#define SYS_ptrace 117
403#define SYS_sched_setparam 118
404#define SYS_sched_setscheduler 119
405#define SYS_sched_getscheduler 120
406#define SYS_sched_getparam 121
407#define SYS_sched_setaffinity 122
408#define SYS_sched_getaffinity 123
409#define SYS_sched_yield 124
410#define SYS_sched_get_priority_max 125
411#define SYS_sched_get_priority_min 126
412#define SYS_sched_rr_get_interval 127
413#define SYS_restart_syscall 128
414#define SYS_kill 129
415#define SYS_tkill 130
416#define SYS_tgkill 131
417#define SYS_sigaltstack 132
418#define SYS_rt_sigsuspend 133
419#define SYS_rt_sigaction 134
420#define SYS_rt_sigprocmask 135
421#define SYS_rt_sigpending 136
422#define SYS_rt_sigtimedwait 137
423#define SYS_rt_sigqueueinfo 138
424#define SYS_rt_sigreturn 139
425#define SYS_setpriority 140
426#define SYS_getpriority 141
427#define SYS_reboot 142
428#define SYS_setregid 143
429#define SYS_setgid 144
430#define SYS_setreuid 145
431#define SYS_setuid 146
432#define SYS_setresuid 147
433#define SYS_getresuid 148
434#define SYS_setresgid 149
435#define SYS_getresgid 150
436#define SYS_setfsuid 151
437#define SYS_setfsgid 152
438#define SYS_times 153
439#define SYS_setpgid 154
440#define SYS_getpgid 155
441#define SYS_getsid 156
442#define SYS_setsid 157
443#define SYS_getgroups 158
444#define SYS_setgroups 159
445#define SYS_uname 160
446#define SYS_sethostname 161
447#define SYS_setdomainname 162
448#define SYS_getrlimit 163
449#define SYS_setrlimit 164
450#define SYS_getrusage 165
451#define SYS_umask 166
452#define SYS_prctl 167
453#define SYS_getcpu 168
454#define SYS_gettimeofday 169
455#define SYS_settimeofday 170
456#define SYS_adjtimex 171
457#define SYS_getpid 172
458#define SYS_getppid 173
459#define SYS_getuid 174
460#define SYS_geteuid 175
461#define SYS_getgid 176
462#define SYS_getegid 177
463#define SYS_gettid 178
464#define SYS_sysinfo 179
465#define SYS_mq_open 180
466#define SYS_mq_unlink 181
467#define SYS_mq_timedsend 182
468#define SYS_mq_timedreceive 183
469#define SYS_mq_notify 184
470#define SYS_mq_getsetattr 185
471#define SYS_msgget 186
472#define SYS_msgctl 187
473#define SYS_msgrcv 188
474#define SYS_msgsnd 189
475#define SYS_semget 190
476#define SYS_semctl 191
477#define SYS_semtimedop 192
478#define SYS_semop 193
479#define SYS_shmget 194
480#define SYS_shmctl 195
481#define SYS_shmat 196
482#define SYS_shmdt 197
483#define SYS_socket 198
484#define SYS_socketpair 199
485#define SYS_bind 200
486#define SYS_listen 201
487#define SYS_accept 202
488#define SYS_connect 203
489#define SYS_getsockname 204
490#define SYS_getpeername 205
491#define SYS_sendto 206
492#define SYS_recvfrom 207
493#define SYS_setsockopt 208
494#define SYS_getsockopt 209
495#define SYS_shutdown 210
496#define SYS_sendmsg 211
497#define SYS_recvmsg 212
498#define SYS_readahead 213
499#define SYS_brk 214
500#define SYS_munmap 215
501#define SYS_mremap 216
502#define SYS_add_key 217
503#define SYS_request_key 218
504#define SYS_keyctl 219
505#define SYS_clone 220
506#define SYS_execve 221
507#define SYS_mmap 222
508#define SYS_fadvise64 223
509#define SYS_swapon 224
510#define SYS_swapoff 225
511#define SYS_mprotect 226
512#define SYS_msync 227
513#define SYS_mlock 228
514#define SYS_munlock 229
515#define SYS_mlockall 230
516#define SYS_munlockall 231
517#define SYS_mincore 232
518#define SYS_madvise 233
519#define SYS_remap_file_pages 234
520#define SYS_mbind 235
521#define SYS_get_mempolicy 236
522#define SYS_set_mempolicy 237
523#define SYS_migrate_pages 238
524#define SYS_move_pages 239
525#define SYS_rt_tgsigqueueinfo 240
526#define SYS_perf_event_open 241
527#define SYS_accept4 242
528#define SYS_recvmmsg 243
529#define SYS_wait4 260
530#define SYS_prlimit64 261
531#define SYS_fanotify_init 262
532#define SYS_fanotify_mark 263
533#define SYS_name_to_handle_at 264
534#define SYS_open_by_handle_at 265
535#define SYS_clock_adjtime 266
536#define SYS_syncfs 267
537#define SYS_setns 268
538#define SYS_sendmmsg 269
539#define SYS_process_vm_readv 270
540#define SYS_process_vm_writev 271
541#define SYS_kcmp 272
542#define SYS_finit_module 273
543#define SYS_sched_setattr 274
544#define SYS_sched_getattr 275
545#define SYS_renameat2 276
546#define SYS_seccomp 277
547#define SYS_getrandom 278
548#define SYS_memfd_create 279
549#define SYS_bpf 280
550#define SYS_execveat 281
551#define SYS_userfaultfd 282
552#define SYS_membarrier 283
553#define SYS_mlock2 284
554#define SYS_copy_file_range 285
555#define SYS_preadv2 286
556#define SYS_pwritev2 287
557#define SYS_pkey_mprotect 288
558#define SYS_pkey_alloc 289
559#define SYS_pkey_free 290
560#define SYS_statx 291
561#define SYS_io_pgetevents 292
562#define SYS_rseq 293
563#define SYS_kexec_file_load 294
564#define SYS_pidfd_send_signal 424
565#define SYS_io_uring_setup 425
566#define SYS_io_uring_enter 426
567#define SYS_io_uring_register 427
\ No newline at end of file
lib/libc/include/generic-musl/bits/user.h deleted-36
...@@ -1,36 +0,0 @@
1typedef struct user_fpregs {
2 struct fp_reg {
3 unsigned sign1:1;
4 unsigned unused:15;
5 unsigned sign2:1;
6 unsigned exponent:14;
7 unsigned j:1;
8 unsigned mantissa1:31;
9 unsigned mantissa0:32;
10 } fpregs[8];
11 unsigned fpsr:32;
12 unsigned fpcr:32;
13 unsigned char ftype[8];
14 unsigned int init_flag;
15} elf_fpregset_t;
16
17struct user_regs {
18 unsigned long uregs[18];
19};
20#define ELF_NGREG 18
21typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
22
23struct user {
24 struct user_regs regs;
25 int u_fpvalid;
26 unsigned long u_tsize, u_dsize, u_ssize;
27 unsigned long start_code, start_stack;
28 long signal;
29 int reserved;
30 struct user_regs *u_ar0;
31 unsigned long magic;
32 char u_comm[32];
33 int u_debugreg[8];
34 struct user_fpregs u_fp;
35 struct user_fpregs *u_fp0;
36};
\ No newline at end of file
lib/libc/include/generic-musl/diagnostics.h deleted-107
...@@ -1,107 +0,0 @@
1/* Copyright (C) 2017-2019 Free Software Foundation, Inc.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or
6 (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16#ifndef DIAGNOSTICS_H
17#define DIAGNOSTICS_H
18
19/* If at all possible, fix the source rather than using these macros
20 to silence warnings. If you do use these macros be aware that
21 you'll need to condition their use on particular compiler versions,
22 which can be done for gcc using ansidecl.h's GCC_VERSION macro.
23
24 gcc versions between 4.2 and 4.6 do not allow pragma control of
25 diagnostics inside functions, giving a hard error if you try to use
26 the finer control available with later versions.
27 gcc prior to 4.2 warns about diagnostic push and pop.
28
29 The other macros have restrictions too, for example gcc-5, gcc-6
30 and gcc-7 warn that -Wstringop-truncation is unknown, unless you
31 also add DIAGNOSTIC_IGNORE ("-Wpragma"). */
32
33#ifdef __GNUC__
34# define DIAGNOSTIC_PUSH _Pragma ("GCC diagnostic push")
35# define DIAGNOSTIC_POP _Pragma ("GCC diagnostic pop")
36
37/* Stringification. */
38# define DIAGNOSTIC_STRINGIFY_1(x) #x
39# define DIAGNOSTIC_STRINGIFY(x) DIAGNOSTIC_STRINGIFY_1 (x)
40
41# define DIAGNOSTIC_IGNORE(option) \
42 _Pragma (DIAGNOSTIC_STRINGIFY (GCC diagnostic ignored option))
43#else
44# define DIAGNOSTIC_PUSH
45# define DIAGNOSTIC_POP
46# define DIAGNOSTIC_IGNORE(option)
47#endif
48
49#if defined (__clang__) /* clang */
50
51# define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
52# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \
53 DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
54# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
55 DIAGNOSTIC_IGNORE ("-Wdeprecated-register")
56# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
57 DIAGNOSTIC_IGNORE ("-Wunused-function")
58# if __has_warning ("-Wenum-compare-switch")
59# define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \
60 DIAGNOSTIC_IGNORE ("-Wenum-compare-switch")
61# endif
62
63# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
64 DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
65
66#elif defined (__GNUC__) /* GCC */
67
68# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
69 DIAGNOSTIC_IGNORE ("-Wunused-function")
70
71# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
72 DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
73
74# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
75 DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
76
77#endif
78
79#ifndef DIAGNOSTIC_IGNORE_SELF_MOVE
80# define DIAGNOSTIC_IGNORE_SELF_MOVE
81#endif
82
83#ifndef DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
84# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
85#endif
86
87#ifndef DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
88# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
89#endif
90
91#ifndef DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
92# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION
93#endif
94
95#ifndef DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
96# define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
97#endif
98
99#ifndef DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
100# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
101#endif
102
103#ifndef DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
104# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
105#endif
106
107#endif /* DIAGNOSTICS_H */
\ No newline at end of file
lib/libc/include/generic-musl/dis-asm.h deleted-397
...@@ -1,397 +0,0 @@
1/* Interface between the opcode library and its callers.
2
3 Copyright (C) 1999-2019 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street - Fifth Floor,
18 Boston, MA 02110-1301, USA.
19
20 Written by Cygnus Support, 1993.
21
22 The opcode library (libopcodes.a) provides instruction decoders for
23 a large variety of instruction sets, callable with an identical
24 interface, for making instruction-processing programs more independent
25 of the instruction set being processed. */
26
27#ifndef DIS_ASM_H
28#define DIS_ASM_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include <stdio.h>
35#include <string.h>
36#include "bfd.h"
37
38 typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
39
40enum dis_insn_type
41{
42 dis_noninsn, /* Not a valid instruction. */
43 dis_nonbranch, /* Not a branch instruction. */
44 dis_branch, /* Unconditional branch. */
45 dis_condbranch, /* Conditional branch. */
46 dis_jsr, /* Jump to subroutine. */
47 dis_condjsr, /* Conditional jump to subroutine. */
48 dis_dref, /* Data reference instruction. */
49 dis_dref2 /* Two data references in instruction. */
50};
51
52/* This struct is passed into the instruction decoding routine,
53 and is passed back out into each callback. The various fields are used
54 for conveying information from your main routine into your callbacks,
55 for passing information into the instruction decoders (such as the
56 addresses of the callback functions), or for passing information
57 back from the instruction decoders to their callers.
58
59 It must be initialized before it is first passed; this can be done
60 by hand, or using one of the initialization macros below. */
61
62typedef struct disassemble_info
63{
64 fprintf_ftype fprintf_func;
65 void *stream;
66 void *application_data;
67
68 /* Target description. We could replace this with a pointer to the bfd,
69 but that would require one. There currently isn't any such requirement
70 so to avoid introducing one we record these explicitly. */
71 /* The bfd_flavour. This can be bfd_target_unknown_flavour. */
72 enum bfd_flavour flavour;
73 /* The bfd_arch value. */
74 enum bfd_architecture arch;
75 /* The bfd_mach value. */
76 unsigned long mach;
77 /* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */
78 enum bfd_endian endian;
79 /* Endianness of code, for mixed-endian situations such as ARM BE8. */
80 enum bfd_endian endian_code;
81 /* An arch/mach-specific bitmask of selected instruction subsets, mainly
82 for processors with run-time-switchable instruction sets. The default,
83 zero, means that there is no constraint. CGEN-based opcodes ports
84 may use ISA_foo masks. */
85 void *insn_sets;
86
87 /* Some targets need information about the current section to accurately
88 display insns. If this is NULL, the target disassembler function
89 will have to make its best guess. */
90 asection *section;
91
92 /* An array of pointers to symbols either at the location being disassembled
93 or at the start of the function being disassembled. The array is sorted
94 so that the first symbol is intended to be the one used. The others are
95 present for any misc. purposes. This is not set reliably, but if it is
96 not NULL, it is correct. */
97 asymbol **symbols;
98 /* Number of symbols in array. */
99 int num_symbols;
100
101 /* Symbol table provided for targets that want to look at it. This is
102 used on Arm to find mapping symbols and determine Arm/Thumb code. */
103 asymbol **symtab;
104 int symtab_pos;
105 int symtab_size;
106
107 /* For use by the disassembler.
108 The top 16 bits are reserved for public use (and are documented here).
109 The bottom 16 bits are for the internal use of the disassembler. */
110 unsigned long flags;
111 /* Set if the disassembler has determined that there are one or more
112 relocations associated with the instruction being disassembled. */
113#define INSN_HAS_RELOC (1 << 31)
114 /* Set if the user has requested the disassembly of data as well as code. */
115#define DISASSEMBLE_DATA (1 << 30)
116 /* Set if the user has specifically set the machine type encoded in the
117 mach field of this structure. */
118#define USER_SPECIFIED_MACHINE_TYPE (1 << 29)
119
120 /* Use internally by the target specific disassembly code. */
121 void *private_data;
122
123 /* Function used to get bytes to disassemble. MEMADDR is the
124 address of the stuff to be disassembled, MYADDR is the address to
125 put the bytes in, and LENGTH is the number of bytes to read.
126 INFO is a pointer to this struct.
127 Returns an errno value or 0 for success. */
128 int (*read_memory_func)
129 (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
130 struct disassemble_info *dinfo);
131
132 /* Function which should be called if we get an error that we can't
133 recover from. STATUS is the errno value from read_memory_func and
134 MEMADDR is the address that we were trying to read. INFO is a
135 pointer to this struct. */
136 void (*memory_error_func)
137 (int status, bfd_vma memaddr, struct disassemble_info *dinfo);
138
139 /* Function called to print ADDR. */
140 void (*print_address_func)
141 (bfd_vma addr, struct disassemble_info *dinfo);
142
143 /* Function called to determine if there is a symbol at the given ADDR.
144 If there is, the function returns 1, otherwise it returns 0.
145 This is used by ports which support an overlay manager where
146 the overlay number is held in the top part of an address. In
147 some circumstances we want to include the overlay number in the
148 address, (normally because there is a symbol associated with
149 that address), but sometimes we want to mask out the overlay bits. */
150 int (* symbol_at_address_func)
151 (bfd_vma addr, struct disassemble_info *dinfo);
152
153 /* Function called to check if a SYMBOL is can be displayed to the user.
154 This is used by some ports that want to hide special symbols when
155 displaying debugging outout. */
156 bfd_boolean (* symbol_is_valid)
157 (asymbol *, struct disassemble_info *dinfo);
158
159 /* These are for buffer_read_memory. */
160 bfd_byte *buffer;
161 bfd_vma buffer_vma;
162 size_t buffer_length;
163
164 /* This variable may be set by the instruction decoder. It suggests
165 the number of bytes objdump should display on a single line. If
166 the instruction decoder sets this, it should always set it to
167 the same value in order to get reasonable looking output. */
168 int bytes_per_line;
169
170 /* The next two variables control the way objdump displays the raw data. */
171 /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
172 /* output will look like this:
173 00: 00000000 00000000
174 with the chunks displayed according to "display_endian". */
175 int bytes_per_chunk;
176 enum bfd_endian display_endian;
177
178 /* Number of octets per incremented target address
179 Normally one, but some DSPs have byte sizes of 16 or 32 bits. */
180 unsigned int octets_per_byte;
181
182 /* The number of zeroes we want to see at the end of a section before we
183 start skipping them. */
184 unsigned int skip_zeroes;
185
186 /* The number of zeroes to skip at the end of a section. If the number
187 of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,
188 they will be disassembled. If there are fewer than
189 SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic
190 attempt to avoid disassembling zeroes inserted by section
191 alignment. */
192 unsigned int skip_zeroes_at_end;
193
194 /* Whether the disassembler always needs the relocations. */
195 bfd_boolean disassembler_needs_relocs;
196
197 /* Results from instruction decoders. Not all decoders yet support
198 this information. This info is set each time an instruction is
199 decoded, and is only valid for the last such instruction.
200
201 To determine whether this decoder supports this information, set
202 insn_info_valid to 0, decode an instruction, then check it. */
203
204 char insn_info_valid; /* Branch info has been set. */
205 char branch_delay_insns; /* How many sequential insn's will run before
206 a branch takes effect. (0 = normal) */
207 char data_size; /* Size of data reference in insn, in bytes */
208 enum dis_insn_type insn_type; /* Type of instruction */
209 bfd_vma target; /* Target address of branch or dref, if known;
210 zero if unknown. */
211 bfd_vma target2; /* Second target address for dref2 */
212
213 /* Command line options specific to the target disassembler. */
214 const char *disassembler_options;
215
216 /* If non-zero then try not disassemble beyond this address, even if
217 there are values left in the buffer. This address is the address
218 of the nearest symbol forwards from the start of the disassembly,
219 and it is assumed that it lies on the boundary between instructions.
220 If an instruction spans this address then this is an error in the
221 file being disassembled. */
222 bfd_vma stop_vma;
223
224} disassemble_info;
225
226/* This struct is used to pass information about valid disassembler
227 option arguments from the target to the generic GDB functions
228 that set and display them. */
229
230typedef struct
231{
232 /* Option argument name to use in descriptions. */
233 const char *name;
234
235 /* Vector of acceptable option argument values, NULL-terminated. */
236 const char **values;
237} disasm_option_arg_t;
238
239/* This struct is used to pass information about valid disassembler
240 options, their descriptions and arguments from the target to the
241 generic GDB functions that set and display them. Options are
242 defined by tuples of vector entries at each index. */
243
244typedef struct
245{
246 /* Vector of option names, NULL-terminated. */
247 const char **name;
248
249 /* Vector of option descriptions or NULL if none to be shown. */
250 const char **description;
251
252 /* Vector of option argument information pointers or NULL if no
253 option accepts an argument. NULL entries denote individual
254 options that accept no argument. */
255 const disasm_option_arg_t **arg;
256} disasm_options_t;
257
258/* This struct is used to pass information about valid disassembler
259 options and arguments from the target to the generic GDB functions
260 that set and display them. */
261
262typedef struct
263{
264 /* Valid disassembler options. Individual options that support
265 an argument will refer to entries in the ARGS vector. */
266 disasm_options_t options;
267
268 /* Vector of acceptable option arguments, NULL-terminated. This
269 collects all possible option argument choices, some of which
270 may be shared by different options from the OPTIONS member. */
271 disasm_option_arg_t *args;
272} disasm_options_and_args_t;
273
274/* Standard disassemblers. Disassemble one instruction at the given
275 target address. Return number of octets processed. */
276typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
277
278/* Disassemblers used out side of opcodes library. */
279extern int print_insn_m32c (bfd_vma, disassemble_info *);
280extern int print_insn_mep (bfd_vma, disassemble_info *);
281extern int print_insn_s12z (bfd_vma, disassemble_info *);
282extern int print_insn_sh (bfd_vma, disassemble_info *);
283extern int print_insn_sparc (bfd_vma, disassemble_info *);
284extern int print_insn_rx (bfd_vma, disassemble_info *);
285extern int print_insn_rl78 (bfd_vma, disassemble_info *);
286extern int print_insn_rl78_g10 (bfd_vma, disassemble_info *);
287extern int print_insn_rl78_g13 (bfd_vma, disassemble_info *);
288extern int print_insn_rl78_g14 (bfd_vma, disassemble_info *);
289
290extern disassembler_ftype arc_get_disassembler (bfd *);
291extern disassembler_ftype cris_get_disassembler (bfd *);
292
293extern void print_aarch64_disassembler_options (FILE *);
294extern void print_i386_disassembler_options (FILE *);
295extern void print_mips_disassembler_options (FILE *);
296extern void print_nfp_disassembler_options (FILE *);
297extern void print_ppc_disassembler_options (FILE *);
298extern void print_riscv_disassembler_options (FILE *);
299extern void print_arm_disassembler_options (FILE *);
300extern void print_arc_disassembler_options (FILE *);
301extern void print_s390_disassembler_options (FILE *);
302extern void print_wasm32_disassembler_options (FILE *);
303extern bfd_boolean aarch64_symbol_is_valid (asymbol *, struct disassemble_info *);
304extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
305extern bfd_boolean csky_symbol_is_valid (asymbol *, struct disassemble_info *);
306extern bfd_boolean riscv_symbol_is_valid (asymbol *, struct disassemble_info *);
307extern void disassemble_init_powerpc (struct disassemble_info *);
308extern void disassemble_init_s390 (struct disassemble_info *);
309extern void disassemble_init_wasm32 (struct disassemble_info *);
310extern void disassemble_init_nds32 (struct disassemble_info *);
311extern const disasm_options_and_args_t *disassembler_options_arm (void);
312extern const disasm_options_and_args_t *disassembler_options_mips (void);
313extern const disasm_options_and_args_t *disassembler_options_powerpc (void);
314extern const disasm_options_and_args_t *disassembler_options_s390 (void);
315
316/* Fetch the disassembler for a given architecture ARC, endianess (big
317 endian if BIG is true), bfd_mach value MACH, and ABFD, if that support
318 is available. ABFD may be NULL. */
319extern disassembler_ftype disassembler (enum bfd_architecture arc,
320 bfd_boolean big, unsigned long mach,
321 bfd *abfd);
322
323/* Amend the disassemble_info structure as necessary for the target architecture.
324 Should only be called after initialising the info->arch field. */
325extern void disassemble_init_for_target (struct disassemble_info * dinfo);
326
327/* Document any target specific options available from the disassembler. */
328extern void disassembler_usage (FILE *);
329
330/* Remove whitespace and consecutive commas. */
331extern char *remove_whitespace_and_extra_commas (char *);
332
333/* Like STRCMP, but treat ',' the same as '\0' so that we match
334 strings like "foobar" against "foobar,xxyyzz,...". */
335extern int disassembler_options_cmp (const char *, const char *);
336
337/* A helper function for FOR_EACH_DISASSEMBLER_OPTION. */
338static inline const char *
339next_disassembler_option (const char *options)
340{
341 const char *opt = strchr (options, ',');
342 if (opt != NULL)
343 opt++;
344 return opt;
345}
346
347/* A macro for iterating over each comma separated option in OPTIONS. */
348#define FOR_EACH_DISASSEMBLER_OPTION(OPT, OPTIONS) \
349 for ((OPT) = (OPTIONS); \
350 (OPT) != NULL; \
351 (OPT) = next_disassembler_option (OPT))
352
353
354/* This block of definitions is for particular callers who read instructions
355 into a buffer before calling the instruction decoder. */
356
357/* Here is a function which callers may wish to use for read_memory_func.
358 It gets bytes from a buffer. */
359extern int buffer_read_memory
360 (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
361
362/* This function goes with buffer_read_memory.
363 It prints a message using info->fprintf_func and info->stream. */
364extern void perror_memory (int, bfd_vma, struct disassemble_info *);
365
366
367/* Just print the address in hex. This is included for completeness even
368 though both GDB and objdump provide their own (to print symbolic
369 addresses). */
370extern void generic_print_address
371 (bfd_vma, struct disassemble_info *);
372
373/* Always true. */
374extern int generic_symbol_at_address
375 (bfd_vma, struct disassemble_info *);
376
377/* Also always true. */
378extern bfd_boolean generic_symbol_is_valid
379 (asymbol *, struct disassemble_info *);
380
381/* Method to initialize a disassemble_info struct. This should be
382 called by all applications creating such a struct. */
383extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
384 fprintf_ftype fprintf_func);
385
386/* For compatibility with existing code. */
387#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
388 init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
389#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
390 init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
391
392
393#ifdef __cplusplus
394}
395#endif
396
397#endif /* ! defined (DIS_ASM_H) */
\ No newline at end of file
lib/libc/include/generic-musl/drm/amdgpu_drm.h deleted-994
...@@ -1,994 +0,0 @@
1/* amdgpu_drm.h -- Public header for the amdgpu driver -*- linux-c -*-
2 *
3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
5 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Copyright 2014 Advanced Micro Devices, Inc.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
25 *
26 * Authors:
27 * Kevin E. Martin <martin@valinux.com>
28 * Gareth Hughes <gareth@valinux.com>
29 * Keith Whitwell <keith@tungstengraphics.com>
30 */
31
32#ifndef __AMDGPU_DRM_H__
33#define __AMDGPU_DRM_H__
34
35#include "drm.h"
36
37#if defined(__cplusplus)
38extern "C" {
39#endif
40
41#define DRM_AMDGPU_GEM_CREATE 0x00
42#define DRM_AMDGPU_GEM_MMAP 0x01
43#define DRM_AMDGPU_CTX 0x02
44#define DRM_AMDGPU_BO_LIST 0x03
45#define DRM_AMDGPU_CS 0x04
46#define DRM_AMDGPU_INFO 0x05
47#define DRM_AMDGPU_GEM_METADATA 0x06
48#define DRM_AMDGPU_GEM_WAIT_IDLE 0x07
49#define DRM_AMDGPU_GEM_VA 0x08
50#define DRM_AMDGPU_WAIT_CS 0x09
51#define DRM_AMDGPU_GEM_OP 0x10
52#define DRM_AMDGPU_GEM_USERPTR 0x11
53#define DRM_AMDGPU_WAIT_FENCES 0x12
54#define DRM_AMDGPU_VM 0x13
55#define DRM_AMDGPU_FENCE_TO_HANDLE 0x14
56#define DRM_AMDGPU_SCHED 0x15
57
58#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
59#define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
60#define DRM_IOCTL_AMDGPU_CTX DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_CTX, union drm_amdgpu_ctx)
61#define DRM_IOCTL_AMDGPU_BO_LIST DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_BO_LIST, union drm_amdgpu_bo_list)
62#define DRM_IOCTL_AMDGPU_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_CS, union drm_amdgpu_cs)
63#define DRM_IOCTL_AMDGPU_INFO DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_INFO, struct drm_amdgpu_info)
64#define DRM_IOCTL_AMDGPU_GEM_METADATA DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_METADATA, struct drm_amdgpu_gem_metadata)
65#define DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_WAIT_IDLE, union drm_amdgpu_gem_wait_idle)
66#define DRM_IOCTL_AMDGPU_GEM_VA DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_VA, struct drm_amdgpu_gem_va)
67#define DRM_IOCTL_AMDGPU_WAIT_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_CS, union drm_amdgpu_wait_cs)
68#define DRM_IOCTL_AMDGPU_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct drm_amdgpu_gem_op)
69#define DRM_IOCTL_AMDGPU_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR, struct drm_amdgpu_gem_userptr)
70#define DRM_IOCTL_AMDGPU_WAIT_FENCES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES, union drm_amdgpu_wait_fences)
71#define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
72#define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle)
73#define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched)
74
75/**
76 * DOC: memory domains
77 *
78 * %AMDGPU_GEM_DOMAIN_CPU System memory that is not GPU accessible.
79 * Memory in this pool could be swapped out to disk if there is pressure.
80 *
81 * %AMDGPU_GEM_DOMAIN_GTT GPU accessible system memory, mapped into the
82 * GPU's virtual address space via gart. Gart memory linearizes non-contiguous
83 * pages of system memory, allows GPU access system memory in a linezrized
84 * fashion.
85 *
86 * %AMDGPU_GEM_DOMAIN_VRAM Local video memory. For APUs, it is memory
87 * carved out by the BIOS.
88 *
89 * %AMDGPU_GEM_DOMAIN_GDS Global on-chip data storage used to share data
90 * across shader threads.
91 *
92 * %AMDGPU_GEM_DOMAIN_GWS Global wave sync, used to synchronize the
93 * execution of all the waves on a device.
94 *
95 * %AMDGPU_GEM_DOMAIN_OA Ordered append, used by 3D or Compute engines
96 * for appending data.
97 */
98#define AMDGPU_GEM_DOMAIN_CPU 0x1
99#define AMDGPU_GEM_DOMAIN_GTT 0x2
100#define AMDGPU_GEM_DOMAIN_VRAM 0x4
101#define AMDGPU_GEM_DOMAIN_GDS 0x8
102#define AMDGPU_GEM_DOMAIN_GWS 0x10
103#define AMDGPU_GEM_DOMAIN_OA 0x20
104#define AMDGPU_GEM_DOMAIN_MASK (AMDGPU_GEM_DOMAIN_CPU | \
105 AMDGPU_GEM_DOMAIN_GTT | \
106 AMDGPU_GEM_DOMAIN_VRAM | \
107 AMDGPU_GEM_DOMAIN_GDS | \
108 AMDGPU_GEM_DOMAIN_GWS | \
109 AMDGPU_GEM_DOMAIN_OA)
110
111/* Flag that CPU access will be required for the case of VRAM domain */
112#define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0)
113/* Flag that CPU access will not work, this VRAM domain is invisible */
114#define AMDGPU_GEM_CREATE_NO_CPU_ACCESS (1 << 1)
115/* Flag that USWC attributes should be used for GTT */
116#define AMDGPU_GEM_CREATE_CPU_GTT_USWC (1 << 2)
117/* Flag that the memory should be in VRAM and cleared */
118#define AMDGPU_GEM_CREATE_VRAM_CLEARED (1 << 3)
119/* Flag that create shadow bo(GTT) while allocating vram bo */
120#define AMDGPU_GEM_CREATE_SHADOW (1 << 4)
121/* Flag that allocating the BO should use linear VRAM */
122#define AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS (1 << 5)
123/* Flag that BO is always valid in this VM */
124#define AMDGPU_GEM_CREATE_VM_ALWAYS_VALID (1 << 6)
125/* Flag that BO sharing will be explicitly synchronized */
126#define AMDGPU_GEM_CREATE_EXPLICIT_SYNC (1 << 7)
127/* Flag that indicates allocating MQD gart on GFX9, where the mtype
128 * for the second page onward should be set to NC.
129 */
130#define AMDGPU_GEM_CREATE_MQD_GFX9 (1 << 8)
131
132struct drm_amdgpu_gem_create_in {
133 /** the requested memory size */
134 __u64 bo_size;
135 /** physical start_addr alignment in bytes for some HW requirements */
136 __u64 alignment;
137 /** the requested memory domains */
138 __u64 domains;
139 /** allocation flags */
140 __u64 domain_flags;
141};
142
143struct drm_amdgpu_gem_create_out {
144 /** returned GEM object handle */
145 __u32 handle;
146 __u32 _pad;
147};
148
149union drm_amdgpu_gem_create {
150 struct drm_amdgpu_gem_create_in in;
151 struct drm_amdgpu_gem_create_out out;
152};
153
154/** Opcode to create new residency list. */
155#define AMDGPU_BO_LIST_OP_CREATE 0
156/** Opcode to destroy previously created residency list */
157#define AMDGPU_BO_LIST_OP_DESTROY 1
158/** Opcode to update resource information in the list */
159#define AMDGPU_BO_LIST_OP_UPDATE 2
160
161struct drm_amdgpu_bo_list_in {
162 /** Type of operation */
163 __u32 operation;
164 /** Handle of list or 0 if we want to create one */
165 __u32 list_handle;
166 /** Number of BOs in list */
167 __u32 bo_number;
168 /** Size of each element describing BO */
169 __u32 bo_info_size;
170 /** Pointer to array describing BOs */
171 __u64 bo_info_ptr;
172};
173
174struct drm_amdgpu_bo_list_entry {
175 /** Handle of BO */
176 __u32 bo_handle;
177 /** New (if specified) BO priority to be used during migration */
178 __u32 bo_priority;
179};
180
181struct drm_amdgpu_bo_list_out {
182 /** Handle of resource list */
183 __u32 list_handle;
184 __u32 _pad;
185};
186
187union drm_amdgpu_bo_list {
188 struct drm_amdgpu_bo_list_in in;
189 struct drm_amdgpu_bo_list_out out;
190};
191
192/* context related */
193#define AMDGPU_CTX_OP_ALLOC_CTX 1
194#define AMDGPU_CTX_OP_FREE_CTX 2
195#define AMDGPU_CTX_OP_QUERY_STATE 3
196#define AMDGPU_CTX_OP_QUERY_STATE2 4
197
198/* GPU reset status */
199#define AMDGPU_CTX_NO_RESET 0
200/* this the context caused it */
201#define AMDGPU_CTX_GUILTY_RESET 1
202/* some other context caused it */
203#define AMDGPU_CTX_INNOCENT_RESET 2
204/* unknown cause */
205#define AMDGPU_CTX_UNKNOWN_RESET 3
206
207/* indicate gpu reset occured after ctx created */
208#define AMDGPU_CTX_QUERY2_FLAGS_RESET (1<<0)
209/* indicate vram lost occured after ctx created */
210#define AMDGPU_CTX_QUERY2_FLAGS_VRAMLOST (1<<1)
211/* indicate some job from this context once cause gpu hang */
212#define AMDGPU_CTX_QUERY2_FLAGS_GUILTY (1<<2)
213
214/* Context priority level */
215#define AMDGPU_CTX_PRIORITY_UNSET -2048
216#define AMDGPU_CTX_PRIORITY_VERY_LOW -1023
217#define AMDGPU_CTX_PRIORITY_LOW -512
218#define AMDGPU_CTX_PRIORITY_NORMAL 0
219/* Selecting a priority above NORMAL requires CAP_SYS_NICE or DRM_MASTER */
220#define AMDGPU_CTX_PRIORITY_HIGH 512
221#define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023
222
223struct drm_amdgpu_ctx_in {
224 /** AMDGPU_CTX_OP_* */
225 __u32 op;
226 /** For future use, no flags defined so far */
227 __u32 flags;
228 __u32 ctx_id;
229 __s32 priority;
230};
231
232union drm_amdgpu_ctx_out {
233 struct {
234 __u32 ctx_id;
235 __u32 _pad;
236 } alloc;
237
238 struct {
239 /** For future use, no flags defined so far */
240 __u64 flags;
241 /** Number of resets caused by this context so far. */
242 __u32 hangs;
243 /** Reset status since the last call of the ioctl. */
244 __u32 reset_status;
245 } state;
246};
247
248union drm_amdgpu_ctx {
249 struct drm_amdgpu_ctx_in in;
250 union drm_amdgpu_ctx_out out;
251};
252
253/* vm ioctl */
254#define AMDGPU_VM_OP_RESERVE_VMID 1
255#define AMDGPU_VM_OP_UNRESERVE_VMID 2
256
257struct drm_amdgpu_vm_in {
258 /** AMDGPU_VM_OP_* */
259 __u32 op;
260 __u32 flags;
261};
262
263struct drm_amdgpu_vm_out {
264 /** For future use, no flags defined so far */
265 __u64 flags;
266};
267
268union drm_amdgpu_vm {
269 struct drm_amdgpu_vm_in in;
270 struct drm_amdgpu_vm_out out;
271};
272
273/* sched ioctl */
274#define AMDGPU_SCHED_OP_PROCESS_PRIORITY_OVERRIDE 1
275
276struct drm_amdgpu_sched_in {
277 /* AMDGPU_SCHED_OP_* */
278 __u32 op;
279 __u32 fd;
280 __s32 priority;
281 __u32 flags;
282};
283
284union drm_amdgpu_sched {
285 struct drm_amdgpu_sched_in in;
286};
287
288/*
289 * This is not a reliable API and you should expect it to fail for any
290 * number of reasons and have fallback path that do not use userptr to
291 * perform any operation.
292 */
293#define AMDGPU_GEM_USERPTR_READONLY (1 << 0)
294#define AMDGPU_GEM_USERPTR_ANONONLY (1 << 1)
295#define AMDGPU_GEM_USERPTR_VALIDATE (1 << 2)
296#define AMDGPU_GEM_USERPTR_REGISTER (1 << 3)
297
298struct drm_amdgpu_gem_userptr {
299 __u64 addr;
300 __u64 size;
301 /* AMDGPU_GEM_USERPTR_* */
302 __u32 flags;
303 /* Resulting GEM handle */
304 __u32 handle;
305};
306
307/* SI-CI-VI: */
308/* same meaning as the GB_TILE_MODE and GL_MACRO_TILE_MODE fields */
309#define AMDGPU_TILING_ARRAY_MODE_SHIFT 0
310#define AMDGPU_TILING_ARRAY_MODE_MASK 0xf
311#define AMDGPU_TILING_PIPE_CONFIG_SHIFT 4
312#define AMDGPU_TILING_PIPE_CONFIG_MASK 0x1f
313#define AMDGPU_TILING_TILE_SPLIT_SHIFT 9
314#define AMDGPU_TILING_TILE_SPLIT_MASK 0x7
315#define AMDGPU_TILING_MICRO_TILE_MODE_SHIFT 12
316#define AMDGPU_TILING_MICRO_TILE_MODE_MASK 0x7
317#define AMDGPU_TILING_BANK_WIDTH_SHIFT 15
318#define AMDGPU_TILING_BANK_WIDTH_MASK 0x3
319#define AMDGPU_TILING_BANK_HEIGHT_SHIFT 17
320#define AMDGPU_TILING_BANK_HEIGHT_MASK 0x3
321#define AMDGPU_TILING_MACRO_TILE_ASPECT_SHIFT 19
322#define AMDGPU_TILING_MACRO_TILE_ASPECT_MASK 0x3
323#define AMDGPU_TILING_NUM_BANKS_SHIFT 21
324#define AMDGPU_TILING_NUM_BANKS_MASK 0x3
325
326/* GFX9 and later: */
327#define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0
328#define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f
329
330/* Set/Get helpers for tiling flags. */
331#define AMDGPU_TILING_SET(field, value) \
332 (((__u64)(value) & AMDGPU_TILING_##field##_MASK) << AMDGPU_TILING_##field##_SHIFT)
333#define AMDGPU_TILING_GET(value, field) \
334 (((__u64)(value) >> AMDGPU_TILING_##field##_SHIFT) & AMDGPU_TILING_##field##_MASK)
335
336#define AMDGPU_GEM_METADATA_OP_SET_METADATA 1
337#define AMDGPU_GEM_METADATA_OP_GET_METADATA 2
338
339/** The same structure is shared for input/output */
340struct drm_amdgpu_gem_metadata {
341 /** GEM Object handle */
342 __u32 handle;
343 /** Do we want get or set metadata */
344 __u32 op;
345 struct {
346 /** For future use, no flags defined so far */
347 __u64 flags;
348 /** family specific tiling info */
349 __u64 tiling_info;
350 __u32 data_size_bytes;
351 __u32 data[64];
352 } data;
353};
354
355struct drm_amdgpu_gem_mmap_in {
356 /** the GEM object handle */
357 __u32 handle;
358 __u32 _pad;
359};
360
361struct drm_amdgpu_gem_mmap_out {
362 /** mmap offset from the vma offset manager */
363 __u64 addr_ptr;
364};
365
366union drm_amdgpu_gem_mmap {
367 struct drm_amdgpu_gem_mmap_in in;
368 struct drm_amdgpu_gem_mmap_out out;
369};
370
371struct drm_amdgpu_gem_wait_idle_in {
372 /** GEM object handle */
373 __u32 handle;
374 /** For future use, no flags defined so far */
375 __u32 flags;
376 /** Absolute timeout to wait */
377 __u64 timeout;
378};
379
380struct drm_amdgpu_gem_wait_idle_out {
381 /** BO status: 0 - BO is idle, 1 - BO is busy */
382 __u32 status;
383 /** Returned current memory domain */
384 __u32 domain;
385};
386
387union drm_amdgpu_gem_wait_idle {
388 struct drm_amdgpu_gem_wait_idle_in in;
389 struct drm_amdgpu_gem_wait_idle_out out;
390};
391
392struct drm_amdgpu_wait_cs_in {
393 /* Command submission handle
394 * handle equals 0 means none to wait for
395 * handle equals ~0ull means wait for the latest sequence number
396 */
397 __u64 handle;
398 /** Absolute timeout to wait */
399 __u64 timeout;
400 __u32 ip_type;
401 __u32 ip_instance;
402 __u32 ring;
403 __u32 ctx_id;
404};
405
406struct drm_amdgpu_wait_cs_out {
407 /** CS status: 0 - CS completed, 1 - CS still busy */
408 __u64 status;
409};
410
411union drm_amdgpu_wait_cs {
412 struct drm_amdgpu_wait_cs_in in;
413 struct drm_amdgpu_wait_cs_out out;
414};
415
416struct drm_amdgpu_fence {
417 __u32 ctx_id;
418 __u32 ip_type;
419 __u32 ip_instance;
420 __u32 ring;
421 __u64 seq_no;
422};
423
424struct drm_amdgpu_wait_fences_in {
425 /** This points to uint64_t * which points to fences */
426 __u64 fences;
427 __u32 fence_count;
428 __u32 wait_all;
429 __u64 timeout_ns;
430};
431
432struct drm_amdgpu_wait_fences_out {
433 __u32 status;
434 __u32 first_signaled;
435};
436
437union drm_amdgpu_wait_fences {
438 struct drm_amdgpu_wait_fences_in in;
439 struct drm_amdgpu_wait_fences_out out;
440};
441
442#define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0
443#define AMDGPU_GEM_OP_SET_PLACEMENT 1
444
445/* Sets or returns a value associated with a buffer. */
446struct drm_amdgpu_gem_op {
447 /** GEM object handle */
448 __u32 handle;
449 /** AMDGPU_GEM_OP_* */
450 __u32 op;
451 /** Input or return value */
452 __u64 value;
453};
454
455#define AMDGPU_VA_OP_MAP 1
456#define AMDGPU_VA_OP_UNMAP 2
457#define AMDGPU_VA_OP_CLEAR 3
458#define AMDGPU_VA_OP_REPLACE 4
459
460/* Delay the page table update till the next CS */
461#define AMDGPU_VM_DELAY_UPDATE (1 << 0)
462
463/* Mapping flags */
464/* readable mapping */
465#define AMDGPU_VM_PAGE_READABLE (1 << 1)
466/* writable mapping */
467#define AMDGPU_VM_PAGE_WRITEABLE (1 << 2)
468/* executable mapping, new for VI */
469#define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3)
470/* partially resident texture */
471#define AMDGPU_VM_PAGE_PRT (1 << 4)
472/* MTYPE flags use bit 5 to 8 */
473#define AMDGPU_VM_MTYPE_MASK (0xf << 5)
474/* Default MTYPE. Pre-AI must use this. Recommended for newer ASICs. */
475#define AMDGPU_VM_MTYPE_DEFAULT (0 << 5)
476/* Use NC MTYPE instead of default MTYPE */
477#define AMDGPU_VM_MTYPE_NC (1 << 5)
478/* Use WC MTYPE instead of default MTYPE */
479#define AMDGPU_VM_MTYPE_WC (2 << 5)
480/* Use CC MTYPE instead of default MTYPE */
481#define AMDGPU_VM_MTYPE_CC (3 << 5)
482/* Use UC MTYPE instead of default MTYPE */
483#define AMDGPU_VM_MTYPE_UC (4 << 5)
484
485struct drm_amdgpu_gem_va {
486 /** GEM object handle */
487 __u32 handle;
488 __u32 _pad;
489 /** AMDGPU_VA_OP_* */
490 __u32 operation;
491 /** AMDGPU_VM_PAGE_* */
492 __u32 flags;
493 /** va address to assign . Must be correctly aligned.*/
494 __u64 va_address;
495 /** Specify offset inside of BO to assign. Must be correctly aligned.*/
496 __u64 offset_in_bo;
497 /** Specify mapping size. Must be correctly aligned. */
498 __u64 map_size;
499};
500
501#define AMDGPU_HW_IP_GFX 0
502#define AMDGPU_HW_IP_COMPUTE 1
503#define AMDGPU_HW_IP_DMA 2
504#define AMDGPU_HW_IP_UVD 3
505#define AMDGPU_HW_IP_VCE 4
506#define AMDGPU_HW_IP_UVD_ENC 5
507#define AMDGPU_HW_IP_VCN_DEC 6
508#define AMDGPU_HW_IP_VCN_ENC 7
509#define AMDGPU_HW_IP_VCN_JPEG 8
510#define AMDGPU_HW_IP_NUM 9
511
512#define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1
513
514#define AMDGPU_CHUNK_ID_IB 0x01
515#define AMDGPU_CHUNK_ID_FENCE 0x02
516#define AMDGPU_CHUNK_ID_DEPENDENCIES 0x03
517#define AMDGPU_CHUNK_ID_SYNCOBJ_IN 0x04
518#define AMDGPU_CHUNK_ID_SYNCOBJ_OUT 0x05
519#define AMDGPU_CHUNK_ID_BO_HANDLES 0x06
520
521struct drm_amdgpu_cs_chunk {
522 __u32 chunk_id;
523 __u32 length_dw;
524 __u64 chunk_data;
525};
526
527struct drm_amdgpu_cs_in {
528 /** Rendering context id */
529 __u32 ctx_id;
530 /** Handle of resource list associated with CS */
531 __u32 bo_list_handle;
532 __u32 num_chunks;
533 __u32 _pad;
534 /** this points to __u64 * which point to cs chunks */
535 __u64 chunks;
536};
537
538struct drm_amdgpu_cs_out {
539 __u64 handle;
540};
541
542union drm_amdgpu_cs {
543 struct drm_amdgpu_cs_in in;
544 struct drm_amdgpu_cs_out out;
545};
546
547/* Specify flags to be used for IB */
548
549/* This IB should be submitted to CE */
550#define AMDGPU_IB_FLAG_CE (1<<0)
551
552/* Preamble flag, which means the IB could be dropped if no context switch */
553#define AMDGPU_IB_FLAG_PREAMBLE (1<<1)
554
555/* Preempt flag, IB should set Pre_enb bit if PREEMPT flag detected */
556#define AMDGPU_IB_FLAG_PREEMPT (1<<2)
557
558/* The IB fence should do the L2 writeback but not invalidate any shader
559 * caches (L2/vL1/sL1/I$). */
560#define AMDGPU_IB_FLAG_TC_WB_NOT_INVALIDATE (1 << 3)
561
562struct drm_amdgpu_cs_chunk_ib {
563 __u32 _pad;
564 /** AMDGPU_IB_FLAG_* */
565 __u32 flags;
566 /** Virtual address to begin IB execution */
567 __u64 va_start;
568 /** Size of submission */
569 __u32 ib_bytes;
570 /** HW IP to submit to */
571 __u32 ip_type;
572 /** HW IP index of the same type to submit to */
573 __u32 ip_instance;
574 /** Ring index to submit to */
575 __u32 ring;
576};
577
578struct drm_amdgpu_cs_chunk_dep {
579 __u32 ip_type;
580 __u32 ip_instance;
581 __u32 ring;
582 __u32 ctx_id;
583 __u64 handle;
584};
585
586struct drm_amdgpu_cs_chunk_fence {
587 __u32 handle;
588 __u32 offset;
589};
590
591struct drm_amdgpu_cs_chunk_sem {
592 __u32 handle;
593};
594
595#define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ 0
596#define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ_FD 1
597#define AMDGPU_FENCE_TO_HANDLE_GET_SYNC_FILE_FD 2
598
599union drm_amdgpu_fence_to_handle {
600 struct {
601 struct drm_amdgpu_fence fence;
602 __u32 what;
603 __u32 pad;
604 } in;
605 struct {
606 __u32 handle;
607 } out;
608};
609
610struct drm_amdgpu_cs_chunk_data {
611 union {
612 struct drm_amdgpu_cs_chunk_ib ib_data;
613 struct drm_amdgpu_cs_chunk_fence fence_data;
614 };
615};
616
617/**
618 * Query h/w info: Flag that this is integrated (a.h.a. fusion) GPU
619 *
620 */
621#define AMDGPU_IDS_FLAGS_FUSION 0x1
622#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
623
624/* indicate if acceleration can be working */
625#define AMDGPU_INFO_ACCEL_WORKING 0x00
626/* get the crtc_id from the mode object id? */
627#define AMDGPU_INFO_CRTC_FROM_ID 0x01
628/* query hw IP info */
629#define AMDGPU_INFO_HW_IP_INFO 0x02
630/* query hw IP instance count for the specified type */
631#define AMDGPU_INFO_HW_IP_COUNT 0x03
632/* timestamp for GL_ARB_timer_query */
633#define AMDGPU_INFO_TIMESTAMP 0x05
634/* Query the firmware version */
635#define AMDGPU_INFO_FW_VERSION 0x0e
636 /* Subquery id: Query VCE firmware version */
637 #define AMDGPU_INFO_FW_VCE 0x1
638 /* Subquery id: Query UVD firmware version */
639 #define AMDGPU_INFO_FW_UVD 0x2
640 /* Subquery id: Query GMC firmware version */
641 #define AMDGPU_INFO_FW_GMC 0x03
642 /* Subquery id: Query GFX ME firmware version */
643 #define AMDGPU_INFO_FW_GFX_ME 0x04
644 /* Subquery id: Query GFX PFP firmware version */
645 #define AMDGPU_INFO_FW_GFX_PFP 0x05
646 /* Subquery id: Query GFX CE firmware version */
647 #define AMDGPU_INFO_FW_GFX_CE 0x06
648 /* Subquery id: Query GFX RLC firmware version */
649 #define AMDGPU_INFO_FW_GFX_RLC 0x07
650 /* Subquery id: Query GFX MEC firmware version */
651 #define AMDGPU_INFO_FW_GFX_MEC 0x08
652 /* Subquery id: Query SMC firmware version */
653 #define AMDGPU_INFO_FW_SMC 0x0a
654 /* Subquery id: Query SDMA firmware version */
655 #define AMDGPU_INFO_FW_SDMA 0x0b
656 /* Subquery id: Query PSP SOS firmware version */
657 #define AMDGPU_INFO_FW_SOS 0x0c
658 /* Subquery id: Query PSP ASD firmware version */
659 #define AMDGPU_INFO_FW_ASD 0x0d
660 /* Subquery id: Query VCN firmware version */
661 #define AMDGPU_INFO_FW_VCN 0x0e
662 /* Subquery id: Query GFX RLC SRLC firmware version */
663 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_CNTL 0x0f
664 /* Subquery id: Query GFX RLC SRLG firmware version */
665 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10
666 /* Subquery id: Query GFX RLC SRLS firmware version */
667 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11
668/* number of bytes moved for TTM migration */
669#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
670/* the used VRAM size */
671#define AMDGPU_INFO_VRAM_USAGE 0x10
672/* the used GTT size */
673#define AMDGPU_INFO_GTT_USAGE 0x11
674/* Information about GDS, etc. resource configuration */
675#define AMDGPU_INFO_GDS_CONFIG 0x13
676/* Query information about VRAM and GTT domains */
677#define AMDGPU_INFO_VRAM_GTT 0x14
678/* Query information about register in MMR address space*/
679#define AMDGPU_INFO_READ_MMR_REG 0x15
680/* Query information about device: rev id, family, etc. */
681#define AMDGPU_INFO_DEV_INFO 0x16
682/* visible vram usage */
683#define AMDGPU_INFO_VIS_VRAM_USAGE 0x17
684/* number of TTM buffer evictions */
685#define AMDGPU_INFO_NUM_EVICTIONS 0x18
686/* Query memory about VRAM and GTT domains */
687#define AMDGPU_INFO_MEMORY 0x19
688/* Query vce clock table */
689#define AMDGPU_INFO_VCE_CLOCK_TABLE 0x1A
690/* Query vbios related information */
691#define AMDGPU_INFO_VBIOS 0x1B
692 /* Subquery id: Query vbios size */
693 #define AMDGPU_INFO_VBIOS_SIZE 0x1
694 /* Subquery id: Query vbios image */
695 #define AMDGPU_INFO_VBIOS_IMAGE 0x2
696/* Query UVD handles */
697#define AMDGPU_INFO_NUM_HANDLES 0x1C
698/* Query sensor related information */
699#define AMDGPU_INFO_SENSOR 0x1D
700 /* Subquery id: Query GPU shader clock */
701 #define AMDGPU_INFO_SENSOR_GFX_SCLK 0x1
702 /* Subquery id: Query GPU memory clock */
703 #define AMDGPU_INFO_SENSOR_GFX_MCLK 0x2
704 /* Subquery id: Query GPU temperature */
705 #define AMDGPU_INFO_SENSOR_GPU_TEMP 0x3
706 /* Subquery id: Query GPU load */
707 #define AMDGPU_INFO_SENSOR_GPU_LOAD 0x4
708 /* Subquery id: Query average GPU power */
709 #define AMDGPU_INFO_SENSOR_GPU_AVG_POWER 0x5
710 /* Subquery id: Query northbridge voltage */
711 #define AMDGPU_INFO_SENSOR_VDDNB 0x6
712 /* Subquery id: Query graphics voltage */
713 #define AMDGPU_INFO_SENSOR_VDDGFX 0x7
714 /* Subquery id: Query GPU stable pstate shader clock */
715 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
716 /* Subquery id: Query GPU stable pstate memory clock */
717 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
718/* Number of VRAM page faults on CPU access. */
719#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
720#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
721
722#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
723#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
724#define AMDGPU_INFO_MMR_SH_INDEX_SHIFT 8
725#define AMDGPU_INFO_MMR_SH_INDEX_MASK 0xff
726
727struct drm_amdgpu_query_fw {
728 /** AMDGPU_INFO_FW_* */
729 __u32 fw_type;
730 /**
731 * Index of the IP if there are more IPs of
732 * the same type.
733 */
734 __u32 ip_instance;
735 /**
736 * Index of the engine. Whether this is used depends
737 * on the firmware type. (e.g. MEC, SDMA)
738 */
739 __u32 index;
740 __u32 _pad;
741};
742
743/* Input structure for the INFO ioctl */
744struct drm_amdgpu_info {
745 /* Where the return value will be stored */
746 __u64 return_pointer;
747 /* The size of the return value. Just like "size" in "snprintf",
748 * it limits how many bytes the kernel can write. */
749 __u32 return_size;
750 /* The query request id. */
751 __u32 query;
752
753 union {
754 struct {
755 __u32 id;
756 __u32 _pad;
757 } mode_crtc;
758
759 struct {
760 /** AMDGPU_HW_IP_* */
761 __u32 type;
762 /**
763 * Index of the IP if there are more IPs of the same
764 * type. Ignored by AMDGPU_INFO_HW_IP_COUNT.
765 */
766 __u32 ip_instance;
767 } query_hw_ip;
768
769 struct {
770 __u32 dword_offset;
771 /** number of registers to read */
772 __u32 count;
773 __u32 instance;
774 /** For future use, no flags defined so far */
775 __u32 flags;
776 } read_mmr_reg;
777
778 struct drm_amdgpu_query_fw query_fw;
779
780 struct {
781 __u32 type;
782 __u32 offset;
783 } vbios_info;
784
785 struct {
786 __u32 type;
787 } sensor_info;
788 };
789};
790
791struct drm_amdgpu_info_gds {
792 /** GDS GFX partition size */
793 __u32 gds_gfx_partition_size;
794 /** GDS compute partition size */
795 __u32 compute_partition_size;
796 /** total GDS memory size */
797 __u32 gds_total_size;
798 /** GWS size per GFX partition */
799 __u32 gws_per_gfx_partition;
800 /** GSW size per compute partition */
801 __u32 gws_per_compute_partition;
802 /** OA size per GFX partition */
803 __u32 oa_per_gfx_partition;
804 /** OA size per compute partition */
805 __u32 oa_per_compute_partition;
806 __u32 _pad;
807};
808
809struct drm_amdgpu_info_vram_gtt {
810 __u64 vram_size;
811 __u64 vram_cpu_accessible_size;
812 __u64 gtt_size;
813};
814
815struct drm_amdgpu_heap_info {
816 /** max. physical memory */
817 __u64 total_heap_size;
818
819 /** Theoretical max. available memory in the given heap */
820 __u64 usable_heap_size;
821
822 /**
823 * Number of bytes allocated in the heap. This includes all processes
824 * and private allocations in the kernel. It changes when new buffers
825 * are allocated, freed, and moved. It cannot be larger than
826 * heap_size.
827 */
828 __u64 heap_usage;
829
830 /**
831 * Theoretical possible max. size of buffer which
832 * could be allocated in the given heap
833 */
834 __u64 max_allocation;
835};
836
837struct drm_amdgpu_memory_info {
838 struct drm_amdgpu_heap_info vram;
839 struct drm_amdgpu_heap_info cpu_accessible_vram;
840 struct drm_amdgpu_heap_info gtt;
841};
842
843struct drm_amdgpu_info_firmware {
844 __u32 ver;
845 __u32 feature;
846};
847
848#define AMDGPU_VRAM_TYPE_UNKNOWN 0
849#define AMDGPU_VRAM_TYPE_GDDR1 1
850#define AMDGPU_VRAM_TYPE_DDR2 2
851#define AMDGPU_VRAM_TYPE_GDDR3 3
852#define AMDGPU_VRAM_TYPE_GDDR4 4
853#define AMDGPU_VRAM_TYPE_GDDR5 5
854#define AMDGPU_VRAM_TYPE_HBM 6
855#define AMDGPU_VRAM_TYPE_DDR3 7
856#define AMDGPU_VRAM_TYPE_DDR4 8
857
858struct drm_amdgpu_info_device {
859 /** PCI Device ID */
860 __u32 device_id;
861 /** Internal chip revision: A0, A1, etc.) */
862 __u32 chip_rev;
863 __u32 external_rev;
864 /** Revision id in PCI Config space */
865 __u32 pci_rev;
866 __u32 family;
867 __u32 num_shader_engines;
868 __u32 num_shader_arrays_per_engine;
869 /* in KHz */
870 __u32 gpu_counter_freq;
871 __u64 max_engine_clock;
872 __u64 max_memory_clock;
873 /* cu information */
874 __u32 cu_active_number;
875 /* NOTE: cu_ao_mask is INVALID, DON'T use it */
876 __u32 cu_ao_mask;
877 __u32 cu_bitmap[4][4];
878 /** Render backend pipe mask. One render backend is CB+DB. */
879 __u32 enabled_rb_pipes_mask;
880 __u32 num_rb_pipes;
881 __u32 num_hw_gfx_contexts;
882 __u32 _pad;
883 __u64 ids_flags;
884 /** Starting virtual address for UMDs. */
885 __u64 virtual_address_offset;
886 /** The maximum virtual address */
887 __u64 virtual_address_max;
888 /** Required alignment of virtual addresses. */
889 __u32 virtual_address_alignment;
890 /** Page table entry - fragment size */
891 __u32 pte_fragment_size;
892 __u32 gart_page_size;
893 /** constant engine ram size*/
894 __u32 ce_ram_size;
895 /** video memory type info*/
896 __u32 vram_type;
897 /** video memory bit width*/
898 __u32 vram_bit_width;
899 /* vce harvesting instance */
900 __u32 vce_harvest_config;
901 /* gfx double offchip LDS buffers */
902 __u32 gc_double_offchip_lds_buf;
903 /* NGG Primitive Buffer */
904 __u64 prim_buf_gpu_addr;
905 /* NGG Position Buffer */
906 __u64 pos_buf_gpu_addr;
907 /* NGG Control Sideband */
908 __u64 cntl_sb_buf_gpu_addr;
909 /* NGG Parameter Cache */
910 __u64 param_buf_gpu_addr;
911 __u32 prim_buf_size;
912 __u32 pos_buf_size;
913 __u32 cntl_sb_buf_size;
914 __u32 param_buf_size;
915 /* wavefront size*/
916 __u32 wave_front_size;
917 /* shader visible vgprs*/
918 __u32 num_shader_visible_vgprs;
919 /* CU per shader array*/
920 __u32 num_cu_per_sh;
921 /* number of tcc blocks*/
922 __u32 num_tcc_blocks;
923 /* gs vgt table depth*/
924 __u32 gs_vgt_table_depth;
925 /* gs primitive buffer depth*/
926 __u32 gs_prim_buffer_depth;
927 /* max gs wavefront per vgt*/
928 __u32 max_gs_waves_per_vgt;
929 __u32 _pad1;
930 /* always on cu bitmap */
931 __u32 cu_ao_bitmap[4][4];
932 /** Starting high virtual address for UMDs. */
933 __u64 high_va_offset;
934 /** The maximum high virtual address */
935 __u64 high_va_max;
936};
937
938struct drm_amdgpu_info_hw_ip {
939 /** Version of h/w IP */
940 __u32 hw_ip_version_major;
941 __u32 hw_ip_version_minor;
942 /** Capabilities */
943 __u64 capabilities_flags;
944 /** command buffer address start alignment*/
945 __u32 ib_start_alignment;
946 /** command buffer size alignment*/
947 __u32 ib_size_alignment;
948 /** Bitmask of available rings. Bit 0 means ring 0, etc. */
949 __u32 available_rings;
950 __u32 _pad;
951};
952
953struct drm_amdgpu_info_num_handles {
954 /** Max handles as supported by firmware for UVD */
955 __u32 uvd_max_handles;
956 /** Handles currently in use for UVD */
957 __u32 uvd_used_handles;
958};
959
960#define AMDGPU_VCE_CLOCK_TABLE_ENTRIES 6
961
962struct drm_amdgpu_info_vce_clock_table_entry {
963 /** System clock */
964 __u32 sclk;
965 /** Memory clock */
966 __u32 mclk;
967 /** VCE clock */
968 __u32 eclk;
969 __u32 pad;
970};
971
972struct drm_amdgpu_info_vce_clock_table {
973 struct drm_amdgpu_info_vce_clock_table_entry entries[AMDGPU_VCE_CLOCK_TABLE_ENTRIES];
974 __u32 num_valid_entries;
975 __u32 pad;
976};
977
978/*
979 * Supported GPU families
980 */
981#define AMDGPU_FAMILY_UNKNOWN 0
982#define AMDGPU_FAMILY_SI 110 /* Hainan, Oland, Verde, Pitcairn, Tahiti */
983#define AMDGPU_FAMILY_CI 120 /* Bonaire, Hawaii */
984#define AMDGPU_FAMILY_KV 125 /* Kaveri, Kabini, Mullins */
985#define AMDGPU_FAMILY_VI 130 /* Iceland, Tonga */
986#define AMDGPU_FAMILY_CZ 135 /* Carrizo, Stoney */
987#define AMDGPU_FAMILY_AI 141 /* Vega10 */
988#define AMDGPU_FAMILY_RV 142 /* Raven */
989
990#if defined(__cplusplus)
991}
992#endif
993
994#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/armada_drm.h deleted-56
...@@ -1,56 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2012 Russell King
4 * With inspiration from the i915 driver
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef DRM_ARMADA_IOCTL_H
11#define DRM_ARMADA_IOCTL_H
12
13#include "drm.h"
14
15#if defined(__cplusplus)
16extern "C" {
17#endif
18
19#define DRM_ARMADA_GEM_CREATE 0x00
20#define DRM_ARMADA_GEM_MMAP 0x02
21#define DRM_ARMADA_GEM_PWRITE 0x03
22
23#define ARMADA_IOCTL(dir, name, str) \
24 DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
25
26struct drm_armada_gem_create {
27 __u32 handle;
28 __u32 size;
29};
30#define DRM_IOCTL_ARMADA_GEM_CREATE \
31 ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)
32
33struct drm_armada_gem_mmap {
34 __u32 handle;
35 __u32 pad;
36 __u64 offset;
37 __u64 size;
38 __u64 addr;
39};
40#define DRM_IOCTL_ARMADA_GEM_MMAP \
41 ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)
42
43struct drm_armada_gem_pwrite {
44 __u64 ptr;
45 __u32 handle;
46 __u32 offset;
47 __u32 size;
48};
49#define DRM_IOCTL_ARMADA_GEM_PWRITE \
50 ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
51
52#if defined(__cplusplus)
53}
54#endif
55
56#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/drm.h deleted-1004
...@@ -1,1004 +0,0 @@
1/**
2 * \file drm.h
3 * Header for the Direct Rendering Manager
4 *
5 * \author Rickard E. (Rik) Faith <faith@valinux.com>
6 *
7 * \par Acknowledgments:
8 * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.
9 */
10
11/*
12 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
13 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
14 * All rights reserved.
15 *
16 * Permission is hereby granted, free of charge, to any person obtaining a
17 * copy of this software and associated documentation files (the "Software"),
18 * to deal in the Software without restriction, including without limitation
19 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
20 * and/or sell copies of the Software, and to permit persons to whom the
21 * Software is furnished to do so, subject to the following conditions:
22 *
23 * The above copyright notice and this permission notice (including the next
24 * paragraph) shall be included in all copies or substantial portions of the
25 * Software.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
31 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
32 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33 * OTHER DEALINGS IN THE SOFTWARE.
34 */
35
36#ifndef _DRM_H_
37#define _DRM_H_
38
39#if defined(__linux__)
40
41#include <linux/types.h>
42#include <asm/ioctl.h>
43typedef unsigned int drm_handle_t;
44
45#else /* One of the BSDs */
46
47#include <sys/ioccom.h>
48#include <sys/types.h>
49typedef int8_t __s8;
50typedef uint8_t __u8;
51typedef int16_t __s16;
52typedef uint16_t __u16;
53typedef int32_t __s32;
54typedef uint32_t __u32;
55typedef int64_t __s64;
56typedef uint64_t __u64;
57typedef size_t __kernel_size_t;
58typedef unsigned long drm_handle_t;
59
60#endif
61
62#if defined(__cplusplus)
63extern "C" {
64#endif
65
66#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
67#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
68#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
69#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */
70
71#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */
72#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */
73#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
74#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
75#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
76
77typedef unsigned int drm_context_t;
78typedef unsigned int drm_drawable_t;
79typedef unsigned int drm_magic_t;
80
81/**
82 * Cliprect.
83 *
84 * \warning: If you change this structure, make sure you change
85 * XF86DRIClipRectRec in the server as well
86 *
87 * \note KW: Actually it's illegal to change either for
88 * backwards-compatibility reasons.
89 */
90struct drm_clip_rect {
91 unsigned short x1;
92 unsigned short y1;
93 unsigned short x2;
94 unsigned short y2;
95};
96
97/**
98 * Drawable information.
99 */
100struct drm_drawable_info {
101 unsigned int num_rects;
102 struct drm_clip_rect *rects;
103};
104
105/**
106 * Texture region,
107 */
108struct drm_tex_region {
109 unsigned char next;
110 unsigned char prev;
111 unsigned char in_use;
112 unsigned char padding;
113 unsigned int age;
114};
115
116/**
117 * Hardware lock.
118 *
119 * The lock structure is a simple cache-line aligned integer. To avoid
120 * processor bus contention on a multiprocessor system, there should not be any
121 * other data stored in the same cache line.
122 */
123struct drm_hw_lock {
124 __volatile__ unsigned int lock; /**< lock variable */
125 char padding[60]; /**< Pad to cache line */
126};
127
128/**
129 * DRM_IOCTL_VERSION ioctl argument type.
130 *
131 * \sa drmGetVersion().
132 */
133struct drm_version {
134 int version_major; /**< Major version */
135 int version_minor; /**< Minor version */
136 int version_patchlevel; /**< Patch level */
137 __kernel_size_t name_len; /**< Length of name buffer */
138 char *name; /**< Name of driver */
139 __kernel_size_t date_len; /**< Length of date buffer */
140 char *date; /**< User-space buffer to hold date */
141 __kernel_size_t desc_len; /**< Length of desc buffer */
142 char *desc; /**< User-space buffer to hold desc */
143};
144
145/**
146 * DRM_IOCTL_GET_UNIQUE ioctl argument type.
147 *
148 * \sa drmGetBusid() and drmSetBusId().
149 */
150struct drm_unique {
151 __kernel_size_t unique_len; /**< Length of unique */
152 char *unique; /**< Unique name for driver instantiation */
153};
154
155struct drm_list {
156 int count; /**< Length of user-space structures */
157 struct drm_version *version;
158};
159
160struct drm_block {
161 int unused;
162};
163
164/**
165 * DRM_IOCTL_CONTROL ioctl argument type.
166 *
167 * \sa drmCtlInstHandler() and drmCtlUninstHandler().
168 */
169struct drm_control {
170 enum {
171 DRM_ADD_COMMAND,
172 DRM_RM_COMMAND,
173 DRM_INST_HANDLER,
174 DRM_UNINST_HANDLER
175 } func;
176 int irq;
177};
178
179/**
180 * Type of memory to map.
181 */
182enum drm_map_type {
183 _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
184 _DRM_REGISTERS = 1, /**< no caching, no core dump */
185 _DRM_SHM = 2, /**< shared, cached */
186 _DRM_AGP = 3, /**< AGP/GART */
187 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
188 _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
189};
190
191/**
192 * Memory mapping flags.
193 */
194enum drm_map_flags {
195 _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
196 _DRM_READ_ONLY = 0x02,
197 _DRM_LOCKED = 0x04, /**< shared, cached, locked */
198 _DRM_KERNEL = 0x08, /**< kernel requires access */
199 _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
200 _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
201 _DRM_REMOVABLE = 0x40, /**< Removable mapping */
202 _DRM_DRIVER = 0x80 /**< Managed by driver */
203};
204
205struct drm_ctx_priv_map {
206 unsigned int ctx_id; /**< Context requesting private mapping */
207 void *handle; /**< Handle of map */
208};
209
210/**
211 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
212 * argument type.
213 *
214 * \sa drmAddMap().
215 */
216struct drm_map {
217 unsigned long offset; /**< Requested physical address (0 for SAREA)*/
218 unsigned long size; /**< Requested physical size (bytes) */
219 enum drm_map_type type; /**< Type of memory to map */
220 enum drm_map_flags flags; /**< Flags */
221 void *handle; /**< User-space: "Handle" to pass to mmap() */
222 /**< Kernel-space: kernel-virtual address */
223 int mtrr; /**< MTRR slot used */
224 /* Private data */
225};
226
227/**
228 * DRM_IOCTL_GET_CLIENT ioctl argument type.
229 */
230struct drm_client {
231 int idx; /**< Which client desired? */
232 int auth; /**< Is client authenticated? */
233 unsigned long pid; /**< Process ID */
234 unsigned long uid; /**< User ID */
235 unsigned long magic; /**< Magic */
236 unsigned long iocs; /**< Ioctl count */
237};
238
239enum drm_stat_type {
240 _DRM_STAT_LOCK,
241 _DRM_STAT_OPENS,
242 _DRM_STAT_CLOSES,
243 _DRM_STAT_IOCTLS,
244 _DRM_STAT_LOCKS,
245 _DRM_STAT_UNLOCKS,
246 _DRM_STAT_VALUE, /**< Generic value */
247 _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */
248 _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */
249
250 _DRM_STAT_IRQ, /**< IRQ */
251 _DRM_STAT_PRIMARY, /**< Primary DMA bytes */
252 _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */
253 _DRM_STAT_DMA, /**< DMA */
254 _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
255 _DRM_STAT_MISSED /**< Missed DMA opportunity */
256 /* Add to the *END* of the list */
257};
258
259/**
260 * DRM_IOCTL_GET_STATS ioctl argument type.
261 */
262struct drm_stats {
263 unsigned long count;
264 struct {
265 unsigned long value;
266 enum drm_stat_type type;
267 } data[15];
268};
269
270/**
271 * Hardware locking flags.
272 */
273enum drm_lock_flags {
274 _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
275 _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
276 _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
277 _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */
278 /* These *HALT* flags aren't supported yet
279 -- they will be used to support the
280 full-screen DGA-like mode. */
281 _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
282 _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
283};
284
285/**
286 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
287 *
288 * \sa drmGetLock() and drmUnlock().
289 */
290struct drm_lock {
291 int context;
292 enum drm_lock_flags flags;
293};
294
295/**
296 * DMA flags
297 *
298 * \warning
299 * These values \e must match xf86drm.h.
300 *
301 * \sa drm_dma.
302 */
303enum drm_dma_flags {
304 /* Flags for DMA buffer dispatch */
305 _DRM_DMA_BLOCK = 0x01, /**<
306 * Block until buffer dispatched.
307 *
308 * \note The buffer may not yet have
309 * been processed by the hardware --
310 * getting a hardware lock with the
311 * hardware quiescent will ensure
312 * that the buffer has been
313 * processed.
314 */
315 _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */
316 _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */
317
318 /* Flags for DMA buffer request */
319 _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */
320 _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
321 _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
322};
323
324/**
325 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
326 *
327 * \sa drmAddBufs().
328 */
329struct drm_buf_desc {
330 int count; /**< Number of buffers of this size */
331 int size; /**< Size in bytes */
332 int low_mark; /**< Low water mark */
333 int high_mark; /**< High water mark */
334 enum {
335 _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
336 _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
337 _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
338 _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
339 _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
340 } flags;
341 unsigned long agp_start; /**<
342 * Start address of where the AGP buffers are
343 * in the AGP aperture
344 */
345};
346
347/**
348 * DRM_IOCTL_INFO_BUFS ioctl argument type.
349 */
350struct drm_buf_info {
351 int count; /**< Entries in list */
352 struct drm_buf_desc *list;
353};
354
355/**
356 * DRM_IOCTL_FREE_BUFS ioctl argument type.
357 */
358struct drm_buf_free {
359 int count;
360 int *list;
361};
362
363/**
364 * Buffer information
365 *
366 * \sa drm_buf_map.
367 */
368struct drm_buf_pub {
369 int idx; /**< Index into the master buffer list */
370 int total; /**< Buffer size */
371 int used; /**< Amount of buffer in use (for DMA) */
372 void *address; /**< Address of buffer */
373};
374
375/**
376 * DRM_IOCTL_MAP_BUFS ioctl argument type.
377 */
378struct drm_buf_map {
379 int count; /**< Length of the buffer list */
380#ifdef __cplusplus
381 void *virt;
382#else
383 void *virtual; /**< Mmap'd area in user-virtual */
384#endif
385 struct drm_buf_pub *list; /**< Buffer information */
386};
387
388/**
389 * DRM_IOCTL_DMA ioctl argument type.
390 *
391 * Indices here refer to the offset into the buffer list in drm_buf_get.
392 *
393 * \sa drmDMA().
394 */
395struct drm_dma {
396 int context; /**< Context handle */
397 int send_count; /**< Number of buffers to send */
398 int *send_indices; /**< List of handles to buffers */
399 int *send_sizes; /**< Lengths of data to send */
400 enum drm_dma_flags flags; /**< Flags */
401 int request_count; /**< Number of buffers requested */
402 int request_size; /**< Desired size for buffers */
403 int *request_indices; /**< Buffer information */
404 int *request_sizes;
405 int granted_count; /**< Number of buffers granted */
406};
407
408enum drm_ctx_flags {
409 _DRM_CONTEXT_PRESERVED = 0x01,
410 _DRM_CONTEXT_2DONLY = 0x02
411};
412
413/**
414 * DRM_IOCTL_ADD_CTX ioctl argument type.
415 *
416 * \sa drmCreateContext() and drmDestroyContext().
417 */
418struct drm_ctx {
419 drm_context_t handle;
420 enum drm_ctx_flags flags;
421};
422
423/**
424 * DRM_IOCTL_RES_CTX ioctl argument type.
425 */
426struct drm_ctx_res {
427 int count;
428 struct drm_ctx *contexts;
429};
430
431/**
432 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
433 */
434struct drm_draw {
435 drm_drawable_t handle;
436};
437
438/**
439 * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
440 */
441typedef enum {
442 DRM_DRAWABLE_CLIPRECTS
443} drm_drawable_info_type_t;
444
445struct drm_update_draw {
446 drm_drawable_t handle;
447 unsigned int type;
448 unsigned int num;
449 unsigned long long data;
450};
451
452/**
453 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
454 */
455struct drm_auth {
456 drm_magic_t magic;
457};
458
459/**
460 * DRM_IOCTL_IRQ_BUSID ioctl argument type.
461 *
462 * \sa drmGetInterruptFromBusID().
463 */
464struct drm_irq_busid {
465 int irq; /**< IRQ number */
466 int busnum; /**< bus number */
467 int devnum; /**< device number */
468 int funcnum; /**< function number */
469};
470
471enum drm_vblank_seq_type {
472 _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
473 _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
474 /* bits 1-6 are reserved for high crtcs */
475 _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e,
476 _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */
477 _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
478 _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
479 _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
480 _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */
481};
482#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1
483
484#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
485#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
486 _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS)
487
488struct drm_wait_vblank_request {
489 enum drm_vblank_seq_type type;
490 unsigned int sequence;
491 unsigned long signal;
492};
493
494struct drm_wait_vblank_reply {
495 enum drm_vblank_seq_type type;
496 unsigned int sequence;
497 long tval_sec;
498 long tval_usec;
499};
500
501/**
502 * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
503 *
504 * \sa drmWaitVBlank().
505 */
506union drm_wait_vblank {
507 struct drm_wait_vblank_request request;
508 struct drm_wait_vblank_reply reply;
509};
510
511#define _DRM_PRE_MODESET 1
512#define _DRM_POST_MODESET 2
513
514/**
515 * DRM_IOCTL_MODESET_CTL ioctl argument type
516 *
517 * \sa drmModesetCtl().
518 */
519struct drm_modeset_ctl {
520 __u32 crtc;
521 __u32 cmd;
522};
523
524/**
525 * DRM_IOCTL_AGP_ENABLE ioctl argument type.
526 *
527 * \sa drmAgpEnable().
528 */
529struct drm_agp_mode {
530 unsigned long mode; /**< AGP mode */
531};
532
533/**
534 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
535 *
536 * \sa drmAgpAlloc() and drmAgpFree().
537 */
538struct drm_agp_buffer {
539 unsigned long size; /**< In bytes -- will round to page boundary */
540 unsigned long handle; /**< Used for binding / unbinding */
541 unsigned long type; /**< Type of memory to allocate */
542 unsigned long physical; /**< Physical used by i810 */
543};
544
545/**
546 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
547 *
548 * \sa drmAgpBind() and drmAgpUnbind().
549 */
550struct drm_agp_binding {
551 unsigned long handle; /**< From drm_agp_buffer */
552 unsigned long offset; /**< In bytes -- will round to page boundary */
553};
554
555/**
556 * DRM_IOCTL_AGP_INFO ioctl argument type.
557 *
558 * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
559 * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
560 * drmAgpVendorId() and drmAgpDeviceId().
561 */
562struct drm_agp_info {
563 int agp_version_major;
564 int agp_version_minor;
565 unsigned long mode;
566 unsigned long aperture_base; /* physical address */
567 unsigned long aperture_size; /* bytes */
568 unsigned long memory_allowed; /* bytes */
569 unsigned long memory_used;
570
571 /* PCI information */
572 unsigned short id_vendor;
573 unsigned short id_device;
574};
575
576/**
577 * DRM_IOCTL_SG_ALLOC ioctl argument type.
578 */
579struct drm_scatter_gather {
580 unsigned long size; /**< In bytes -- will round to page boundary */
581 unsigned long handle; /**< Used for mapping / unmapping */
582};
583
584/**
585 * DRM_IOCTL_SET_VERSION ioctl argument type.
586 */
587struct drm_set_version {
588 int drm_di_major;
589 int drm_di_minor;
590 int drm_dd_major;
591 int drm_dd_minor;
592};
593
594/** DRM_IOCTL_GEM_CLOSE ioctl argument type */
595struct drm_gem_close {
596 /** Handle of the object to be closed. */
597 __u32 handle;
598 __u32 pad;
599};
600
601/** DRM_IOCTL_GEM_FLINK ioctl argument type */
602struct drm_gem_flink {
603 /** Handle for the object being named */
604 __u32 handle;
605
606 /** Returned global name */
607 __u32 name;
608};
609
610/** DRM_IOCTL_GEM_OPEN ioctl argument type */
611struct drm_gem_open {
612 /** Name of object being opened */
613 __u32 name;
614
615 /** Returned handle for the object */
616 __u32 handle;
617
618 /** Returned size of the object */
619 __u64 size;
620};
621
622#define DRM_CAP_DUMB_BUFFER 0x1
623#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
624#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
625#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
626#define DRM_CAP_PRIME 0x5
627#define DRM_PRIME_CAP_IMPORT 0x1
628#define DRM_PRIME_CAP_EXPORT 0x2
629#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
630#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
631/*
632 * The CURSOR_WIDTH and CURSOR_HEIGHT capabilities return a valid widthxheight
633 * combination for the hardware cursor. The intention is that a hardware
634 * agnostic userspace can query a cursor plane size to use.
635 *
636 * Note that the cross-driver contract is to merely return a valid size;
637 * drivers are free to attach another meaning on top, eg. i915 returns the
638 * maximum plane size.
639 */
640#define DRM_CAP_CURSOR_WIDTH 0x8
641#define DRM_CAP_CURSOR_HEIGHT 0x9
642#define DRM_CAP_ADDFB2_MODIFIERS 0x10
643#define DRM_CAP_PAGE_FLIP_TARGET 0x11
644#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
645#define DRM_CAP_SYNCOBJ 0x13
646
647/** DRM_IOCTL_GET_CAP ioctl argument type */
648struct drm_get_cap {
649 __u64 capability;
650 __u64 value;
651};
652
653/**
654 * DRM_CLIENT_CAP_STEREO_3D
655 *
656 * if set to 1, the DRM core will expose the stereo 3D capabilities of the
657 * monitor by advertising the supported 3D layouts in the flags of struct
658 * drm_mode_modeinfo.
659 */
660#define DRM_CLIENT_CAP_STEREO_3D 1
661
662/**
663 * DRM_CLIENT_CAP_UNIVERSAL_PLANES
664 *
665 * If set to 1, the DRM core will expose all planes (overlay, primary, and
666 * cursor) to userspace.
667 */
668#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
669
670/**
671 * DRM_CLIENT_CAP_ATOMIC
672 *
673 * If set to 1, the DRM core will expose atomic properties to userspace
674 */
675#define DRM_CLIENT_CAP_ATOMIC 3
676
677/**
678 * DRM_CLIENT_CAP_ASPECT_RATIO
679 *
680 * If set to 1, the DRM core will provide aspect ratio information in modes.
681 */
682#define DRM_CLIENT_CAP_ASPECT_RATIO 4
683
684/**
685 * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
686 *
687 * If set to 1, the DRM core will expose special connectors to be used for
688 * writing back to memory the scene setup in the commit. Depends on client
689 * also supporting DRM_CLIENT_CAP_ATOMIC
690 */
691#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
692
693/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
694struct drm_set_client_cap {
695 __u64 capability;
696 __u64 value;
697};
698
699#define DRM_RDWR O_RDWR
700#define DRM_CLOEXEC O_CLOEXEC
701struct drm_prime_handle {
702 __u32 handle;
703
704 /** Flags.. only applicable for handle->fd */
705 __u32 flags;
706
707 /** Returned dmabuf file descriptor */
708 __s32 fd;
709};
710
711struct drm_syncobj_create {
712 __u32 handle;
713#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
714 __u32 flags;
715};
716
717struct drm_syncobj_destroy {
718 __u32 handle;
719 __u32 pad;
720};
721
722#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
723#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
724struct drm_syncobj_handle {
725 __u32 handle;
726 __u32 flags;
727
728 __s32 fd;
729 __u32 pad;
730};
731
732#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
733#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
734struct drm_syncobj_wait {
735 __u64 handles;
736 /* absolute timeout */
737 __s64 timeout_nsec;
738 __u32 count_handles;
739 __u32 flags;
740 __u32 first_signaled; /* only valid when not waiting all */
741 __u32 pad;
742};
743
744struct drm_syncobj_array {
745 __u64 handles;
746 __u32 count_handles;
747 __u32 pad;
748};
749
750/* Query current scanout sequence number */
751struct drm_crtc_get_sequence {
752 __u32 crtc_id; /* requested crtc_id */
753 __u32 active; /* return: crtc output is active */
754 __u64 sequence; /* return: most recent vblank sequence */
755 __s64 sequence_ns; /* return: most recent time of first pixel out */
756};
757
758/* Queue event to be delivered at specified sequence. Time stamp marks
759 * when the first pixel of the refresh cycle leaves the display engine
760 * for the display
761 */
762#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */
763#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */
764
765struct drm_crtc_queue_sequence {
766 __u32 crtc_id;
767 __u32 flags;
768 __u64 sequence; /* on input, target sequence. on output, actual sequence */
769 __u64 user_data; /* user data passed to event */
770};
771
772#if defined(__cplusplus)
773}
774#endif
775
776#include "drm_mode.h"
777
778#if defined(__cplusplus)
779extern "C" {
780#endif
781
782#define DRM_IOCTL_BASE 'd'
783#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
784#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
785#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
786#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
787
788#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
789#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
790#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
791#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
792#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
793#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
794#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
795#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
796#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
797#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
798#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
799#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
800#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap)
801#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)
802
803#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
804#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
805#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
806#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
807#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
808#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
809#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
810#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
811#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
812#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
813#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
814
815#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
816
817#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
818#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
819
820#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
821#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
822
823#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
824#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
825#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
826#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
827#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
828#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
829#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
830#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
831#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
832#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
833#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
834#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
835#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
836
837#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
838#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
839
840#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
841#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
842#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
843#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
844#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
845#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
846#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
847#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
848
849#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
850#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
851
852#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
853
854#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)
855#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)
856
857#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
858
859#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
860#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
861#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
862#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
863#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
864#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
865#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
866#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
867#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */
868#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */
869
870#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
871#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
872#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
873#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
874#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
875#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
876#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
877#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
878
879#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
880#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
881#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
882#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
883#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
884#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
885#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
886#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
887#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
888#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
889#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic)
890#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob)
891#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob)
892
893#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create)
894#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
895#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
896#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
897#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
898#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
899#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
900
901#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease)
902#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)
903#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
904#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
905
906/**
907 * Device specific ioctls should only be in their respective headers
908 * The device specific ioctl range is from 0x40 to 0x9f.
909 * Generic IOCTLS restart at 0xA0.
910 *
911 * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
912 * drmCommandReadWrite().
913 */
914#define DRM_COMMAND_BASE 0x40
915#define DRM_COMMAND_END 0xA0
916
917/**
918 * Header for events written back to userspace on the drm fd. The
919 * type defines the type of event, the length specifies the total
920 * length of the event (including the header), and user_data is
921 * typically a 64 bit value passed with the ioctl that triggered the
922 * event. A read on the drm fd will always only return complete
923 * events, that is, if for example the read buffer is 100 bytes, and
924 * there are two 64 byte events pending, only one will be returned.
925 *
926 * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
927 * up are chipset specific.
928 */
929struct drm_event {
930 __u32 type;
931 __u32 length;
932};
933
934#define DRM_EVENT_VBLANK 0x01
935#define DRM_EVENT_FLIP_COMPLETE 0x02
936#define DRM_EVENT_CRTC_SEQUENCE 0x03
937
938struct drm_event_vblank {
939 struct drm_event base;
940 __u64 user_data;
941 __u32 tv_sec;
942 __u32 tv_usec;
943 __u32 sequence;
944 __u32 crtc_id; /* 0 on older kernels that do not support this */
945};
946
947/* Event delivered at sequence. Time stamp marks when the first pixel
948 * of the refresh cycle leaves the display engine for the display
949 */
950struct drm_event_crtc_sequence {
951 struct drm_event base;
952 __u64 user_data;
953 __s64 time_ns;
954 __u64 sequence;
955};
956
957/* typedef area */
958typedef struct drm_clip_rect drm_clip_rect_t;
959typedef struct drm_drawable_info drm_drawable_info_t;
960typedef struct drm_tex_region drm_tex_region_t;
961typedef struct drm_hw_lock drm_hw_lock_t;
962typedef struct drm_version drm_version_t;
963typedef struct drm_unique drm_unique_t;
964typedef struct drm_list drm_list_t;
965typedef struct drm_block drm_block_t;
966typedef struct drm_control drm_control_t;
967typedef enum drm_map_type drm_map_type_t;
968typedef enum drm_map_flags drm_map_flags_t;
969typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
970typedef struct drm_map drm_map_t;
971typedef struct drm_client drm_client_t;
972typedef enum drm_stat_type drm_stat_type_t;
973typedef struct drm_stats drm_stats_t;
974typedef enum drm_lock_flags drm_lock_flags_t;
975typedef struct drm_lock drm_lock_t;
976typedef enum drm_dma_flags drm_dma_flags_t;
977typedef struct drm_buf_desc drm_buf_desc_t;
978typedef struct drm_buf_info drm_buf_info_t;
979typedef struct drm_buf_free drm_buf_free_t;
980typedef struct drm_buf_pub drm_buf_pub_t;
981typedef struct drm_buf_map drm_buf_map_t;
982typedef struct drm_dma drm_dma_t;
983typedef union drm_wait_vblank drm_wait_vblank_t;
984typedef struct drm_agp_mode drm_agp_mode_t;
985typedef enum drm_ctx_flags drm_ctx_flags_t;
986typedef struct drm_ctx drm_ctx_t;
987typedef struct drm_ctx_res drm_ctx_res_t;
988typedef struct drm_draw drm_draw_t;
989typedef struct drm_update_draw drm_update_draw_t;
990typedef struct drm_auth drm_auth_t;
991typedef struct drm_irq_busid drm_irq_busid_t;
992typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
993
994typedef struct drm_agp_buffer drm_agp_buffer_t;
995typedef struct drm_agp_binding drm_agp_binding_t;
996typedef struct drm_agp_info drm_agp_info_t;
997typedef struct drm_scatter_gather drm_scatter_gather_t;
998typedef struct drm_set_version drm_set_version_t;
999
1000#if defined(__cplusplus)
1001}
1002#endif
1003
1004#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/drm_fourcc.h deleted-588
...@@ -1,588 +0,0 @@
1/*
2 * Copyright 2011 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef DRM_FOURCC_H
25#define DRM_FOURCC_H
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
34 ((__u32)(c) << 16) | ((__u32)(d) << 24))
35
36#define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
37
38/* color index */
39#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
40
41/* 8 bpp Red */
42#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
43
44/* 16 bpp Red */
45#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
46
47/* 16 bpp RG */
48#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */
49#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */
50
51/* 32 bpp RG */
52#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */
53#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */
54
55/* 8 bpp RGB */
56#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */
57#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */
58
59/* 16 bpp RGB */
60#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */
61#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */
62#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */
63#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */
64
65#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */
66#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */
67#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */
68#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */
69
70#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */
71#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */
72#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */
73#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */
74
75#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */
76#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */
77#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */
78#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */
79
80#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */
81#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */
82
83/* 24 bpp RGB */
84#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */
85#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */
86
87/* 32 bpp RGB */
88#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */
89#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */
90#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */
91#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */
92
93#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */
94#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */
95#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */
96#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */
97
98#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */
99#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */
100#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */
101#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */
102
103#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */
104#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */
105#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
106#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
107
108/* packed YCbCr */
109#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */
110#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */
111#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */
112#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
113
114#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
115
116/*
117 * 2 plane RGB + A
118 * index 0 = RGB plane, same format as the corresponding non _A8 format has
119 * index 1 = A plane, [7:0] A
120 */
121#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8')
122#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8')
123#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8')
124#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8')
125#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8')
126#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8')
127#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8')
128#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8')
129
130/*
131 * 2 plane YCbCr
132 * index 0 = Y plane, [7:0] Y
133 * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian
134 * or
135 * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian
136 */
137#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */
138#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */
139#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */
140#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */
141#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */
142#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
143
144/*
145 * 3 plane YCbCr
146 * index 0: Y plane, [7:0] Y
147 * index 1: Cb plane, [7:0] Cb
148 * index 2: Cr plane, [7:0] Cr
149 * or
150 * index 1: Cr plane, [7:0] Cr
151 * index 2: Cb plane, [7:0] Cb
152 */
153#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */
154#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */
155#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */
156#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */
157#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */
158#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */
159#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */
160#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */
161#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */
162#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */
163
164
165/*
166 * Format Modifiers:
167 *
168 * Format modifiers describe, typically, a re-ordering or modification
169 * of the data in a plane of an FB. This can be used to express tiled/
170 * swizzled formats, or compression, or a combination of the two.
171 *
172 * The upper 8 bits of the format modifier are a vendor-id as assigned
173 * below. The lower 56 bits are assigned as vendor sees fit.
174 */
175
176/* Vendor Ids: */
177#define DRM_FORMAT_MOD_NONE 0
178#define DRM_FORMAT_MOD_VENDOR_NONE 0
179#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01
180#define DRM_FORMAT_MOD_VENDOR_AMD 0x02
181#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03
182#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04
183#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05
184#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06
185#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07
186#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
187/* add more to the end as needed */
188
189#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
190
191#define fourcc_mod_code(vendor, val) \
192 ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
193
194/*
195 * Format Modifier tokens:
196 *
197 * When adding a new token please document the layout with a code comment,
198 * similar to the fourcc codes above. drm_fourcc.h is considered the
199 * authoritative source for all of these.
200 */
201
202/*
203 * Invalid Modifier
204 *
205 * This modifier can be used as a sentinel to terminate the format modifiers
206 * list, or to initialize a variable with an invalid modifier. It might also be
207 * used to report an error back to userspace for certain APIs.
208 */
209#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
210
211/*
212 * Linear Layout
213 *
214 * Just plain linear layout. Note that this is different from no specifying any
215 * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl),
216 * which tells the driver to also take driver-internal information into account
217 * and so might actually result in a tiled framebuffer.
218 */
219#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0)
220
221/* Intel framebuffer modifiers */
222
223/*
224 * Intel X-tiling layout
225 *
226 * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
227 * in row-major layout. Within the tile bytes are laid out row-major, with
228 * a platform-dependent stride. On top of that the memory can apply
229 * platform-depending swizzling of some higher address bits into bit6.
230 *
231 * This format is highly platforms specific and not useful for cross-driver
232 * sharing. It exists since on a given platform it does uniquely identify the
233 * layout in a simple way for i915-specific userspace.
234 */
235#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1)
236
237/*
238 * Intel Y-tiling layout
239 *
240 * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
241 * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
242 * chunks column-major, with a platform-dependent height. On top of that the
243 * memory can apply platform-depending swizzling of some higher address bits
244 * into bit6.
245 *
246 * This format is highly platforms specific and not useful for cross-driver
247 * sharing. It exists since on a given platform it does uniquely identify the
248 * layout in a simple way for i915-specific userspace.
249 */
250#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2)
251
252/*
253 * Intel Yf-tiling layout
254 *
255 * This is a tiled layout using 4Kb tiles in row-major layout.
256 * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which
257 * are arranged in four groups (two wide, two high) with column-major layout.
258 * Each group therefore consits out of four 256 byte units, which are also laid
259 * out as 2x2 column-major.
260 * 256 byte units are made out of four 64 byte blocks of pixels, producing
261 * either a square block or a 2:1 unit.
262 * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width
263 * in pixel depends on the pixel depth.
264 */
265#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
266
267/*
268 * Intel color control surface (CCS) for render compression
269 *
270 * The framebuffer format must be one of the 8:8:8:8 RGB formats.
271 * The main surface will be plane index 0 and must be Y/Yf-tiled,
272 * the CCS will be plane index 1.
273 *
274 * Each CCS tile matches a 1024x512 pixel area of the main surface.
275 * To match certain aspects of the 3D hardware the CCS is
276 * considered to be made up of normal 128Bx32 Y tiles, Thus
277 * the CCS pitch must be specified in multiples of 128 bytes.
278 *
279 * In reality the CCS tile appears to be a 64Bx64 Y tile, composed
280 * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks.
281 * But that fact is not relevant unless the memory is accessed
282 * directly.
283 */
284#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4)
285#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5)
286
287/*
288 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
289 *
290 * Macroblocks are laid in a Z-shape, and each pixel data is following the
291 * standard NV12 style.
292 * As for NV12, an image is the result of two frame buffers: one for Y,
293 * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer).
294 * Alignment requirements are (for each buffer):
295 * - multiple of 128 pixels for the width
296 * - multiple of 32 pixels for the height
297 *
298 * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html
299 */
300#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
301
302/*
303 * Qualcomm Compressed Format
304 *
305 * Refers to a compressed variant of the base format that is compressed.
306 * Implementation may be platform and base-format specific.
307 *
308 * Each macrotile consists of m x n (mostly 4 x 4) tiles.
309 * Pixel data pitch/stride is aligned with macrotile width.
310 * Pixel data height is aligned with macrotile height.
311 * Entire pixel data buffer is aligned with 4k(bytes).
312 */
313#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
314
315/* Vivante framebuffer modifiers */
316
317/*
318 * Vivante 4x4 tiling layout
319 *
320 * This is a simple tiled layout using tiles of 4x4 pixels in a row-major
321 * layout.
322 */
323#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1)
324
325/*
326 * Vivante 64x64 super-tiling layout
327 *
328 * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile
329 * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row-
330 * major layout.
331 *
332 * For more information: see
333 * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling
334 */
335#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2)
336
337/*
338 * Vivante 4x4 tiling layout for dual-pipe
339 *
340 * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a
341 * different base address. Offsets from the base addresses are therefore halved
342 * compared to the non-split tiled layout.
343 */
344#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3)
345
346/*
347 * Vivante 64x64 super-tiling layout for dual-pipe
348 *
349 * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile
350 * starts at a different base address. Offsets from the base addresses are
351 * therefore halved compared to the non-split super-tiled layout.
352 */
353#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)
354
355/* NVIDIA frame buffer modifiers */
356
357/*
358 * Tegra Tiled Layout, used by Tegra 2, 3 and 4.
359 *
360 * Pixels are arranged in simple tiles of 16 x 16 bytes.
361 */
362#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1)
363
364/*
365 * 16Bx2 Block Linear layout, used by desktop GPUs, and Tegra K1 and later
366 *
367 * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked
368 * vertically by a power of 2 (1 to 32 GOBs) to form a block.
369 *
370 * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape.
371 *
372 * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically.
373 * Valid values are:
374 *
375 * 0 == ONE_GOB
376 * 1 == TWO_GOBS
377 * 2 == FOUR_GOBS
378 * 3 == EIGHT_GOBS
379 * 4 == SIXTEEN_GOBS
380 * 5 == THIRTYTWO_GOBS
381 *
382 * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format
383 * in full detail.
384 */
385#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \
386 fourcc_mod_code(NVIDIA, 0x10 | ((v) & 0xf))
387
388#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \
389 fourcc_mod_code(NVIDIA, 0x10)
390#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \
391 fourcc_mod_code(NVIDIA, 0x11)
392#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \
393 fourcc_mod_code(NVIDIA, 0x12)
394#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \
395 fourcc_mod_code(NVIDIA, 0x13)
396#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \
397 fourcc_mod_code(NVIDIA, 0x14)
398#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \
399 fourcc_mod_code(NVIDIA, 0x15)
400
401/*
402 * Some Broadcom modifiers take parameters, for example the number of
403 * vertical lines in the image. Reserve the lower 32 bits for modifier
404 * type, and the next 24 bits for parameters. Top 8 bits are the
405 * vendor code.
406 */
407#define __fourcc_mod_broadcom_param_shift 8
408#define __fourcc_mod_broadcom_param_bits 48
409#define fourcc_mod_broadcom_code(val, params) \
410 fourcc_mod_code(BROADCOM, ((((__u64)params) << __fourcc_mod_broadcom_param_shift) | val))
411#define fourcc_mod_broadcom_param(m) \
412 ((int)(((m) >> __fourcc_mod_broadcom_param_shift) & \
413 ((1ULL << __fourcc_mod_broadcom_param_bits) - 1)))
414#define fourcc_mod_broadcom_mod(m) \
415 ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << \
416 __fourcc_mod_broadcom_param_shift))
417
418/*
419 * Broadcom VC4 "T" format
420 *
421 * This is the primary layout that the V3D GPU can texture from (it
422 * can't do linear). The T format has:
423 *
424 * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4
425 * pixels at 32 bit depth.
426 *
427 * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually
428 * 16x16 pixels).
429 *
430 * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On
431 * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows
432 * they're (TR, BR, BL, TL), where bottom left is start of memory.
433 *
434 * - an image made of 4k tiles in rows either left-to-right (even rows of 4k
435 * tiles) or right-to-left (odd rows of 4k tiles).
436 */
437#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1)
438
439/*
440 * Broadcom SAND format
441 *
442 * This is the native format that the H.264 codec block uses. For VC4
443 * HVS, it is only valid for H.264 (NV12/21) and RGBA modes.
444 *
445 * The image can be considered to be split into columns, and the
446 * columns are placed consecutively into memory. The width of those
447 * columns can be either 32, 64, 128, or 256 pixels, but in practice
448 * only 128 pixel columns are used.
449 *
450 * The pitch between the start of each column is set to optimally
451 * switch between SDRAM banks. This is passed as the number of lines
452 * of column width in the modifier (we can't use the stride value due
453 * to various core checks that look at it , so you should set the
454 * stride to width*cpp).
455 *
456 * Note that the column height for this format modifier is the same
457 * for all of the planes, assuming that each column contains both Y
458 * and UV. Some SAND-using hardware stores UV in a separate tiled
459 * image from Y to reduce the column height, which is not supported
460 * with these modifiers.
461 */
462
463#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \
464 fourcc_mod_broadcom_code(2, v)
465#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) \
466 fourcc_mod_broadcom_code(3, v)
467#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) \
468 fourcc_mod_broadcom_code(4, v)
469#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) \
470 fourcc_mod_broadcom_code(5, v)
471
472#define DRM_FORMAT_MOD_BROADCOM_SAND32 \
473 DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0)
474#define DRM_FORMAT_MOD_BROADCOM_SAND64 \
475 DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0)
476#define DRM_FORMAT_MOD_BROADCOM_SAND128 \
477 DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0)
478#define DRM_FORMAT_MOD_BROADCOM_SAND256 \
479 DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0)
480
481/* Broadcom UIF format
482 *
483 * This is the common format for the current Broadcom multimedia
484 * blocks, including V3D 3.x and newer, newer video codecs, and
485 * displays.
486 *
487 * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles),
488 * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are
489 * stored in columns, with padding between the columns to ensure that
490 * moving from one column to the next doesn't hit the same SDRAM page
491 * bank.
492 *
493 * To calculate the padding, it is assumed that each hardware block
494 * and the software driving it knows the platform's SDRAM page size,
495 * number of banks, and XOR address, and that it's identical between
496 * all blocks using the format. This tiling modifier will use XOR as
497 * necessary to reduce the padding. If a hardware block can't do XOR,
498 * the assumption is that a no-XOR tiling modifier will be created.
499 */
500#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6)
501
502/*
503 * Arm Framebuffer Compression (AFBC) modifiers
504 *
505 * AFBC is a proprietary lossless image compression protocol and format.
506 * It provides fine-grained random access and minimizes the amount of data
507 * transferred between IP blocks.
508 *
509 * AFBC has several features which may be supported and/or used, which are
510 * represented using bits in the modifier. Not all combinations are valid,
511 * and different devices or use-cases may support different combinations.
512 */
513#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) fourcc_mod_code(ARM, __afbc_mode)
514
515/*
516 * AFBC superblock size
517 *
518 * Indicates the superblock size(s) used for the AFBC buffer. The buffer
519 * size (in pixels) must be aligned to a multiple of the superblock size.
520 * Four lowest significant bits(LSBs) are reserved for block size.
521 */
522#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf
523#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL)
524#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL)
525
526/*
527 * AFBC lossless colorspace transform
528 *
529 * Indicates that the buffer makes use of the AFBC lossless colorspace
530 * transform.
531 */
532#define AFBC_FORMAT_MOD_YTR (1ULL << 4)
533
534/*
535 * AFBC block-split
536 *
537 * Indicates that the payload of each superblock is split. The second
538 * half of the payload is positioned at a predefined offset from the start
539 * of the superblock payload.
540 */
541#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5)
542
543/*
544 * AFBC sparse layout
545 *
546 * This flag indicates that the payload of each superblock must be stored at a
547 * predefined position relative to the other superblocks in the same AFBC
548 * buffer. This order is the same order used by the header buffer. In this mode
549 * each superblock is given the same amount of space as an uncompressed
550 * superblock of the particular format would require, rounding up to the next
551 * multiple of 128 bytes in size.
552 */
553#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6)
554
555/*
556 * AFBC copy-block restrict
557 *
558 * Buffers with this flag must obey the copy-block restriction. The restriction
559 * is such that there are no copy-blocks referring across the border of 8x8
560 * blocks. For the subsampled data the 8x8 limitation is also subsampled.
561 */
562#define AFBC_FORMAT_MOD_CBR (1ULL << 7)
563
564/*
565 * AFBC tiled layout
566 *
567 * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all
568 * superblocks inside a tile are stored together in memory. 8x8 tiles are used
569 * for pixel formats up to and including 32 bpp while 4x4 tiles are used for
570 * larger bpp formats. The order between the tiles is scan line.
571 * When the tiled layout is used, the buffer size (in pixels) must be aligned
572 * to the tile size.
573 */
574#define AFBC_FORMAT_MOD_TILED (1ULL << 8)
575
576/*
577 * AFBC solid color blocks
578 *
579 * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth
580 * can be reduced if a whole superblock is a single color.
581 */
582#define AFBC_FORMAT_MOD_SC (1ULL << 9)
583
584#if defined(__cplusplus)
585}
586#endif
587
588#endif /* DRM_FOURCC_H */
\ No newline at end of file
lib/libc/include/generic-musl/drm/drm_mode.h deleted-894
...@@ -1,894 +0,0 @@
1/*
2 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
3 * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>
4 * Copyright (c) 2008 Red Hat Inc.
5 * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
6 * Copyright (c) 2007-2008 Intel Corporation
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 * IN THE SOFTWARE.
25 */
26
27#ifndef _DRM_MODE_H
28#define _DRM_MODE_H
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36#define DRM_DISPLAY_INFO_LEN 32
37#define DRM_CONNECTOR_NAME_LEN 32
38#define DRM_DISPLAY_MODE_LEN 32
39#define DRM_PROP_NAME_LEN 32
40
41#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */
42#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
43#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
44#define DRM_MODE_TYPE_PREFERRED (1<<3)
45#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */
46#define DRM_MODE_TYPE_USERDEF (1<<5)
47#define DRM_MODE_TYPE_DRIVER (1<<6)
48
49#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \
50 DRM_MODE_TYPE_USERDEF | \
51 DRM_MODE_TYPE_DRIVER)
52
53/* Video mode flags */
54/* bit compatible with the xrandr RR_ definitions (bits 0-13)
55 *
56 * ABI warning: Existing userspace really expects
57 * the mode flags to match the xrandr definitions. Any
58 * changes that don't match the xrandr definitions will
59 * likely need a new client cap or some other mechanism
60 * to avoid breaking existing userspace. This includes
61 * allocating new flags in the previously unused bits!
62 */
63#define DRM_MODE_FLAG_PHSYNC (1<<0)
64#define DRM_MODE_FLAG_NHSYNC (1<<1)
65#define DRM_MODE_FLAG_PVSYNC (1<<2)
66#define DRM_MODE_FLAG_NVSYNC (1<<3)
67#define DRM_MODE_FLAG_INTERLACE (1<<4)
68#define DRM_MODE_FLAG_DBLSCAN (1<<5)
69#define DRM_MODE_FLAG_CSYNC (1<<6)
70#define DRM_MODE_FLAG_PCSYNC (1<<7)
71#define DRM_MODE_FLAG_NCSYNC (1<<8)
72#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */
73#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */
74#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */
75#define DRM_MODE_FLAG_DBLCLK (1<<12)
76#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
77 /*
78 * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX
79 * (define not exposed to user space).
80 */
81#define DRM_MODE_FLAG_3D_MASK (0x1f<<14)
82#define DRM_MODE_FLAG_3D_NONE (0<<14)
83#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14)
84#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14)
85#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14)
86#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14)
87#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14)
88#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14)
89#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14)
90#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14)
91
92/* Picture aspect ratio options */
93#define DRM_MODE_PICTURE_ASPECT_NONE 0
94#define DRM_MODE_PICTURE_ASPECT_4_3 1
95#define DRM_MODE_PICTURE_ASPECT_16_9 2
96#define DRM_MODE_PICTURE_ASPECT_64_27 3
97#define DRM_MODE_PICTURE_ASPECT_256_135 4
98
99/* Content type options */
100#define DRM_MODE_CONTENT_TYPE_NO_DATA 0
101#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1
102#define DRM_MODE_CONTENT_TYPE_PHOTO 2
103#define DRM_MODE_CONTENT_TYPE_CINEMA 3
104#define DRM_MODE_CONTENT_TYPE_GAME 4
105
106/* Aspect ratio flag bitmask (4 bits 22:19) */
107#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19)
108#define DRM_MODE_FLAG_PIC_AR_NONE \
109 (DRM_MODE_PICTURE_ASPECT_NONE<<19)
110#define DRM_MODE_FLAG_PIC_AR_4_3 \
111 (DRM_MODE_PICTURE_ASPECT_4_3<<19)
112#define DRM_MODE_FLAG_PIC_AR_16_9 \
113 (DRM_MODE_PICTURE_ASPECT_16_9<<19)
114#define DRM_MODE_FLAG_PIC_AR_64_27 \
115 (DRM_MODE_PICTURE_ASPECT_64_27<<19)
116#define DRM_MODE_FLAG_PIC_AR_256_135 \
117 (DRM_MODE_PICTURE_ASPECT_256_135<<19)
118
119#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \
120 DRM_MODE_FLAG_NHSYNC | \
121 DRM_MODE_FLAG_PVSYNC | \
122 DRM_MODE_FLAG_NVSYNC | \
123 DRM_MODE_FLAG_INTERLACE | \
124 DRM_MODE_FLAG_DBLSCAN | \
125 DRM_MODE_FLAG_CSYNC | \
126 DRM_MODE_FLAG_PCSYNC | \
127 DRM_MODE_FLAG_NCSYNC | \
128 DRM_MODE_FLAG_HSKEW | \
129 DRM_MODE_FLAG_DBLCLK | \
130 DRM_MODE_FLAG_CLKDIV2 | \
131 DRM_MODE_FLAG_3D_MASK)
132
133/* DPMS flags */
134/* bit compatible with the xorg definitions. */
135#define DRM_MODE_DPMS_ON 0
136#define DRM_MODE_DPMS_STANDBY 1
137#define DRM_MODE_DPMS_SUSPEND 2
138#define DRM_MODE_DPMS_OFF 3
139
140/* Scaling mode options */
141#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or
142 software can still scale) */
143#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */
144#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
145#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
146
147/* Dithering mode options */
148#define DRM_MODE_DITHERING_OFF 0
149#define DRM_MODE_DITHERING_ON 1
150#define DRM_MODE_DITHERING_AUTO 2
151
152/* Dirty info options */
153#define DRM_MODE_DIRTY_OFF 0
154#define DRM_MODE_DIRTY_ON 1
155#define DRM_MODE_DIRTY_ANNOTATE 2
156
157/* Link Status options */
158#define DRM_MODE_LINK_STATUS_GOOD 0
159#define DRM_MODE_LINK_STATUS_BAD 1
160
161/*
162 * DRM_MODE_ROTATE_<degrees>
163 *
164 * Signals that a drm plane is been rotated <degrees> degrees in counter
165 * clockwise direction.
166 *
167 * This define is provided as a convenience, looking up the property id
168 * using the name->prop id lookup is the preferred method.
169 */
170#define DRM_MODE_ROTATE_0 (1<<0)
171#define DRM_MODE_ROTATE_90 (1<<1)
172#define DRM_MODE_ROTATE_180 (1<<2)
173#define DRM_MODE_ROTATE_270 (1<<3)
174
175/*
176 * DRM_MODE_ROTATE_MASK
177 *
178 * Bitmask used to look for drm plane rotations.
179 */
180#define DRM_MODE_ROTATE_MASK (\
181 DRM_MODE_ROTATE_0 | \
182 DRM_MODE_ROTATE_90 | \
183 DRM_MODE_ROTATE_180 | \
184 DRM_MODE_ROTATE_270)
185
186/*
187 * DRM_MODE_REFLECT_<axis>
188 *
189 * Signals that the contents of a drm plane is reflected in the <axis> axis,
190 * in the same way as mirroring.
191 *
192 * This define is provided as a convenience, looking up the property id
193 * using the name->prop id lookup is the preferred method.
194 */
195#define DRM_MODE_REFLECT_X (1<<4)
196#define DRM_MODE_REFLECT_Y (1<<5)
197
198/*
199 * DRM_MODE_REFLECT_MASK
200 *
201 * Bitmask used to look for drm plane reflections.
202 */
203#define DRM_MODE_REFLECT_MASK (\
204 DRM_MODE_REFLECT_X | \
205 DRM_MODE_REFLECT_Y)
206
207/* Content Protection Flags */
208#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0
209#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1
210#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2
211
212struct drm_mode_modeinfo {
213 __u32 clock;
214 __u16 hdisplay;
215 __u16 hsync_start;
216 __u16 hsync_end;
217 __u16 htotal;
218 __u16 hskew;
219 __u16 vdisplay;
220 __u16 vsync_start;
221 __u16 vsync_end;
222 __u16 vtotal;
223 __u16 vscan;
224
225 __u32 vrefresh;
226
227 __u32 flags;
228 __u32 type;
229 char name[DRM_DISPLAY_MODE_LEN];
230};
231
232struct drm_mode_card_res {
233 __u64 fb_id_ptr;
234 __u64 crtc_id_ptr;
235 __u64 connector_id_ptr;
236 __u64 encoder_id_ptr;
237 __u32 count_fbs;
238 __u32 count_crtcs;
239 __u32 count_connectors;
240 __u32 count_encoders;
241 __u32 min_width;
242 __u32 max_width;
243 __u32 min_height;
244 __u32 max_height;
245};
246
247struct drm_mode_crtc {
248 __u64 set_connectors_ptr;
249 __u32 count_connectors;
250
251 __u32 crtc_id; /**< Id */
252 __u32 fb_id; /**< Id of framebuffer */
253
254 __u32 x; /**< x Position on the framebuffer */
255 __u32 y; /**< y Position on the framebuffer */
256
257 __u32 gamma_size;
258 __u32 mode_valid;
259 struct drm_mode_modeinfo mode;
260};
261
262#define DRM_MODE_PRESENT_TOP_FIELD (1<<0)
263#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1)
264
265/* Planes blend with or override other bits on the CRTC */
266struct drm_mode_set_plane {
267 __u32 plane_id;
268 __u32 crtc_id;
269 __u32 fb_id; /* fb object contains surface format type */
270 __u32 flags; /* see above flags */
271
272 /* Signed dest location allows it to be partially off screen */
273 __s32 crtc_x;
274 __s32 crtc_y;
275 __u32 crtc_w;
276 __u32 crtc_h;
277
278 /* Source values are 16.16 fixed point */
279 __u32 src_x;
280 __u32 src_y;
281 __u32 src_h;
282 __u32 src_w;
283};
284
285struct drm_mode_get_plane {
286 __u32 plane_id;
287
288 __u32 crtc_id;
289 __u32 fb_id;
290
291 __u32 possible_crtcs;
292 __u32 gamma_size;
293
294 __u32 count_format_types;
295 __u64 format_type_ptr;
296};
297
298struct drm_mode_get_plane_res {
299 __u64 plane_id_ptr;
300 __u32 count_planes;
301};
302
303#define DRM_MODE_ENCODER_NONE 0
304#define DRM_MODE_ENCODER_DAC 1
305#define DRM_MODE_ENCODER_TMDS 2
306#define DRM_MODE_ENCODER_LVDS 3
307#define DRM_MODE_ENCODER_TVDAC 4
308#define DRM_MODE_ENCODER_VIRTUAL 5
309#define DRM_MODE_ENCODER_DSI 6
310#define DRM_MODE_ENCODER_DPMST 7
311#define DRM_MODE_ENCODER_DPI 8
312
313struct drm_mode_get_encoder {
314 __u32 encoder_id;
315 __u32 encoder_type;
316
317 __u32 crtc_id; /**< Id of crtc */
318
319 __u32 possible_crtcs;
320 __u32 possible_clones;
321};
322
323/* This is for connectors with multiple signal types. */
324/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
325enum drm_mode_subconnector {
326 DRM_MODE_SUBCONNECTOR_Automatic = 0,
327 DRM_MODE_SUBCONNECTOR_Unknown = 0,
328 DRM_MODE_SUBCONNECTOR_DVID = 3,
329 DRM_MODE_SUBCONNECTOR_DVIA = 4,
330 DRM_MODE_SUBCONNECTOR_Composite = 5,
331 DRM_MODE_SUBCONNECTOR_SVIDEO = 6,
332 DRM_MODE_SUBCONNECTOR_Component = 8,
333 DRM_MODE_SUBCONNECTOR_SCART = 9,
334};
335
336#define DRM_MODE_CONNECTOR_Unknown 0
337#define DRM_MODE_CONNECTOR_VGA 1
338#define DRM_MODE_CONNECTOR_DVII 2
339#define DRM_MODE_CONNECTOR_DVID 3
340#define DRM_MODE_CONNECTOR_DVIA 4
341#define DRM_MODE_CONNECTOR_Composite 5
342#define DRM_MODE_CONNECTOR_SVIDEO 6
343#define DRM_MODE_CONNECTOR_LVDS 7
344#define DRM_MODE_CONNECTOR_Component 8
345#define DRM_MODE_CONNECTOR_9PinDIN 9
346#define DRM_MODE_CONNECTOR_DisplayPort 10
347#define DRM_MODE_CONNECTOR_HDMIA 11
348#define DRM_MODE_CONNECTOR_HDMIB 12
349#define DRM_MODE_CONNECTOR_TV 13
350#define DRM_MODE_CONNECTOR_eDP 14
351#define DRM_MODE_CONNECTOR_VIRTUAL 15
352#define DRM_MODE_CONNECTOR_DSI 16
353#define DRM_MODE_CONNECTOR_DPI 17
354#define DRM_MODE_CONNECTOR_WRITEBACK 18
355
356struct drm_mode_get_connector {
357
358 __u64 encoders_ptr;
359 __u64 modes_ptr;
360 __u64 props_ptr;
361 __u64 prop_values_ptr;
362
363 __u32 count_modes;
364 __u32 count_props;
365 __u32 count_encoders;
366
367 __u32 encoder_id; /**< Current Encoder */
368 __u32 connector_id; /**< Id */
369 __u32 connector_type;
370 __u32 connector_type_id;
371
372 __u32 connection;
373 __u32 mm_width; /**< width in millimeters */
374 __u32 mm_height; /**< height in millimeters */
375 __u32 subpixel;
376
377 __u32 pad;
378};
379
380#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */
381#define DRM_MODE_PROP_RANGE (1<<1)
382#define DRM_MODE_PROP_IMMUTABLE (1<<2)
383#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */
384#define DRM_MODE_PROP_BLOB (1<<4)
385#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */
386
387/* non-extended types: legacy bitmask, one bit per type: */
388#define DRM_MODE_PROP_LEGACY_TYPE ( \
389 DRM_MODE_PROP_RANGE | \
390 DRM_MODE_PROP_ENUM | \
391 DRM_MODE_PROP_BLOB | \
392 DRM_MODE_PROP_BITMASK)
393
394/* extended-types: rather than continue to consume a bit per type,
395 * grab a chunk of the bits to use as integer type id.
396 */
397#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0
398#define DRM_MODE_PROP_TYPE(n) ((n) << 6)
399#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
400#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
401
402/* the PROP_ATOMIC flag is used to hide properties from userspace that
403 * is not aware of atomic properties. This is mostly to work around
404 * older userspace (DDX drivers) that read/write each prop they find,
405 * witout being aware that this could be triggering a lengthy modeset.
406 */
407#define DRM_MODE_PROP_ATOMIC 0x80000000
408
409struct drm_mode_property_enum {
410 __u64 value;
411 char name[DRM_PROP_NAME_LEN];
412};
413
414struct drm_mode_get_property {
415 __u64 values_ptr; /* values and blob lengths */
416 __u64 enum_blob_ptr; /* enum and blob id ptrs */
417
418 __u32 prop_id;
419 __u32 flags;
420 char name[DRM_PROP_NAME_LEN];
421
422 __u32 count_values;
423 /* This is only used to count enum values, not blobs. The _blobs is
424 * simply because of a historical reason, i.e. backwards compat. */
425 __u32 count_enum_blobs;
426};
427
428struct drm_mode_connector_set_property {
429 __u64 value;
430 __u32 prop_id;
431 __u32 connector_id;
432};
433
434#define DRM_MODE_OBJECT_CRTC 0xcccccccc
435#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
436#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
437#define DRM_MODE_OBJECT_MODE 0xdededede
438#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
439#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
440#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
441#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
442#define DRM_MODE_OBJECT_ANY 0
443
444struct drm_mode_obj_get_properties {
445 __u64 props_ptr;
446 __u64 prop_values_ptr;
447 __u32 count_props;
448 __u32 obj_id;
449 __u32 obj_type;
450};
451
452struct drm_mode_obj_set_property {
453 __u64 value;
454 __u32 prop_id;
455 __u32 obj_id;
456 __u32 obj_type;
457};
458
459struct drm_mode_get_blob {
460 __u32 blob_id;
461 __u32 length;
462 __u64 data;
463};
464
465struct drm_mode_fb_cmd {
466 __u32 fb_id;
467 __u32 width;
468 __u32 height;
469 __u32 pitch;
470 __u32 bpp;
471 __u32 depth;
472 /* driver specific handle */
473 __u32 handle;
474};
475
476#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
477#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
478
479struct drm_mode_fb_cmd2 {
480 __u32 fb_id;
481 __u32 width;
482 __u32 height;
483 __u32 pixel_format; /* fourcc code from drm_fourcc.h */
484 __u32 flags; /* see above flags */
485
486 /*
487 * In case of planar formats, this ioctl allows up to 4
488 * buffer objects with offsets and pitches per plane.
489 * The pitch and offset order is dictated by the fourcc,
490 * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as:
491 *
492 * YUV 4:2:0 image with a plane of 8 bit Y samples
493 * followed by an interleaved U/V plane containing
494 * 8 bit 2x2 subsampled colour difference samples.
495 *
496 * So it would consist of Y as offsets[0] and UV as
497 * offsets[1]. Note that offsets[0] will generally
498 * be 0 (but this is not required).
499 *
500 * To accommodate tiled, compressed, etc formats, a
501 * modifier can be specified. The default value of zero
502 * indicates "native" format as specified by the fourcc.
503 * Vendor specific modifier token. Note that even though
504 * it looks like we have a modifier per-plane, we in fact
505 * do not. The modifier for each plane must be identical.
506 * Thus all combinations of different data layouts for
507 * multi plane formats must be enumerated as separate
508 * modifiers.
509 */
510 __u32 handles[4];
511 __u32 pitches[4]; /* pitch for each plane */
512 __u32 offsets[4]; /* offset of each plane */
513 __u64 modifier[4]; /* ie, tiling, compress */
514};
515
516#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
517#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
518#define DRM_MODE_FB_DIRTY_FLAGS 0x03
519
520#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
521
522/*
523 * Mark a region of a framebuffer as dirty.
524 *
525 * Some hardware does not automatically update display contents
526 * as a hardware or software draw to a framebuffer. This ioctl
527 * allows userspace to tell the kernel and the hardware what
528 * regions of the framebuffer have changed.
529 *
530 * The kernel or hardware is free to update more then just the
531 * region specified by the clip rects. The kernel or hardware
532 * may also delay and/or coalesce several calls to dirty into a
533 * single update.
534 *
535 * Userspace may annotate the updates, the annotates are a
536 * promise made by the caller that the change is either a copy
537 * of pixels or a fill of a single color in the region specified.
538 *
539 * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then
540 * the number of updated regions are half of num_clips given,
541 * where the clip rects are paired in src and dst. The width and
542 * height of each one of the pairs must match.
543 *
544 * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller
545 * promises that the region specified of the clip rects is filled
546 * completely with a single color as given in the color argument.
547 */
548
549struct drm_mode_fb_dirty_cmd {
550 __u32 fb_id;
551 __u32 flags;
552 __u32 color;
553 __u32 num_clips;
554 __u64 clips_ptr;
555};
556
557struct drm_mode_mode_cmd {
558 __u32 connector_id;
559 struct drm_mode_modeinfo mode;
560};
561
562#define DRM_MODE_CURSOR_BO 0x01
563#define DRM_MODE_CURSOR_MOVE 0x02
564#define DRM_MODE_CURSOR_FLAGS 0x03
565
566/*
567 * depending on the value in flags different members are used.
568 *
569 * CURSOR_BO uses
570 * crtc_id
571 * width
572 * height
573 * handle - if 0 turns the cursor off
574 *
575 * CURSOR_MOVE uses
576 * crtc_id
577 * x
578 * y
579 */
580struct drm_mode_cursor {
581 __u32 flags;
582 __u32 crtc_id;
583 __s32 x;
584 __s32 y;
585 __u32 width;
586 __u32 height;
587 /* driver specific handle */
588 __u32 handle;
589};
590
591struct drm_mode_cursor2 {
592 __u32 flags;
593 __u32 crtc_id;
594 __s32 x;
595 __s32 y;
596 __u32 width;
597 __u32 height;
598 /* driver specific handle */
599 __u32 handle;
600 __s32 hot_x;
601 __s32 hot_y;
602};
603
604struct drm_mode_crtc_lut {
605 __u32 crtc_id;
606 __u32 gamma_size;
607
608 /* pointers to arrays */
609 __u64 red;
610 __u64 green;
611 __u64 blue;
612};
613
614struct drm_color_ctm {
615 /*
616 * Conversion matrix in S31.32 sign-magnitude
617 * (not two's complement!) format.
618 */
619 __u64 matrix[9];
620};
621
622struct drm_color_lut {
623 /*
624 * Data is U0.16 fixed point format.
625 */
626 __u16 red;
627 __u16 green;
628 __u16 blue;
629 __u16 reserved;
630};
631
632#define DRM_MODE_PAGE_FLIP_EVENT 0x01
633#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
634#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
635#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
636#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
637 DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
638#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
639 DRM_MODE_PAGE_FLIP_ASYNC | \
640 DRM_MODE_PAGE_FLIP_TARGET)
641
642/*
643 * Request a page flip on the specified crtc.
644 *
645 * This ioctl will ask KMS to schedule a page flip for the specified
646 * crtc. Once any pending rendering targeting the specified fb (as of
647 * ioctl time) has completed, the crtc will be reprogrammed to display
648 * that fb after the next vertical refresh. The ioctl returns
649 * immediately, but subsequent rendering to the current fb will block
650 * in the execbuffer ioctl until the page flip happens. If a page
651 * flip is already pending as the ioctl is called, EBUSY will be
652 * returned.
653 *
654 * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
655 * event (see drm.h: struct drm_event_vblank) when the page flip is
656 * done. The user_data field passed in with this ioctl will be
657 * returned as the user_data field in the vblank event struct.
658 *
659 * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
660 * 'as soon as possible', meaning that it not delay waiting for vblank.
661 * This may cause tearing on the screen.
662 *
663 * The reserved field must be zero.
664 */
665
666struct drm_mode_crtc_page_flip {
667 __u32 crtc_id;
668 __u32 fb_id;
669 __u32 flags;
670 __u32 reserved;
671 __u64 user_data;
672};
673
674/*
675 * Request a page flip on the specified crtc.
676 *
677 * Same as struct drm_mode_crtc_page_flip, but supports new flags and
678 * re-purposes the reserved field:
679 *
680 * The sequence field must be zero unless either of the
681 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When
682 * the ABSOLUTE flag is specified, the sequence field denotes the absolute
683 * vblank sequence when the flip should take effect. When the RELATIVE
684 * flag is specified, the sequence field denotes the relative (to the
685 * current one when the ioctl is called) vblank sequence when the flip
686 * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to
687 * make sure the vblank sequence before the target one has passed before
688 * calling this ioctl. The purpose of the
689 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify
690 * the target for when code dealing with a page flip runs during a
691 * vertical blank period.
692 */
693
694struct drm_mode_crtc_page_flip_target {
695 __u32 crtc_id;
696 __u32 fb_id;
697 __u32 flags;
698 __u32 sequence;
699 __u64 user_data;
700};
701
702/* create a dumb scanout buffer */
703struct drm_mode_create_dumb {
704 __u32 height;
705 __u32 width;
706 __u32 bpp;
707 __u32 flags;
708 /* handle, pitch, size will be returned */
709 __u32 handle;
710 __u32 pitch;
711 __u64 size;
712};
713
714/* set up for mmap of a dumb scanout buffer */
715struct drm_mode_map_dumb {
716 /** Handle for the object being mapped. */
717 __u32 handle;
718 __u32 pad;
719 /**
720 * Fake offset to use for subsequent mmap call
721 *
722 * This is a fixed-size type for 32/64 compatibility.
723 */
724 __u64 offset;
725};
726
727struct drm_mode_destroy_dumb {
728 __u32 handle;
729};
730
731/* page-flip flags are valid, plus: */
732#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
733#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
734#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
735
736#define DRM_MODE_ATOMIC_FLAGS (\
737 DRM_MODE_PAGE_FLIP_EVENT |\
738 DRM_MODE_PAGE_FLIP_ASYNC |\
739 DRM_MODE_ATOMIC_TEST_ONLY |\
740 DRM_MODE_ATOMIC_NONBLOCK |\
741 DRM_MODE_ATOMIC_ALLOW_MODESET)
742
743struct drm_mode_atomic {
744 __u32 flags;
745 __u32 count_objs;
746 __u64 objs_ptr;
747 __u64 count_props_ptr;
748 __u64 props_ptr;
749 __u64 prop_values_ptr;
750 __u64 reserved;
751 __u64 user_data;
752};
753
754struct drm_format_modifier_blob {
755#define FORMAT_BLOB_CURRENT 1
756 /* Version of this blob format */
757 __u32 version;
758
759 /* Flags */
760 __u32 flags;
761
762 /* Number of fourcc formats supported */
763 __u32 count_formats;
764
765 /* Where in this blob the formats exist (in bytes) */
766 __u32 formats_offset;
767
768 /* Number of drm_format_modifiers */
769 __u32 count_modifiers;
770
771 /* Where in this blob the modifiers exist (in bytes) */
772 __u32 modifiers_offset;
773
774 /* __u32 formats[] */
775 /* struct drm_format_modifier modifiers[] */
776};
777
778struct drm_format_modifier {
779 /* Bitmask of formats in get_plane format list this info applies to. The
780 * offset allows a sliding window of which 64 formats (bits).
781 *
782 * Some examples:
783 * In today's world with < 65 formats, and formats 0, and 2 are
784 * supported
785 * 0x0000000000000005
786 * ^-offset = 0, formats = 5
787 *
788 * If the number formats grew to 128, and formats 98-102 are
789 * supported with the modifier:
790 *
791 * 0x0000007c00000000 0000000000000000
792 * ^
793 * |__offset = 64, formats = 0x7c00000000
794 *
795 */
796 __u64 formats;
797 __u32 offset;
798 __u32 pad;
799
800 /* The modifier that applies to the >get_plane format list bitmask. */
801 __u64 modifier;
802};
803
804/**
805 * Create a new 'blob' data property, copying length bytes from data pointer,
806 * and returning new blob ID.
807 */
808struct drm_mode_create_blob {
809 /** Pointer to data to copy. */
810 __u64 data;
811 /** Length of data to copy. */
812 __u32 length;
813 /** Return: new property ID. */
814 __u32 blob_id;
815};
816
817/**
818 * Destroy a user-created blob property.
819 */
820struct drm_mode_destroy_blob {
821 __u32 blob_id;
822};
823
824/**
825 * Lease mode resources, creating another drm_master.
826 */
827struct drm_mode_create_lease {
828 /** Pointer to array of object ids (__u32) */
829 __u64 object_ids;
830 /** Number of object ids */
831 __u32 object_count;
832 /** flags for new FD (O_CLOEXEC, etc) */
833 __u32 flags;
834
835 /** Return: unique identifier for lessee. */
836 __u32 lessee_id;
837 /** Return: file descriptor to new drm_master file */
838 __u32 fd;
839};
840
841/**
842 * List lesses from a drm_master
843 */
844struct drm_mode_list_lessees {
845 /** Number of lessees.
846 * On input, provides length of the array.
847 * On output, provides total number. No
848 * more than the input number will be written
849 * back, so two calls can be used to get
850 * the size and then the data.
851 */
852 __u32 count_lessees;
853 __u32 pad;
854
855 /** Pointer to lessees.
856 * pointer to __u64 array of lessee ids
857 */
858 __u64 lessees_ptr;
859};
860
861/**
862 * Get leased objects
863 */
864struct drm_mode_get_lease {
865 /** Number of leased objects.
866 * On input, provides length of the array.
867 * On output, provides total number. No
868 * more than the input number will be written
869 * back, so two calls can be used to get
870 * the size and then the data.
871 */
872 __u32 count_objects;
873 __u32 pad;
874
875 /** Pointer to objects.
876 * pointer to __u32 array of object ids
877 */
878 __u64 objects_ptr;
879};
880
881/**
882 * Revoke lease
883 */
884struct drm_mode_revoke_lease {
885 /** Unique ID of lessee
886 */
887 __u32 lessee_id;
888};
889
890#if defined(__cplusplus)
891}
892#endif
893
894#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/drm_sarea.h deleted-92
...@@ -1,92 +0,0 @@
1/**
2 * \file drm_sarea.h
3 * \brief SAREA definitions
4 *
5 * \author Michel Dänzer <michel@daenzer.net>
6 */
7
8/*
9 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
10 * All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice (including the next
20 * paragraph) shall be included in all copies or substantial portions of the
21 * Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 * OTHER DEALINGS IN THE SOFTWARE.
30 */
31
32#ifndef _DRM_SAREA_H_
33#define _DRM_SAREA_H_
34
35#include "drm.h"
36
37#if defined(__cplusplus)
38extern "C" {
39#endif
40
41/* SAREA area needs to be at least a page */
42#if defined(__alpha__)
43#define SAREA_MAX 0x2000U
44#elif defined(__mips__)
45#define SAREA_MAX 0x4000U
46#elif defined(__ia64__)
47#define SAREA_MAX 0x10000U /* 64kB */
48#else
49/* Intel 830M driver needs at least 8k SAREA */
50#define SAREA_MAX 0x2000U
51#endif
52
53/** Maximum number of drawables in the SAREA */
54#define SAREA_MAX_DRAWABLES 256
55
56#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
57
58/** SAREA drawable */
59struct drm_sarea_drawable {
60 unsigned int stamp;
61 unsigned int flags;
62};
63
64/** SAREA frame */
65struct drm_sarea_frame {
66 unsigned int x;
67 unsigned int y;
68 unsigned int width;
69 unsigned int height;
70 unsigned int fullscreen;
71};
72
73/** SAREA */
74struct drm_sarea {
75 /** first thing is always the DRM locking structure */
76 struct drm_hw_lock lock;
77 /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
78 struct drm_hw_lock drawable_lock;
79 struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
80 struct drm_sarea_frame frame; /**< frame */
81 drm_context_t dummy_context;
82};
83
84typedef struct drm_sarea_drawable drm_sarea_drawable_t;
85typedef struct drm_sarea_frame drm_sarea_frame_t;
86typedef struct drm_sarea drm_sarea_t;
87
88#if defined(__cplusplus)
89}
90#endif
91
92#endif /* _DRM_SAREA_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/etnaviv_drm.h deleted-289
...@@ -1,289 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2015 Etnaviv Project
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __ETNAVIV_DRM_H__
19#define __ETNAVIV_DRM_H__
20
21#include "drm.h"
22
23#if defined(__cplusplus)
24extern "C" {
25#endif
26
27/* Please note that modifications to all structs defined here are
28 * subject to backwards-compatibility constraints:
29 * 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
30 * user/kernel compatibility
31 * 2) Keep fields aligned to their size
32 * 3) Because of how drm_ioctl() works, we can add new fields at
33 * the end of an ioctl if some care is taken: drm_ioctl() will
34 * zero out the new fields at the tail of the ioctl, so a zero
35 * value should have a backwards compatible meaning. And for
36 * output params, userspace won't see the newly added output
37 * fields.. so that has to be somehow ok.
38 */
39
40/* timeouts are specified in clock-monotonic absolute times (to simplify
41 * restarting interrupted ioctls). The following struct is logically the
42 * same as 'struct timespec' but 32/64b ABI safe.
43 */
44struct drm_etnaviv_timespec {
45 __s64 tv_sec; /* seconds */
46 __s64 tv_nsec; /* nanoseconds */
47};
48
49#define ETNAVIV_PARAM_GPU_MODEL 0x01
50#define ETNAVIV_PARAM_GPU_REVISION 0x02
51#define ETNAVIV_PARAM_GPU_FEATURES_0 0x03
52#define ETNAVIV_PARAM_GPU_FEATURES_1 0x04
53#define ETNAVIV_PARAM_GPU_FEATURES_2 0x05
54#define ETNAVIV_PARAM_GPU_FEATURES_3 0x06
55#define ETNAVIV_PARAM_GPU_FEATURES_4 0x07
56#define ETNAVIV_PARAM_GPU_FEATURES_5 0x08
57#define ETNAVIV_PARAM_GPU_FEATURES_6 0x09
58#define ETNAVIV_PARAM_GPU_FEATURES_7 0x0a
59#define ETNAVIV_PARAM_GPU_FEATURES_8 0x0b
60#define ETNAVIV_PARAM_GPU_FEATURES_9 0x0c
61#define ETNAVIV_PARAM_GPU_FEATURES_10 0x0d
62#define ETNAVIV_PARAM_GPU_FEATURES_11 0x0e
63#define ETNAVIV_PARAM_GPU_FEATURES_12 0x0f
64
65#define ETNAVIV_PARAM_GPU_STREAM_COUNT 0x10
66#define ETNAVIV_PARAM_GPU_REGISTER_MAX 0x11
67#define ETNAVIV_PARAM_GPU_THREAD_COUNT 0x12
68#define ETNAVIV_PARAM_GPU_VERTEX_CACHE_SIZE 0x13
69#define ETNAVIV_PARAM_GPU_SHADER_CORE_COUNT 0x14
70#define ETNAVIV_PARAM_GPU_PIXEL_PIPES 0x15
71#define ETNAVIV_PARAM_GPU_VERTEX_OUTPUT_BUFFER_SIZE 0x16
72#define ETNAVIV_PARAM_GPU_BUFFER_SIZE 0x17
73#define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT 0x18
74#define ETNAVIV_PARAM_GPU_NUM_CONSTANTS 0x19
75#define ETNAVIV_PARAM_GPU_NUM_VARYINGS 0x1a
76
77#define ETNA_MAX_PIPES 4
78
79struct drm_etnaviv_param {
80 __u32 pipe; /* in */
81 __u32 param; /* in, ETNAVIV_PARAM_x */
82 __u64 value; /* out (get_param) or in (set_param) */
83};
84
85/*
86 * GEM buffers:
87 */
88
89#define ETNA_BO_CACHE_MASK 0x000f0000
90/* cache modes */
91#define ETNA_BO_CACHED 0x00010000
92#define ETNA_BO_WC 0x00020000
93#define ETNA_BO_UNCACHED 0x00040000
94/* map flags */
95#define ETNA_BO_FORCE_MMU 0x00100000
96
97struct drm_etnaviv_gem_new {
98 __u64 size; /* in */
99 __u32 flags; /* in, mask of ETNA_BO_x */
100 __u32 handle; /* out */
101};
102
103struct drm_etnaviv_gem_info {
104 __u32 handle; /* in */
105 __u32 pad;
106 __u64 offset; /* out, offset to pass to mmap() */
107};
108
109#define ETNA_PREP_READ 0x01
110#define ETNA_PREP_WRITE 0x02
111#define ETNA_PREP_NOSYNC 0x04
112
113struct drm_etnaviv_gem_cpu_prep {
114 __u32 handle; /* in */
115 __u32 op; /* in, mask of ETNA_PREP_x */
116 struct drm_etnaviv_timespec timeout; /* in */
117};
118
119struct drm_etnaviv_gem_cpu_fini {
120 __u32 handle; /* in */
121 __u32 flags; /* in, placeholder for now, no defined values */
122};
123
124/*
125 * Cmdstream Submission:
126 */
127
128/* The value written into the cmdstream is logically:
129 * relocbuf->gpuaddr + reloc_offset
130 *
131 * NOTE that reloc's must be sorted by order of increasing submit_offset,
132 * otherwise EINVAL.
133 */
134struct drm_etnaviv_gem_submit_reloc {
135 __u32 submit_offset; /* in, offset from submit_bo */
136 __u32 reloc_idx; /* in, index of reloc_bo buffer */
137 __u64 reloc_offset; /* in, offset from start of reloc_bo */
138 __u32 flags; /* in, placeholder for now, no defined values */
139};
140
141/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
142 * cmdstream buffer(s) themselves or reloc entries) has one (and only
143 * one) entry in the submit->bos[] table.
144 *
145 * As a optimization, the current buffer (gpu virtual address) can be
146 * passed back through the 'presumed' field. If on a subsequent reloc,
147 * userspace passes back a 'presumed' address that is still valid,
148 * then patching the cmdstream for this entry is skipped. This can
149 * avoid kernel needing to map/access the cmdstream bo in the common
150 * case.
151 */
152#define ETNA_SUBMIT_BO_READ 0x0001
153#define ETNA_SUBMIT_BO_WRITE 0x0002
154struct drm_etnaviv_gem_submit_bo {
155 __u32 flags; /* in, mask of ETNA_SUBMIT_BO_x */
156 __u32 handle; /* in, GEM handle */
157 __u64 presumed; /* in/out, presumed buffer address */
158};
159
160/* performance monitor request (pmr) */
161#define ETNA_PM_PROCESS_PRE 0x0001
162#define ETNA_PM_PROCESS_POST 0x0002
163struct drm_etnaviv_gem_submit_pmr {
164 __u32 flags; /* in, when to process request (ETNA_PM_PROCESS_x) */
165 __u8 domain; /* in, pm domain */
166 __u8 pad;
167 __u16 signal; /* in, pm signal */
168 __u32 sequence; /* in, sequence number */
169 __u32 read_offset; /* in, offset from read_bo */
170 __u32 read_idx; /* in, index of read_bo buffer */
171};
172
173/* Each cmdstream submit consists of a table of buffers involved, and
174 * one or more cmdstream buffers. This allows for conditional execution
175 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
176 */
177#define ETNA_SUBMIT_NO_IMPLICIT 0x0001
178#define ETNA_SUBMIT_FENCE_FD_IN 0x0002
179#define ETNA_SUBMIT_FENCE_FD_OUT 0x0004
180#define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | \
181 ETNA_SUBMIT_FENCE_FD_IN | \
182 ETNA_SUBMIT_FENCE_FD_OUT)
183#define ETNA_PIPE_3D 0x00
184#define ETNA_PIPE_2D 0x01
185#define ETNA_PIPE_VG 0x02
186struct drm_etnaviv_gem_submit {
187 __u32 fence; /* out */
188 __u32 pipe; /* in */
189 __u32 exec_state; /* in, initial execution state (ETNA_PIPE_x) */
190 __u32 nr_bos; /* in, number of submit_bo's */
191 __u32 nr_relocs; /* in, number of submit_reloc's */
192 __u32 stream_size; /* in, cmdstream size */
193 __u64 bos; /* in, ptr to array of submit_bo's */
194 __u64 relocs; /* in, ptr to array of submit_reloc's */
195 __u64 stream; /* in, ptr to cmdstream */
196 __u32 flags; /* in, mask of ETNA_SUBMIT_x */
197 __s32 fence_fd; /* in/out, fence fd (see ETNA_SUBMIT_FENCE_FD_x) */
198 __u64 pmrs; /* in, ptr to array of submit_pmr's */
199 __u32 nr_pmrs; /* in, number of submit_pmr's */
200 __u32 pad;
201};
202
203/* The normal way to synchronize with the GPU is just to CPU_PREP on
204 * a buffer if you need to access it from the CPU (other cmdstream
205 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
206 * handle the required synchronization under the hood). This ioctl
207 * mainly just exists as a way to implement the gallium pipe_fence
208 * APIs without requiring a dummy bo to synchronize on.
209 */
210#define ETNA_WAIT_NONBLOCK 0x01
211struct drm_etnaviv_wait_fence {
212 __u32 pipe; /* in */
213 __u32 fence; /* in */
214 __u32 flags; /* in, mask of ETNA_WAIT_x */
215 __u32 pad;
216 struct drm_etnaviv_timespec timeout; /* in */
217};
218
219#define ETNA_USERPTR_READ 0x01
220#define ETNA_USERPTR_WRITE 0x02
221struct drm_etnaviv_gem_userptr {
222 __u64 user_ptr; /* in, page aligned user pointer */
223 __u64 user_size; /* in, page aligned user size */
224 __u32 flags; /* in, flags */
225 __u32 handle; /* out, non-zero handle */
226};
227
228struct drm_etnaviv_gem_wait {
229 __u32 pipe; /* in */
230 __u32 handle; /* in, bo to be waited for */
231 __u32 flags; /* in, mask of ETNA_WAIT_x */
232 __u32 pad;
233 struct drm_etnaviv_timespec timeout; /* in */
234};
235
236/*
237 * Performance Monitor (PM):
238 */
239
240struct drm_etnaviv_pm_domain {
241 __u32 pipe; /* in */
242 __u8 iter; /* in/out, select pm domain at index iter */
243 __u8 id; /* out, id of domain */
244 __u16 nr_signals; /* out, how many signals does this domain provide */
245 char name[64]; /* out, name of domain */
246};
247
248struct drm_etnaviv_pm_signal {
249 __u32 pipe; /* in */
250 __u8 domain; /* in, pm domain index */
251 __u8 pad;
252 __u16 iter; /* in/out, select pm source at index iter */
253 __u16 id; /* out, id of signal */
254 char name[64]; /* out, name of domain */
255};
256
257#define DRM_ETNAVIV_GET_PARAM 0x00
258/* placeholder:
259#define DRM_ETNAVIV_SET_PARAM 0x01
260 */
261#define DRM_ETNAVIV_GEM_NEW 0x02
262#define DRM_ETNAVIV_GEM_INFO 0x03
263#define DRM_ETNAVIV_GEM_CPU_PREP 0x04
264#define DRM_ETNAVIV_GEM_CPU_FINI 0x05
265#define DRM_ETNAVIV_GEM_SUBMIT 0x06
266#define DRM_ETNAVIV_WAIT_FENCE 0x07
267#define DRM_ETNAVIV_GEM_USERPTR 0x08
268#define DRM_ETNAVIV_GEM_WAIT 0x09
269#define DRM_ETNAVIV_PM_QUERY_DOM 0x0a
270#define DRM_ETNAVIV_PM_QUERY_SIG 0x0b
271#define DRM_ETNAVIV_NUM_IOCTLS 0x0c
272
273#define DRM_IOCTL_ETNAVIV_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GET_PARAM, struct drm_etnaviv_param)
274#define DRM_IOCTL_ETNAVIV_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_NEW, struct drm_etnaviv_gem_new)
275#define DRM_IOCTL_ETNAVIV_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_INFO, struct drm_etnaviv_gem_info)
276#define DRM_IOCTL_ETNAVIV_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_PREP, struct drm_etnaviv_gem_cpu_prep)
277#define DRM_IOCTL_ETNAVIV_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_FINI, struct drm_etnaviv_gem_cpu_fini)
278#define DRM_IOCTL_ETNAVIV_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_SUBMIT, struct drm_etnaviv_gem_submit)
279#define DRM_IOCTL_ETNAVIV_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_WAIT_FENCE, struct drm_etnaviv_wait_fence)
280#define DRM_IOCTL_ETNAVIV_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_USERPTR, struct drm_etnaviv_gem_userptr)
281#define DRM_IOCTL_ETNAVIV_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_WAIT, struct drm_etnaviv_gem_wait)
282#define DRM_IOCTL_ETNAVIV_PM_QUERY_DOM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain)
283#define DRM_IOCTL_ETNAVIV_PM_QUERY_SIG DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal)
284
285#if defined(__cplusplus)
286}
287#endif
288
289#endif /* __ETNAVIV_DRM_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/exynos_drm.h deleted-424
...@@ -1,424 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* exynos_drm.h
3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * Authors:
6 * Inki Dae <inki.dae@samsung.com>
7 * Joonyoung Shim <jy0922.shim@samsung.com>
8 * Seung-Woo Kim <sw0312.kim@samsung.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifndef _EXYNOS_DRM_H_
17#define _EXYNOS_DRM_H_
18
19#include "drm.h"
20
21#if defined(__cplusplus)
22extern "C" {
23#endif
24
25/**
26 * User-desired buffer creation information structure.
27 *
28 * @size: user-desired memory allocation size.
29 * - this size value would be page-aligned internally.
30 * @flags: user request for setting memory type or cache attributes.
31 * @handle: returned a handle to created gem object.
32 * - this handle will be set by gem module of kernel side.
33 */
34struct drm_exynos_gem_create {
35 __u64 size;
36 __u32 flags;
37 __u32 handle;
38};
39
40/**
41 * A structure for getting a fake-offset that can be used with mmap.
42 *
43 * @handle: handle of gem object.
44 * @reserved: just padding to be 64-bit aligned.
45 * @offset: a fake-offset of gem object.
46 */
47struct drm_exynos_gem_map {
48 __u32 handle;
49 __u32 reserved;
50 __u64 offset;
51};
52
53/**
54 * A structure to gem information.
55 *
56 * @handle: a handle to gem object created.
57 * @flags: flag value including memory type and cache attribute and
58 * this value would be set by driver.
59 * @size: size to memory region allocated by gem and this size would
60 * be set by driver.
61 */
62struct drm_exynos_gem_info {
63 __u32 handle;
64 __u32 flags;
65 __u64 size;
66};
67
68/**
69 * A structure for user connection request of virtual display.
70 *
71 * @connection: indicate whether doing connetion or not by user.
72 * @extensions: if this value is 1 then the vidi driver would need additional
73 * 128bytes edid data.
74 * @edid: the edid data pointer from user side.
75 */
76struct drm_exynos_vidi_connection {
77 __u32 connection;
78 __u32 extensions;
79 __u64 edid;
80};
81
82/* memory type definitions. */
83enum e_drm_exynos_gem_mem_type {
84 /* Physically Continuous memory and used as default. */
85 EXYNOS_BO_CONTIG = 0 << 0,
86 /* Physically Non-Continuous memory. */
87 EXYNOS_BO_NONCONTIG = 1 << 0,
88 /* non-cachable mapping and used as default. */
89 EXYNOS_BO_NONCACHABLE = 0 << 1,
90 /* cachable mapping. */
91 EXYNOS_BO_CACHABLE = 1 << 1,
92 /* write-combine mapping. */
93 EXYNOS_BO_WC = 1 << 2,
94 EXYNOS_BO_MASK = EXYNOS_BO_NONCONTIG | EXYNOS_BO_CACHABLE |
95 EXYNOS_BO_WC
96};
97
98struct drm_exynos_g2d_get_ver {
99 __u32 major;
100 __u32 minor;
101};
102
103struct drm_exynos_g2d_cmd {
104 __u32 offset;
105 __u32 data;
106};
107
108enum drm_exynos_g2d_buf_type {
109 G2D_BUF_USERPTR = 1 << 31,
110};
111
112enum drm_exynos_g2d_event_type {
113 G2D_EVENT_NOT,
114 G2D_EVENT_NONSTOP,
115 G2D_EVENT_STOP, /* not yet */
116};
117
118struct drm_exynos_g2d_userptr {
119 unsigned long userptr;
120 unsigned long size;
121};
122
123struct drm_exynos_g2d_set_cmdlist {
124 __u64 cmd;
125 __u64 cmd_buf;
126 __u32 cmd_nr;
127 __u32 cmd_buf_nr;
128
129 /* for g2d event */
130 __u64 event_type;
131 __u64 user_data;
132};
133
134struct drm_exynos_g2d_exec {
135 __u64 async;
136};
137
138/* Exynos DRM IPP v2 API */
139
140/**
141 * Enumerate available IPP hardware modules.
142 *
143 * @count_ipps: size of ipp_id array / number of ipp modules (set by driver)
144 * @reserved: padding
145 * @ipp_id_ptr: pointer to ipp_id array or NULL
146 */
147struct drm_exynos_ioctl_ipp_get_res {
148 __u32 count_ipps;
149 __u32 reserved;
150 __u64 ipp_id_ptr;
151};
152
153enum drm_exynos_ipp_format_type {
154 DRM_EXYNOS_IPP_FORMAT_SOURCE = 0x01,
155 DRM_EXYNOS_IPP_FORMAT_DESTINATION = 0x02,
156};
157
158struct drm_exynos_ipp_format {
159 __u32 fourcc;
160 __u32 type;
161 __u64 modifier;
162};
163
164enum drm_exynos_ipp_capability {
165 DRM_EXYNOS_IPP_CAP_CROP = 0x01,
166 DRM_EXYNOS_IPP_CAP_ROTATE = 0x02,
167 DRM_EXYNOS_IPP_CAP_SCALE = 0x04,
168 DRM_EXYNOS_IPP_CAP_CONVERT = 0x08,
169};
170
171/**
172 * Get IPP hardware capabilities and supported image formats.
173 *
174 * @ipp_id: id of IPP module to query
175 * @capabilities: bitmask of drm_exynos_ipp_capability (set by driver)
176 * @reserved: padding
177 * @formats_count: size of formats array (in entries) / number of filled
178 * formats (set by driver)
179 * @formats_ptr: pointer to formats array or NULL
180 */
181struct drm_exynos_ioctl_ipp_get_caps {
182 __u32 ipp_id;
183 __u32 capabilities;
184 __u32 reserved;
185 __u32 formats_count;
186 __u64 formats_ptr;
187};
188
189enum drm_exynos_ipp_limit_type {
190 /* size (horizontal/vertial) limits, in pixels (min, max, alignment) */
191 DRM_EXYNOS_IPP_LIMIT_TYPE_SIZE = 0x0001,
192 /* scale ratio (horizonta/vertial), 16.16 fixed point (min, max) */
193 DRM_EXYNOS_IPP_LIMIT_TYPE_SCALE = 0x0002,
194
195 /* image buffer area */
196 DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER = 0x0001 << 16,
197 /* src/dst rectangle area */
198 DRM_EXYNOS_IPP_LIMIT_SIZE_AREA = 0x0002 << 16,
199 /* src/dst rectangle area when rotation enabled */
200 DRM_EXYNOS_IPP_LIMIT_SIZE_ROTATED = 0x0003 << 16,
201
202 DRM_EXYNOS_IPP_LIMIT_TYPE_MASK = 0x000f,
203 DRM_EXYNOS_IPP_LIMIT_SIZE_MASK = 0x000f << 16,
204};
205
206struct drm_exynos_ipp_limit_val {
207 __u32 min;
208 __u32 max;
209 __u32 align;
210 __u32 reserved;
211};
212
213/**
214 * IPP module limitation.
215 *
216 * @type: limit type (see drm_exynos_ipp_limit_type enum)
217 * @reserved: padding
218 * @h: horizontal limits
219 * @v: vertical limits
220 */
221struct drm_exynos_ipp_limit {
222 __u32 type;
223 __u32 reserved;
224 struct drm_exynos_ipp_limit_val h;
225 struct drm_exynos_ipp_limit_val v;
226};
227
228/**
229 * Get IPP limits for given image format.
230 *
231 * @ipp_id: id of IPP module to query
232 * @fourcc: image format code (see DRM_FORMAT_* in drm_fourcc.h)
233 * @modifier: image format modifier (see DRM_FORMAT_MOD_* in drm_fourcc.h)
234 * @type: source/destination identifier (drm_exynos_ipp_format_flag enum)
235 * @limits_count: size of limits array (in entries) / number of filled entries
236 * (set by driver)
237 * @limits_ptr: pointer to limits array or NULL
238 */
239struct drm_exynos_ioctl_ipp_get_limits {
240 __u32 ipp_id;
241 __u32 fourcc;
242 __u64 modifier;
243 __u32 type;
244 __u32 limits_count;
245 __u64 limits_ptr;
246};
247
248enum drm_exynos_ipp_task_id {
249 /* buffer described by struct drm_exynos_ipp_task_buffer */
250 DRM_EXYNOS_IPP_TASK_BUFFER = 0x0001,
251 /* rectangle described by struct drm_exynos_ipp_task_rect */
252 DRM_EXYNOS_IPP_TASK_RECTANGLE = 0x0002,
253 /* transformation described by struct drm_exynos_ipp_task_transform */
254 DRM_EXYNOS_IPP_TASK_TRANSFORM = 0x0003,
255 /* alpha configuration described by struct drm_exynos_ipp_task_alpha */
256 DRM_EXYNOS_IPP_TASK_ALPHA = 0x0004,
257
258 /* source image data (for buffer and rectangle chunks) */
259 DRM_EXYNOS_IPP_TASK_TYPE_SOURCE = 0x0001 << 16,
260 /* destination image data (for buffer and rectangle chunks) */
261 DRM_EXYNOS_IPP_TASK_TYPE_DESTINATION = 0x0002 << 16,
262};
263
264/**
265 * Memory buffer with image data.
266 *
267 * @id: must be DRM_EXYNOS_IPP_TASK_BUFFER
268 * other parameters are same as for AddFB2 generic DRM ioctl
269 */
270struct drm_exynos_ipp_task_buffer {
271 __u32 id;
272 __u32 fourcc;
273 __u32 width, height;
274 __u32 gem_id[4];
275 __u32 offset[4];
276 __u32 pitch[4];
277 __u64 modifier;
278};
279
280/**
281 * Rectangle for processing.
282 *
283 * @id: must be DRM_EXYNOS_IPP_TASK_RECTANGLE
284 * @reserved: padding
285 * @x,@y: left corner in pixels
286 * @w,@h: width/height in pixels
287 */
288struct drm_exynos_ipp_task_rect {
289 __u32 id;
290 __u32 reserved;
291 __u32 x;
292 __u32 y;
293 __u32 w;
294 __u32 h;
295};
296
297/**
298 * Image tranformation description.
299 *
300 * @id: must be DRM_EXYNOS_IPP_TASK_TRANSFORM
301 * @rotation: DRM_MODE_ROTATE_* and DRM_MODE_REFLECT_* values
302 */
303struct drm_exynos_ipp_task_transform {
304 __u32 id;
305 __u32 rotation;
306};
307
308/**
309 * Image global alpha configuration for formats without alpha values.
310 *
311 * @id: must be DRM_EXYNOS_IPP_TASK_ALPHA
312 * @value: global alpha value (0-255)
313 */
314struct drm_exynos_ipp_task_alpha {
315 __u32 id;
316 __u32 value;
317};
318
319enum drm_exynos_ipp_flag {
320 /* generate DRM event after processing */
321 DRM_EXYNOS_IPP_FLAG_EVENT = 0x01,
322 /* dry run, only check task parameters */
323 DRM_EXYNOS_IPP_FLAG_TEST_ONLY = 0x02,
324 /* non-blocking processing */
325 DRM_EXYNOS_IPP_FLAG_NONBLOCK = 0x04,
326};
327
328#define DRM_EXYNOS_IPP_FLAGS (DRM_EXYNOS_IPP_FLAG_EVENT |\
329 DRM_EXYNOS_IPP_FLAG_TEST_ONLY | DRM_EXYNOS_IPP_FLAG_NONBLOCK)
330
331/**
332 * Perform image processing described by array of drm_exynos_ipp_task_*
333 * structures (parameters array).
334 *
335 * @ipp_id: id of IPP module to run the task
336 * @flags: bitmask of drm_exynos_ipp_flag values
337 * @reserved: padding
338 * @params_size: size of parameters array (in bytes)
339 * @params_ptr: pointer to parameters array or NULL
340 * @user_data: (optional) data for drm event
341 */
342struct drm_exynos_ioctl_ipp_commit {
343 __u32 ipp_id;
344 __u32 flags;
345 __u32 reserved;
346 __u32 params_size;
347 __u64 params_ptr;
348 __u64 user_data;
349};
350
351#define DRM_EXYNOS_GEM_CREATE 0x00
352#define DRM_EXYNOS_GEM_MAP 0x01
353/* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */
354#define DRM_EXYNOS_GEM_GET 0x04
355#define DRM_EXYNOS_VIDI_CONNECTION 0x07
356
357/* G2D */
358#define DRM_EXYNOS_G2D_GET_VER 0x20
359#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
360#define DRM_EXYNOS_G2D_EXEC 0x22
361
362/* Reserved 0x30 ~ 0x33 for obsolete Exynos IPP ioctls */
363/* IPP - Image Post Processing */
364#define DRM_EXYNOS_IPP_GET_RESOURCES 0x40
365#define DRM_EXYNOS_IPP_GET_CAPS 0x41
366#define DRM_EXYNOS_IPP_GET_LIMITS 0x42
367#define DRM_EXYNOS_IPP_COMMIT 0x43
368
369#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
370 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
371#define DRM_IOCTL_EXYNOS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
372 DRM_EXYNOS_GEM_MAP, struct drm_exynos_gem_map)
373#define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
374 DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
375
376#define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
377 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
378
379#define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
380 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
381#define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
382 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
383#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
384 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
385
386#define DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES DRM_IOWR(DRM_COMMAND_BASE + \
387 DRM_EXYNOS_IPP_GET_RESOURCES, \
388 struct drm_exynos_ioctl_ipp_get_res)
389#define DRM_IOCTL_EXYNOS_IPP_GET_CAPS DRM_IOWR(DRM_COMMAND_BASE + \
390 DRM_EXYNOS_IPP_GET_CAPS, struct drm_exynos_ioctl_ipp_get_caps)
391#define DRM_IOCTL_EXYNOS_IPP_GET_LIMITS DRM_IOWR(DRM_COMMAND_BASE + \
392 DRM_EXYNOS_IPP_GET_LIMITS, \
393 struct drm_exynos_ioctl_ipp_get_limits)
394#define DRM_IOCTL_EXYNOS_IPP_COMMIT DRM_IOWR(DRM_COMMAND_BASE + \
395 DRM_EXYNOS_IPP_COMMIT, struct drm_exynos_ioctl_ipp_commit)
396
397/* EXYNOS specific events */
398#define DRM_EXYNOS_G2D_EVENT 0x80000000
399#define DRM_EXYNOS_IPP_EVENT 0x80000002
400
401struct drm_exynos_g2d_event {
402 struct drm_event base;
403 __u64 user_data;
404 __u32 tv_sec;
405 __u32 tv_usec;
406 __u32 cmdlist_no;
407 __u32 reserved;
408};
409
410struct drm_exynos_ipp_event {
411 struct drm_event base;
412 __u64 user_data;
413 __u32 tv_sec;
414 __u32 tv_usec;
415 __u32 ipp_id;
416 __u32 sequence;
417 __u64 reserved;
418};
419
420#if defined(__cplusplus)
421}
422#endif
423
424#endif /* _EXYNOS_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/i810_drm.h deleted-292
...@@ -1,292 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _I810_DRM_H_
3#define _I810_DRM_H_
4
5#include "drm.h"
6
7#if defined(__cplusplus)
8extern "C" {
9#endif
10
11/* WARNING: These defines must be the same as what the Xserver uses.
12 * if you change them, you must change the defines in the Xserver.
13 */
14
15#ifndef _I810_DEFINES_
16#define _I810_DEFINES_
17
18#define I810_DMA_BUF_ORDER 12
19#define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
20#define I810_DMA_BUF_NR 256
21#define I810_NR_SAREA_CLIPRECTS 8
22
23/* Each region is a minimum of 64k, and there are at most 64 of them.
24 */
25#define I810_NR_TEX_REGIONS 64
26#define I810_LOG_MIN_TEX_REGION_SIZE 16
27#endif
28
29#define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
30#define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
31#define I810_UPLOAD_CTX 0x4
32#define I810_UPLOAD_BUFFERS 0x8
33#define I810_UPLOAD_TEX0 0x10
34#define I810_UPLOAD_TEX1 0x20
35#define I810_UPLOAD_CLIPRECTS 0x40
36
37/* Indices into buf.Setup where various bits of state are mirrored per
38 * context and per buffer. These can be fired at the card as a unit,
39 * or in a piecewise fashion as required.
40 */
41
42/* Destbuffer state
43 * - backbuffer linear offset and pitch -- invarient in the current dri
44 * - zbuffer linear offset and pitch -- also invarient
45 * - drawing origin in back and depth buffers.
46 *
47 * Keep the depth/back buffer state here to accommodate private buffers
48 * in the future.
49 */
50#define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
51#define I810_DESTREG_DI1 1
52#define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
53#define I810_DESTREG_DV1 3
54#define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */
55#define I810_DESTREG_DR1 5
56#define I810_DESTREG_DR2 6
57#define I810_DESTREG_DR3 7
58#define I810_DESTREG_DR4 8
59#define I810_DEST_SETUP_SIZE 10
60
61/* Context state
62 */
63#define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */
64#define I810_CTXREG_CF1 1
65#define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */
66#define I810_CTXREG_ST1 3
67#define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */
68#define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */
69#define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
70#define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
71#define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
72#define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
73#define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
74#define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
75#define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */
76#define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */
77#define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */
78#define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */
79#define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
80#define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */
81#define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */
82#define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */
83#define I810_CTX_SETUP_SIZE 20
84
85/* Texture state (per tex unit)
86 */
87#define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */
88#define I810_TEXREG_MI1 1
89#define I810_TEXREG_MI2 2
90#define I810_TEXREG_MI3 3
91#define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */
92#define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */
93#define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */
94#define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */
95#define I810_TEX_SETUP_SIZE 8
96
97/* Flags for clear ioctl
98 */
99#define I810_FRONT 0x1
100#define I810_BACK 0x2
101#define I810_DEPTH 0x4
102
103typedef enum _drm_i810_init_func {
104 I810_INIT_DMA = 0x01,
105 I810_CLEANUP_DMA = 0x02,
106 I810_INIT_DMA_1_4 = 0x03
107} drm_i810_init_func_t;
108
109/* This is the init structure after v1.2 */
110typedef struct _drm_i810_init {
111 drm_i810_init_func_t func;
112 unsigned int mmio_offset;
113 unsigned int buffers_offset;
114 int sarea_priv_offset;
115 unsigned int ring_start;
116 unsigned int ring_end;
117 unsigned int ring_size;
118 unsigned int front_offset;
119 unsigned int back_offset;
120 unsigned int depth_offset;
121 unsigned int overlay_offset;
122 unsigned int overlay_physical;
123 unsigned int w;
124 unsigned int h;
125 unsigned int pitch;
126 unsigned int pitch_bits;
127} drm_i810_init_t;
128
129/* This is the init structure prior to v1.2 */
130typedef struct _drm_i810_pre12_init {
131 drm_i810_init_func_t func;
132 unsigned int mmio_offset;
133 unsigned int buffers_offset;
134 int sarea_priv_offset;
135 unsigned int ring_start;
136 unsigned int ring_end;
137 unsigned int ring_size;
138 unsigned int front_offset;
139 unsigned int back_offset;
140 unsigned int depth_offset;
141 unsigned int w;
142 unsigned int h;
143 unsigned int pitch;
144 unsigned int pitch_bits;
145} drm_i810_pre12_init_t;
146
147/* Warning: If you change the SAREA structure you must change the Xserver
148 * structure as well */
149
150typedef struct _drm_i810_tex_region {
151 unsigned char next, prev; /* indices to form a circular LRU */
152 unsigned char in_use; /* owned by a client, or free? */
153 int age; /* tracked by clients to update local LRU's */
154} drm_i810_tex_region_t;
155
156typedef struct _drm_i810_sarea {
157 unsigned int ContextState[I810_CTX_SETUP_SIZE];
158 unsigned int BufferState[I810_DEST_SETUP_SIZE];
159 unsigned int TexState[2][I810_TEX_SETUP_SIZE];
160 unsigned int dirty;
161
162 unsigned int nbox;
163 struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
164
165 /* Maintain an LRU of contiguous regions of texture space. If
166 * you think you own a region of texture memory, and it has an
167 * age different to the one you set, then you are mistaken and
168 * it has been stolen by another client. If global texAge
169 * hasn't changed, there is no need to walk the list.
170 *
171 * These regions can be used as a proxy for the fine-grained
172 * texture information of other clients - by maintaining them
173 * in the same lru which is used to age their own textures,
174 * clients have an approximate lru for the whole of global
175 * texture space, and can make informed decisions as to which
176 * areas to kick out. There is no need to choose whether to
177 * kick out your own texture or someone else's - simply eject
178 * them all in LRU order.
179 */
180
181 drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1];
182 /* Last elt is sentinal */
183 int texAge; /* last time texture was uploaded */
184 int last_enqueue; /* last time a buffer was enqueued */
185 int last_dispatch; /* age of the most recently dispatched buffer */
186 int last_quiescent; /* */
187 int ctxOwner; /* last context to upload state */
188
189 int vertex_prim;
190
191 int pf_enabled; /* is pageflipping allowed? */
192 int pf_active;
193 int pf_current_page; /* which buffer is being displayed? */
194} drm_i810_sarea_t;
195
196/* WARNING: If you change any of these defines, make sure to change the
197 * defines in the Xserver file (xf86drmMga.h)
198 */
199
200/* i810 specific ioctls
201 * The device specific ioctl range is 0x40 to 0x79.
202 */
203#define DRM_I810_INIT 0x00
204#define DRM_I810_VERTEX 0x01
205#define DRM_I810_CLEAR 0x02
206#define DRM_I810_FLUSH 0x03
207#define DRM_I810_GETAGE 0x04
208#define DRM_I810_GETBUF 0x05
209#define DRM_I810_SWAP 0x06
210#define DRM_I810_COPY 0x07
211#define DRM_I810_DOCOPY 0x08
212#define DRM_I810_OV0INFO 0x09
213#define DRM_I810_FSTATUS 0x0a
214#define DRM_I810_OV0FLIP 0x0b
215#define DRM_I810_MC 0x0c
216#define DRM_I810_RSTATUS 0x0d
217#define DRM_I810_FLIP 0x0e
218
219#define DRM_IOCTL_I810_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t)
220#define DRM_IOCTL_I810_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t)
221#define DRM_IOCTL_I810_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t)
222#define DRM_IOCTL_I810_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_I810_FLUSH)
223#define DRM_IOCTL_I810_GETAGE DRM_IO( DRM_COMMAND_BASE + DRM_I810_GETAGE)
224#define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t)
225#define DRM_IOCTL_I810_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_I810_SWAP)
226#define DRM_IOCTL_I810_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t)
227#define DRM_IOCTL_I810_DOCOPY DRM_IO( DRM_COMMAND_BASE + DRM_I810_DOCOPY)
228#define DRM_IOCTL_I810_OV0INFO DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t)
229#define DRM_IOCTL_I810_FSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS)
230#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP)
231#define DRM_IOCTL_I810_MC DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t)
232#define DRM_IOCTL_I810_RSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS)
233#define DRM_IOCTL_I810_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP)
234
235typedef struct _drm_i810_clear {
236 int clear_color;
237 int clear_depth;
238 int flags;
239} drm_i810_clear_t;
240
241/* These may be placeholders if we have more cliprects than
242 * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
243 * false, indicating that the buffer will be dispatched again with a
244 * new set of cliprects.
245 */
246typedef struct _drm_i810_vertex {
247 int idx; /* buffer index */
248 int used; /* nr bytes in use */
249 int discard; /* client is finished with the buffer? */
250} drm_i810_vertex_t;
251
252typedef struct _drm_i810_copy_t {
253 int idx; /* buffer index */
254 int used; /* nr bytes in use */
255 void *address; /* Address to copy from */
256} drm_i810_copy_t;
257
258#define PR_TRIANGLES (0x0<<18)
259#define PR_TRISTRIP_0 (0x1<<18)
260#define PR_TRISTRIP_1 (0x2<<18)
261#define PR_TRIFAN (0x3<<18)
262#define PR_POLYGON (0x4<<18)
263#define PR_LINES (0x5<<18)
264#define PR_LINESTRIP (0x6<<18)
265#define PR_RECTS (0x7<<18)
266#define PR_MASK (0x7<<18)
267
268typedef struct drm_i810_dma {
269 void *virtual;
270 int request_idx;
271 int request_size;
272 int granted;
273} drm_i810_dma_t;
274
275typedef struct _drm_i810_overlay_t {
276 unsigned int offset; /* Address of the Overlay Regs */
277 unsigned int physical;
278} drm_i810_overlay_t;
279
280typedef struct _drm_i810_mc {
281 int idx; /* buffer index */
282 int used; /* nr bytes in use */
283 int num_blocks; /* number of GFXBlocks */
284 int *length; /* List of lengths for GFXBlocks (FUTURE) */
285 unsigned int last_render; /* Last Render Request */
286} drm_i810_mc_t;
287
288#if defined(__cplusplus)
289}
290#endif
291
292#endif /* _I810_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/i915_drm.h deleted-1724
...@@ -1,1724 +0,0 @@
1/*
2 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
27#ifndef _I915_DRM_H_
28#define _I915_DRM_H_
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* Please note that modifications to all structs defined here are
37 * subject to backwards-compatibility constraints.
38 */
39
40/**
41 * DOC: uevents generated by i915 on it's device node
42 *
43 * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch
44 * event from the gpu l3 cache. Additional information supplied is ROW,
45 * BANK, SUBBANK, SLICE of the affected cacheline. Userspace should keep
46 * track of these events and if a specific cache-line seems to have a
47 * persistent error remap it with the l3 remapping tool supplied in
48 * intel-gpu-tools. The value supplied with the event is always 1.
49 *
50 * I915_ERROR_UEVENT - Generated upon error detection, currently only via
51 * hangcheck. The error detection event is a good indicator of when things
52 * began to go badly. The value supplied with the event is a 1 upon error
53 * detection, and a 0 upon reset completion, signifying no more error
54 * exists. NOTE: Disabling hangcheck or reset via module parameter will
55 * cause the related events to not be seen.
56 *
57 * I915_RESET_UEVENT - Event is generated just before an attempt to reset the
58 * the GPU. The value supplied with the event is always 1. NOTE: Disable
59 * reset via module parameter will cause this event to not be seen.
60 */
61#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
62#define I915_ERROR_UEVENT "ERROR"
63#define I915_RESET_UEVENT "RESET"
64
65/*
66 * MOCS indexes used for GPU surfaces, defining the cacheability of the
67 * surface data and the coherency for this data wrt. CPU vs. GPU accesses.
68 */
69enum i915_mocs_table_index {
70 /*
71 * Not cached anywhere, coherency between CPU and GPU accesses is
72 * guaranteed.
73 */
74 I915_MOCS_UNCACHED,
75 /*
76 * Cacheability and coherency controlled by the kernel automatically
77 * based on the DRM_I915_GEM_SET_CACHING IOCTL setting and the current
78 * usage of the surface (used for display scanout or not).
79 */
80 I915_MOCS_PTE,
81 /*
82 * Cached in all GPU caches available on the platform.
83 * Coherency between CPU and GPU accesses to the surface is not
84 * guaranteed without extra synchronization.
85 */
86 I915_MOCS_CACHED,
87};
88
89/*
90 * Different engines serve different roles, and there may be more than one
91 * engine serving each role. enum drm_i915_gem_engine_class provides a
92 * classification of the role of the engine, which may be used when requesting
93 * operations to be performed on a certain subset of engines, or for providing
94 * information about that group.
95 */
96enum drm_i915_gem_engine_class {
97 I915_ENGINE_CLASS_RENDER = 0,
98 I915_ENGINE_CLASS_COPY = 1,
99 I915_ENGINE_CLASS_VIDEO = 2,
100 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
101
102 I915_ENGINE_CLASS_INVALID = -1
103};
104
105/**
106 * DOC: perf_events exposed by i915 through /sys/bus/event_sources/drivers/i915
107 *
108 */
109
110enum drm_i915_pmu_engine_sample {
111 I915_SAMPLE_BUSY = 0,
112 I915_SAMPLE_WAIT = 1,
113 I915_SAMPLE_SEMA = 2
114};
115
116#define I915_PMU_SAMPLE_BITS (4)
117#define I915_PMU_SAMPLE_MASK (0xf)
118#define I915_PMU_SAMPLE_INSTANCE_BITS (8)
119#define I915_PMU_CLASS_SHIFT \
120 (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS)
121
122#define __I915_PMU_ENGINE(class, instance, sample) \
123 ((class) << I915_PMU_CLASS_SHIFT | \
124 (instance) << I915_PMU_SAMPLE_BITS | \
125 (sample))
126
127#define I915_PMU_ENGINE_BUSY(class, instance) \
128 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
129
130#define I915_PMU_ENGINE_WAIT(class, instance) \
131 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
132
133#define I915_PMU_ENGINE_SEMA(class, instance) \
134 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
135
136#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
137
138#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
139#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
140#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
141#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
142
143#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
144
145/* Each region is a minimum of 16k, and there are at most 255 of them.
146 */
147#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
148 * of chars for next/prev indices */
149#define I915_LOG_MIN_TEX_REGION_SIZE 14
150
151typedef struct _drm_i915_init {
152 enum {
153 I915_INIT_DMA = 0x01,
154 I915_CLEANUP_DMA = 0x02,
155 I915_RESUME_DMA = 0x03
156 } func;
157 unsigned int mmio_offset;
158 int sarea_priv_offset;
159 unsigned int ring_start;
160 unsigned int ring_end;
161 unsigned int ring_size;
162 unsigned int front_offset;
163 unsigned int back_offset;
164 unsigned int depth_offset;
165 unsigned int w;
166 unsigned int h;
167 unsigned int pitch;
168 unsigned int pitch_bits;
169 unsigned int back_pitch;
170 unsigned int depth_pitch;
171 unsigned int cpp;
172 unsigned int chipset;
173} drm_i915_init_t;
174
175typedef struct _drm_i915_sarea {
176 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
177 int last_upload; /* last time texture was uploaded */
178 int last_enqueue; /* last time a buffer was enqueued */
179 int last_dispatch; /* age of the most recently dispatched buffer */
180 int ctxOwner; /* last context to upload state */
181 int texAge;
182 int pf_enabled; /* is pageflipping allowed? */
183 int pf_active;
184 int pf_current_page; /* which buffer is being displayed? */
185 int perf_boxes; /* performance boxes to be displayed */
186 int width, height; /* screen size in pixels */
187
188 drm_handle_t front_handle;
189 int front_offset;
190 int front_size;
191
192 drm_handle_t back_handle;
193 int back_offset;
194 int back_size;
195
196 drm_handle_t depth_handle;
197 int depth_offset;
198 int depth_size;
199
200 drm_handle_t tex_handle;
201 int tex_offset;
202 int tex_size;
203 int log_tex_granularity;
204 int pitch;
205 int rotation; /* 0, 90, 180 or 270 */
206 int rotated_offset;
207 int rotated_size;
208 int rotated_pitch;
209 int virtualX, virtualY;
210
211 unsigned int front_tiled;
212 unsigned int back_tiled;
213 unsigned int depth_tiled;
214 unsigned int rotated_tiled;
215 unsigned int rotated2_tiled;
216
217 int pipeA_x;
218 int pipeA_y;
219 int pipeA_w;
220 int pipeA_h;
221 int pipeB_x;
222 int pipeB_y;
223 int pipeB_w;
224 int pipeB_h;
225
226 /* fill out some space for old userspace triple buffer */
227 drm_handle_t unused_handle;
228 __u32 unused1, unused2, unused3;
229
230 /* buffer object handles for static buffers. May change
231 * over the lifetime of the client.
232 */
233 __u32 front_bo_handle;
234 __u32 back_bo_handle;
235 __u32 unused_bo_handle;
236 __u32 depth_bo_handle;
237
238} drm_i915_sarea_t;
239
240/* due to userspace building against these headers we need some compat here */
241#define planeA_x pipeA_x
242#define planeA_y pipeA_y
243#define planeA_w pipeA_w
244#define planeA_h pipeA_h
245#define planeB_x pipeB_x
246#define planeB_y pipeB_y
247#define planeB_w pipeB_w
248#define planeB_h pipeB_h
249
250/* Flags for perf_boxes
251 */
252#define I915_BOX_RING_EMPTY 0x1
253#define I915_BOX_FLIP 0x2
254#define I915_BOX_WAIT 0x4
255#define I915_BOX_TEXTURE_LOAD 0x8
256#define I915_BOX_LOST_CONTEXT 0x10
257
258/*
259 * i915 specific ioctls.
260 *
261 * The device specific ioctl range is [DRM_COMMAND_BASE, DRM_COMMAND_END) ie
262 * [0x40, 0xa0) (a0 is excluded). The numbers below are defined as offset
263 * against DRM_COMMAND_BASE and should be between [0x0, 0x60).
264 */
265#define DRM_I915_INIT 0x00
266#define DRM_I915_FLUSH 0x01
267#define DRM_I915_FLIP 0x02
268#define DRM_I915_BATCHBUFFER 0x03
269#define DRM_I915_IRQ_EMIT 0x04
270#define DRM_I915_IRQ_WAIT 0x05
271#define DRM_I915_GETPARAM 0x06
272#define DRM_I915_SETPARAM 0x07
273#define DRM_I915_ALLOC 0x08
274#define DRM_I915_FREE 0x09
275#define DRM_I915_INIT_HEAP 0x0a
276#define DRM_I915_CMDBUFFER 0x0b
277#define DRM_I915_DESTROY_HEAP 0x0c
278#define DRM_I915_SET_VBLANK_PIPE 0x0d
279#define DRM_I915_GET_VBLANK_PIPE 0x0e
280#define DRM_I915_VBLANK_SWAP 0x0f
281#define DRM_I915_HWS_ADDR 0x11
282#define DRM_I915_GEM_INIT 0x13
283#define DRM_I915_GEM_EXECBUFFER 0x14
284#define DRM_I915_GEM_PIN 0x15
285#define DRM_I915_GEM_UNPIN 0x16
286#define DRM_I915_GEM_BUSY 0x17
287#define DRM_I915_GEM_THROTTLE 0x18
288#define DRM_I915_GEM_ENTERVT 0x19
289#define DRM_I915_GEM_LEAVEVT 0x1a
290#define DRM_I915_GEM_CREATE 0x1b
291#define DRM_I915_GEM_PREAD 0x1c
292#define DRM_I915_GEM_PWRITE 0x1d
293#define DRM_I915_GEM_MMAP 0x1e
294#define DRM_I915_GEM_SET_DOMAIN 0x1f
295#define DRM_I915_GEM_SW_FINISH 0x20
296#define DRM_I915_GEM_SET_TILING 0x21
297#define DRM_I915_GEM_GET_TILING 0x22
298#define DRM_I915_GEM_GET_APERTURE 0x23
299#define DRM_I915_GEM_MMAP_GTT 0x24
300#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
301#define DRM_I915_GEM_MADVISE 0x26
302#define DRM_I915_OVERLAY_PUT_IMAGE 0x27
303#define DRM_I915_OVERLAY_ATTRS 0x28
304#define DRM_I915_GEM_EXECBUFFER2 0x29
305#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
306#define DRM_I915_GET_SPRITE_COLORKEY 0x2a
307#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
308#define DRM_I915_GEM_WAIT 0x2c
309#define DRM_I915_GEM_CONTEXT_CREATE 0x2d
310#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
311#define DRM_I915_GEM_SET_CACHING 0x2f
312#define DRM_I915_GEM_GET_CACHING 0x30
313#define DRM_I915_REG_READ 0x31
314#define DRM_I915_GET_RESET_STATS 0x32
315#define DRM_I915_GEM_USERPTR 0x33
316#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
317#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
318#define DRM_I915_PERF_OPEN 0x36
319#define DRM_I915_PERF_ADD_CONFIG 0x37
320#define DRM_I915_PERF_REMOVE_CONFIG 0x38
321#define DRM_I915_QUERY 0x39
322
323#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
324#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
325#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP)
326#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
327#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
328#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
329#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
330#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
331#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
332#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
333#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
334#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
335#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
336#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
337#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
338#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
339#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
340#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
341#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
342#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
343#define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2)
344#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
345#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
346#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
347#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
348#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
349#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
350#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
351#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
352#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
353#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
354#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
355#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
356#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
357#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
358#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
359#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
360#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
361#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
362#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id)
363#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
364#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
365#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
366#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
367#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
368#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
369#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
370#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
371#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
372#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
373#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
374#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
375#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
376#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
377#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
378#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
379#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
380
381/* Allow drivers to submit batchbuffers directly to hardware, relying
382 * on the security mechanisms provided by hardware.
383 */
384typedef struct drm_i915_batchbuffer {
385 int start; /* agp offset */
386 int used; /* nr bytes in use */
387 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
388 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
389 int num_cliprects; /* mulitpass with multiple cliprects? */
390 struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
391} drm_i915_batchbuffer_t;
392
393/* As above, but pass a pointer to userspace buffer which can be
394 * validated by the kernel prior to sending to hardware.
395 */
396typedef struct _drm_i915_cmdbuffer {
397 char *buf; /* pointer to userspace command buffer */
398 int sz; /* nr bytes in buf */
399 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
400 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
401 int num_cliprects; /* mulitpass with multiple cliprects? */
402 struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
403} drm_i915_cmdbuffer_t;
404
405/* Userspace can request & wait on irq's:
406 */
407typedef struct drm_i915_irq_emit {
408 int *irq_seq;
409} drm_i915_irq_emit_t;
410
411typedef struct drm_i915_irq_wait {
412 int irq_seq;
413} drm_i915_irq_wait_t;
414
415/* Ioctl to query kernel params:
416 */
417#define I915_PARAM_IRQ_ACTIVE 1
418#define I915_PARAM_ALLOW_BATCHBUFFER 2
419#define I915_PARAM_LAST_DISPATCH 3
420#define I915_PARAM_CHIPSET_ID 4
421#define I915_PARAM_HAS_GEM 5
422#define I915_PARAM_NUM_FENCES_AVAIL 6
423#define I915_PARAM_HAS_OVERLAY 7
424#define I915_PARAM_HAS_PAGEFLIPPING 8
425#define I915_PARAM_HAS_EXECBUF2 9
426#define I915_PARAM_HAS_BSD 10
427#define I915_PARAM_HAS_BLT 11
428#define I915_PARAM_HAS_RELAXED_FENCING 12
429#define I915_PARAM_HAS_COHERENT_RINGS 13
430#define I915_PARAM_HAS_EXEC_CONSTANTS 14
431#define I915_PARAM_HAS_RELAXED_DELTA 15
432#define I915_PARAM_HAS_GEN7_SOL_RESET 16
433#define I915_PARAM_HAS_LLC 17
434#define I915_PARAM_HAS_ALIASING_PPGTT 18
435#define I915_PARAM_HAS_WAIT_TIMEOUT 19
436#define I915_PARAM_HAS_SEMAPHORES 20
437#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
438#define I915_PARAM_HAS_VEBOX 22
439#define I915_PARAM_HAS_SECURE_BATCHES 23
440#define I915_PARAM_HAS_PINNED_BATCHES 24
441#define I915_PARAM_HAS_EXEC_NO_RELOC 25
442#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
443#define I915_PARAM_HAS_WT 27
444#define I915_PARAM_CMD_PARSER_VERSION 28
445#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
446#define I915_PARAM_MMAP_VERSION 30
447#define I915_PARAM_HAS_BSD2 31
448#define I915_PARAM_REVISION 32
449#define I915_PARAM_SUBSLICE_TOTAL 33
450#define I915_PARAM_EU_TOTAL 34
451#define I915_PARAM_HAS_GPU_RESET 35
452#define I915_PARAM_HAS_RESOURCE_STREAMER 36
453#define I915_PARAM_HAS_EXEC_SOFTPIN 37
454#define I915_PARAM_HAS_POOLED_EU 38
455#define I915_PARAM_MIN_EU_IN_POOL 39
456#define I915_PARAM_MMAP_GTT_VERSION 40
457
458/*
459 * Query whether DRM_I915_GEM_EXECBUFFER2 supports user defined execution
460 * priorities and the driver will attempt to execute batches in priority order.
461 * The param returns a capability bitmask, nonzero implies that the scheduler
462 * is enabled, with different features present according to the mask.
463 *
464 * The initial priority for each batch is supplied by the context and is
465 * controlled via I915_CONTEXT_PARAM_PRIORITY.
466 */
467#define I915_PARAM_HAS_SCHEDULER 41
468#define I915_SCHEDULER_CAP_ENABLED (1ul << 0)
469#define I915_SCHEDULER_CAP_PRIORITY (1ul << 1)
470#define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2)
471
472#define I915_PARAM_HUC_STATUS 42
473
474/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to opt-out of
475 * synchronisation with implicit fencing on individual objects.
476 * See EXEC_OBJECT_ASYNC.
477 */
478#define I915_PARAM_HAS_EXEC_ASYNC 43
479
480/* Query whether DRM_I915_GEM_EXECBUFFER2 supports explicit fence support -
481 * both being able to pass in a sync_file fd to wait upon before executing,
482 * and being able to return a new sync_file fd that is signaled when the
483 * current request is complete. See I915_EXEC_FENCE_IN and I915_EXEC_FENCE_OUT.
484 */
485#define I915_PARAM_HAS_EXEC_FENCE 44
486
487/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to capture
488 * user specified bufffers for post-mortem debugging of GPU hangs. See
489 * EXEC_OBJECT_CAPTURE.
490 */
491#define I915_PARAM_HAS_EXEC_CAPTURE 45
492
493#define I915_PARAM_SLICE_MASK 46
494
495/* Assuming it's uniform for each slice, this queries the mask of subslices
496 * per-slice for this system.
497 */
498#define I915_PARAM_SUBSLICE_MASK 47
499
500/*
501 * Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying the batch buffer
502 * as the first execobject as opposed to the last. See I915_EXEC_BATCH_FIRST.
503 */
504#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
505
506/* Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying an array of
507 * drm_i915_gem_exec_fence structures. See I915_EXEC_FENCE_ARRAY.
508 */
509#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
510
511/*
512 * Query whether every context (both per-file default and user created) is
513 * isolated (insofar as HW supports). If this parameter is not true, then
514 * freshly created contexts may inherit values from an existing context,
515 * rather than default HW values. If true, it also ensures (insofar as HW
516 * supports) that all state set by this context will not leak to any other
517 * context.
518 *
519 * As not every engine across every gen support contexts, the returned
520 * value reports the support of context isolation for individual engines by
521 * returning a bitmask of each engine class set to true if that class supports
522 * isolation.
523 */
524#define I915_PARAM_HAS_CONTEXT_ISOLATION 50
525
526/* Frequency of the command streamer timestamps given by the *_TIMESTAMP
527 * registers. This used to be fixed per platform but from CNL onwards, this
528 * might vary depending on the parts.
529 */
530#define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
531
532typedef struct drm_i915_getparam {
533 __s32 param;
534 /*
535 * WARNING: Using pointers instead of fixed-size u64 means we need to write
536 * compat32 code. Don't repeat this mistake.
537 */
538 int *value;
539} drm_i915_getparam_t;
540
541/* Ioctl to set kernel params:
542 */
543#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
544#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
545#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
546#define I915_SETPARAM_NUM_USED_FENCES 4
547
548typedef struct drm_i915_setparam {
549 int param;
550 int value;
551} drm_i915_setparam_t;
552
553/* A memory manager for regions of shared memory:
554 */
555#define I915_MEM_REGION_AGP 1
556
557typedef struct drm_i915_mem_alloc {
558 int region;
559 int alignment;
560 int size;
561 int *region_offset; /* offset from start of fb or agp */
562} drm_i915_mem_alloc_t;
563
564typedef struct drm_i915_mem_free {
565 int region;
566 int region_offset;
567} drm_i915_mem_free_t;
568
569typedef struct drm_i915_mem_init_heap {
570 int region;
571 int size;
572 int start;
573} drm_i915_mem_init_heap_t;
574
575/* Allow memory manager to be torn down and re-initialized (eg on
576 * rotate):
577 */
578typedef struct drm_i915_mem_destroy_heap {
579 int region;
580} drm_i915_mem_destroy_heap_t;
581
582/* Allow X server to configure which pipes to monitor for vblank signals
583 */
584#define DRM_I915_VBLANK_PIPE_A 1
585#define DRM_I915_VBLANK_PIPE_B 2
586
587typedef struct drm_i915_vblank_pipe {
588 int pipe;
589} drm_i915_vblank_pipe_t;
590
591/* Schedule buffer swap at given vertical blank:
592 */
593typedef struct drm_i915_vblank_swap {
594 drm_drawable_t drawable;
595 enum drm_vblank_seq_type seqtype;
596 unsigned int sequence;
597} drm_i915_vblank_swap_t;
598
599typedef struct drm_i915_hws_addr {
600 __u64 addr;
601} drm_i915_hws_addr_t;
602
603struct drm_i915_gem_init {
604 /**
605 * Beginning offset in the GTT to be managed by the DRM memory
606 * manager.
607 */
608 __u64 gtt_start;
609 /**
610 * Ending offset in the GTT to be managed by the DRM memory
611 * manager.
612 */
613 __u64 gtt_end;
614};
615
616struct drm_i915_gem_create {
617 /**
618 * Requested size for the object.
619 *
620 * The (page-aligned) allocated size for the object will be returned.
621 */
622 __u64 size;
623 /**
624 * Returned handle for the object.
625 *
626 * Object handles are nonzero.
627 */
628 __u32 handle;
629 __u32 pad;
630};
631
632struct drm_i915_gem_pread {
633 /** Handle for the object being read. */
634 __u32 handle;
635 __u32 pad;
636 /** Offset into the object to read from */
637 __u64 offset;
638 /** Length of data to read */
639 __u64 size;
640 /**
641 * Pointer to write the data into.
642 *
643 * This is a fixed-size type for 32/64 compatibility.
644 */
645 __u64 data_ptr;
646};
647
648struct drm_i915_gem_pwrite {
649 /** Handle for the object being written to. */
650 __u32 handle;
651 __u32 pad;
652 /** Offset into the object to write to */
653 __u64 offset;
654 /** Length of data to write */
655 __u64 size;
656 /**
657 * Pointer to read the data from.
658 *
659 * This is a fixed-size type for 32/64 compatibility.
660 */
661 __u64 data_ptr;
662};
663
664struct drm_i915_gem_mmap {
665 /** Handle for the object being mapped. */
666 __u32 handle;
667 __u32 pad;
668 /** Offset in the object to map. */
669 __u64 offset;
670 /**
671 * Length of data to map.
672 *
673 * The value will be page-aligned.
674 */
675 __u64 size;
676 /**
677 * Returned pointer the data was mapped at.
678 *
679 * This is a fixed-size type for 32/64 compatibility.
680 */
681 __u64 addr_ptr;
682
683 /**
684 * Flags for extended behaviour.
685 *
686 * Added in version 2.
687 */
688 __u64 flags;
689#define I915_MMAP_WC 0x1
690};
691
692struct drm_i915_gem_mmap_gtt {
693 /** Handle for the object being mapped. */
694 __u32 handle;
695 __u32 pad;
696 /**
697 * Fake offset to use for subsequent mmap call
698 *
699 * This is a fixed-size type for 32/64 compatibility.
700 */
701 __u64 offset;
702};
703
704struct drm_i915_gem_set_domain {
705 /** Handle for the object */
706 __u32 handle;
707
708 /** New read domains */
709 __u32 read_domains;
710
711 /** New write domain */
712 __u32 write_domain;
713};
714
715struct drm_i915_gem_sw_finish {
716 /** Handle for the object */
717 __u32 handle;
718};
719
720struct drm_i915_gem_relocation_entry {
721 /**
722 * Handle of the buffer being pointed to by this relocation entry.
723 *
724 * It's appealing to make this be an index into the mm_validate_entry
725 * list to refer to the buffer, but this allows the driver to create
726 * a relocation list for state buffers and not re-write it per
727 * exec using the buffer.
728 */
729 __u32 target_handle;
730
731 /**
732 * Value to be added to the offset of the target buffer to make up
733 * the relocation entry.
734 */
735 __u32 delta;
736
737 /** Offset in the buffer the relocation entry will be written into */
738 __u64 offset;
739
740 /**
741 * Offset value of the target buffer that the relocation entry was last
742 * written as.
743 *
744 * If the buffer has the same offset as last time, we can skip syncing
745 * and writing the relocation. This value is written back out by
746 * the execbuffer ioctl when the relocation is written.
747 */
748 __u64 presumed_offset;
749
750 /**
751 * Target memory domains read by this operation.
752 */
753 __u32 read_domains;
754
755 /**
756 * Target memory domains written by this operation.
757 *
758 * Note that only one domain may be written by the whole
759 * execbuffer operation, so that where there are conflicts,
760 * the application will get -EINVAL back.
761 */
762 __u32 write_domain;
763};
764
765/** @{
766 * Intel memory domains
767 *
768 * Most of these just align with the various caches in
769 * the system and are used to flush and invalidate as
770 * objects end up cached in different domains.
771 */
772/** CPU cache */
773#define I915_GEM_DOMAIN_CPU 0x00000001
774/** Render cache, used by 2D and 3D drawing */
775#define I915_GEM_DOMAIN_RENDER 0x00000002
776/** Sampler cache, used by texture engine */
777#define I915_GEM_DOMAIN_SAMPLER 0x00000004
778/** Command queue, used to load batch buffers */
779#define I915_GEM_DOMAIN_COMMAND 0x00000008
780/** Instruction cache, used by shader programs */
781#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
782/** Vertex address cache */
783#define I915_GEM_DOMAIN_VERTEX 0x00000020
784/** GTT domain - aperture and scanout */
785#define I915_GEM_DOMAIN_GTT 0x00000040
786/** WC domain - uncached access */
787#define I915_GEM_DOMAIN_WC 0x00000080
788/** @} */
789
790struct drm_i915_gem_exec_object {
791 /**
792 * User's handle for a buffer to be bound into the GTT for this
793 * operation.
794 */
795 __u32 handle;
796
797 /** Number of relocations to be performed on this buffer */
798 __u32 relocation_count;
799 /**
800 * Pointer to array of struct drm_i915_gem_relocation_entry containing
801 * the relocations to be performed in this buffer.
802 */
803 __u64 relocs_ptr;
804
805 /** Required alignment in graphics aperture */
806 __u64 alignment;
807
808 /**
809 * Returned value of the updated offset of the object, for future
810 * presumed_offset writes.
811 */
812 __u64 offset;
813};
814
815struct drm_i915_gem_execbuffer {
816 /**
817 * List of buffers to be validated with their relocations to be
818 * performend on them.
819 *
820 * This is a pointer to an array of struct drm_i915_gem_validate_entry.
821 *
822 * These buffers must be listed in an order such that all relocations
823 * a buffer is performing refer to buffers that have already appeared
824 * in the validate list.
825 */
826 __u64 buffers_ptr;
827 __u32 buffer_count;
828
829 /** Offset in the batchbuffer to start execution from. */
830 __u32 batch_start_offset;
831 /** Bytes used in batchbuffer from batch_start_offset */
832 __u32 batch_len;
833 __u32 DR1;
834 __u32 DR4;
835 __u32 num_cliprects;
836 /** This is a struct drm_clip_rect *cliprects */
837 __u64 cliprects_ptr;
838};
839
840struct drm_i915_gem_exec_object2 {
841 /**
842 * User's handle for a buffer to be bound into the GTT for this
843 * operation.
844 */
845 __u32 handle;
846
847 /** Number of relocations to be performed on this buffer */
848 __u32 relocation_count;
849 /**
850 * Pointer to array of struct drm_i915_gem_relocation_entry containing
851 * the relocations to be performed in this buffer.
852 */
853 __u64 relocs_ptr;
854
855 /** Required alignment in graphics aperture */
856 __u64 alignment;
857
858 /**
859 * When the EXEC_OBJECT_PINNED flag is specified this is populated by
860 * the user with the GTT offset at which this object will be pinned.
861 * When the I915_EXEC_NO_RELOC flag is specified this must contain the
862 * presumed_offset of the object.
863 * During execbuffer2 the kernel populates it with the value of the
864 * current GTT offset of the object, for future presumed_offset writes.
865 */
866 __u64 offset;
867
868#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
869#define EXEC_OBJECT_NEEDS_GTT (1<<1)
870#define EXEC_OBJECT_WRITE (1<<2)
871#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
872#define EXEC_OBJECT_PINNED (1<<4)
873#define EXEC_OBJECT_PAD_TO_SIZE (1<<5)
874/* The kernel implicitly tracks GPU activity on all GEM objects, and
875 * synchronises operations with outstanding rendering. This includes
876 * rendering on other devices if exported via dma-buf. However, sometimes
877 * this tracking is too coarse and the user knows better. For example,
878 * if the object is split into non-overlapping ranges shared between different
879 * clients or engines (i.e. suballocating objects), the implicit tracking
880 * by kernel assumes that each operation affects the whole object rather
881 * than an individual range, causing needless synchronisation between clients.
882 * The kernel will also forgo any CPU cache flushes prior to rendering from
883 * the object as the client is expected to be also handling such domain
884 * tracking.
885 *
886 * The kernel maintains the implicit tracking in order to manage resources
887 * used by the GPU - this flag only disables the synchronisation prior to
888 * rendering with this object in this execbuf.
889 *
890 * Opting out of implicit synhronisation requires the user to do its own
891 * explicit tracking to avoid rendering corruption. See, for example,
892 * I915_PARAM_HAS_EXEC_FENCE to order execbufs and execute them asynchronously.
893 */
894#define EXEC_OBJECT_ASYNC (1<<6)
895/* Request that the contents of this execobject be copied into the error
896 * state upon a GPU hang involving this batch for post-mortem debugging.
897 * These buffers are recorded in no particular order as "user" in
898 * /sys/class/drm/cardN/error. Query I915_PARAM_HAS_EXEC_CAPTURE to see
899 * if the kernel supports this flag.
900 */
901#define EXEC_OBJECT_CAPTURE (1<<7)
902/* All remaining bits are MBZ and RESERVED FOR FUTURE USE */
903#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_CAPTURE<<1)
904 __u64 flags;
905
906 union {
907 __u64 rsvd1;
908 __u64 pad_to_size;
909 };
910 __u64 rsvd2;
911};
912
913struct drm_i915_gem_exec_fence {
914 /**
915 * User's handle for a drm_syncobj to wait on or signal.
916 */
917 __u32 handle;
918
919#define I915_EXEC_FENCE_WAIT (1<<0)
920#define I915_EXEC_FENCE_SIGNAL (1<<1)
921#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
922 __u32 flags;
923};
924
925struct drm_i915_gem_execbuffer2 {
926 /**
927 * List of gem_exec_object2 structs
928 */
929 __u64 buffers_ptr;
930 __u32 buffer_count;
931
932 /** Offset in the batchbuffer to start execution from. */
933 __u32 batch_start_offset;
934 /** Bytes used in batchbuffer from batch_start_offset */
935 __u32 batch_len;
936 __u32 DR1;
937 __u32 DR4;
938 __u32 num_cliprects;
939 /**
940 * This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY
941 * is not set. If I915_EXEC_FENCE_ARRAY is set, then this is a
942 * struct drm_i915_gem_exec_fence *fences.
943 */
944 __u64 cliprects_ptr;
945#define I915_EXEC_RING_MASK (7<<0)
946#define I915_EXEC_DEFAULT (0<<0)
947#define I915_EXEC_RENDER (1<<0)
948#define I915_EXEC_BSD (2<<0)
949#define I915_EXEC_BLT (3<<0)
950#define I915_EXEC_VEBOX (4<<0)
951
952/* Used for switching the constants addressing mode on gen4+ RENDER ring.
953 * Gen6+ only supports relative addressing to dynamic state (default) and
954 * absolute addressing.
955 *
956 * These flags are ignored for the BSD and BLT rings.
957 */
958#define I915_EXEC_CONSTANTS_MASK (3<<6)
959#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
960#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
961#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */
962 __u64 flags;
963 __u64 rsvd1; /* now used for context info */
964 __u64 rsvd2;
965};
966
967/** Resets the SO write offset registers for transform feedback on gen7. */
968#define I915_EXEC_GEN7_SOL_RESET (1<<8)
969
970/** Request a privileged ("secure") batch buffer. Note only available for
971 * DRM_ROOT_ONLY | DRM_MASTER processes.
972 */
973#define I915_EXEC_SECURE (1<<9)
974
975/** Inform the kernel that the batch is and will always be pinned. This
976 * negates the requirement for a workaround to be performed to avoid
977 * an incoherent CS (such as can be found on 830/845). If this flag is
978 * not passed, the kernel will endeavour to make sure the batch is
979 * coherent with the CS before execution. If this flag is passed,
980 * userspace assumes the responsibility for ensuring the same.
981 */
982#define I915_EXEC_IS_PINNED (1<<10)
983
984/** Provide a hint to the kernel that the command stream and auxiliary
985 * state buffers already holds the correct presumed addresses and so the
986 * relocation process may be skipped if no buffers need to be moved in
987 * preparation for the execbuffer.
988 */
989#define I915_EXEC_NO_RELOC (1<<11)
990
991/** Use the reloc.handle as an index into the exec object array rather
992 * than as the per-file handle.
993 */
994#define I915_EXEC_HANDLE_LUT (1<<12)
995
996/** Used for switching BSD rings on the platforms with two BSD rings */
997#define I915_EXEC_BSD_SHIFT (13)
998#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
999/* default ping-pong mode */
1000#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
1001#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
1002#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
1003
1004/** Tell the kernel that the batchbuffer is processed by
1005 * the resource streamer.
1006 */
1007#define I915_EXEC_RESOURCE_STREAMER (1<<15)
1008
1009/* Setting I915_EXEC_FENCE_IN implies that lower_32_bits(rsvd2) represent
1010 * a sync_file fd to wait upon (in a nonblocking manner) prior to executing
1011 * the batch.
1012 *
1013 * Returns -EINVAL if the sync_file fd cannot be found.
1014 */
1015#define I915_EXEC_FENCE_IN (1<<16)
1016
1017/* Setting I915_EXEC_FENCE_OUT causes the ioctl to return a sync_file fd
1018 * in the upper_32_bits(rsvd2) upon success. Ownership of the fd is given
1019 * to the caller, and it should be close() after use. (The fd is a regular
1020 * file descriptor and will be cleaned up on process termination. It holds
1021 * a reference to the request, but nothing else.)
1022 *
1023 * The sync_file fd can be combined with other sync_file and passed either
1024 * to execbuf using I915_EXEC_FENCE_IN, to atomic KMS ioctls (so that a flip
1025 * will only occur after this request completes), or to other devices.
1026 *
1027 * Using I915_EXEC_FENCE_OUT requires use of
1028 * DRM_IOCTL_I915_GEM_EXECBUFFER2_WR ioctl so that the result is written
1029 * back to userspace. Failure to do so will cause the out-fence to always
1030 * be reported as zero, and the real fence fd to be leaked.
1031 */
1032#define I915_EXEC_FENCE_OUT (1<<17)
1033
1034/*
1035 * Traditionally the execbuf ioctl has only considered the final element in
1036 * the execobject[] to be the executable batch. Often though, the client
1037 * will known the batch object prior to construction and being able to place
1038 * it into the execobject[] array first can simplify the relocation tracking.
1039 * Setting I915_EXEC_BATCH_FIRST tells execbuf to use element 0 of the
1040 * execobject[] as the * batch instead (the default is to use the last
1041 * element).
1042 */
1043#define I915_EXEC_BATCH_FIRST (1<<18)
1044
1045/* Setting I915_FENCE_ARRAY implies that num_cliprects and cliprects_ptr
1046 * define an array of i915_gem_exec_fence structures which specify a set of
1047 * dma fences to wait upon or signal.
1048 */
1049#define I915_EXEC_FENCE_ARRAY (1<<19)
1050
1051#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_ARRAY<<1))
1052
1053#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
1054#define i915_execbuffer2_set_context_id(eb2, context) \
1055 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
1056#define i915_execbuffer2_get_context_id(eb2) \
1057 ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
1058
1059struct drm_i915_gem_pin {
1060 /** Handle of the buffer to be pinned. */
1061 __u32 handle;
1062 __u32 pad;
1063
1064 /** alignment required within the aperture */
1065 __u64 alignment;
1066
1067 /** Returned GTT offset of the buffer. */
1068 __u64 offset;
1069};
1070
1071struct drm_i915_gem_unpin {
1072 /** Handle of the buffer to be unpinned. */
1073 __u32 handle;
1074 __u32 pad;
1075};
1076
1077struct drm_i915_gem_busy {
1078 /** Handle of the buffer to check for busy */
1079 __u32 handle;
1080
1081 /** Return busy status
1082 *
1083 * A return of 0 implies that the object is idle (after
1084 * having flushed any pending activity), and a non-zero return that
1085 * the object is still in-flight on the GPU. (The GPU has not yet
1086 * signaled completion for all pending requests that reference the
1087 * object.) An object is guaranteed to become idle eventually (so
1088 * long as no new GPU commands are executed upon it). Due to the
1089 * asynchronous nature of the hardware, an object reported
1090 * as busy may become idle before the ioctl is completed.
1091 *
1092 * Furthermore, if the object is busy, which engine is busy is only
1093 * provided as a guide. There are race conditions which prevent the
1094 * report of which engines are busy from being always accurate.
1095 * However, the converse is not true. If the object is idle, the
1096 * result of the ioctl, that all engines are idle, is accurate.
1097 *
1098 * The returned dword is split into two fields to indicate both
1099 * the engines on which the object is being read, and the
1100 * engine on which it is currently being written (if any).
1101 *
1102 * The low word (bits 0:15) indicate if the object is being written
1103 * to by any engine (there can only be one, as the GEM implicit
1104 * synchronisation rules force writes to be serialised). Only the
1105 * engine for the last write is reported.
1106 *
1107 * The high word (bits 16:31) are a bitmask of which engines are
1108 * currently reading from the object. Multiple engines may be
1109 * reading from the object simultaneously.
1110 *
1111 * The value of each engine is the same as specified in the
1112 * EXECBUFFER2 ioctl, i.e. I915_EXEC_RENDER, I915_EXEC_BSD etc.
1113 * Note I915_EXEC_DEFAULT is a symbolic value and is mapped to
1114 * the I915_EXEC_RENDER engine for execution, and so it is never
1115 * reported as active itself. Some hardware may have parallel
1116 * execution engines, e.g. multiple media engines, which are
1117 * mapped to the same identifier in the EXECBUFFER2 ioctl and
1118 * so are not separately reported for busyness.
1119 *
1120 * Caveat emptor:
1121 * Only the boolean result of this query is reliable; that is whether
1122 * the object is idle or busy. The report of which engines are busy
1123 * should be only used as a heuristic.
1124 */
1125 __u32 busy;
1126};
1127
1128/**
1129 * I915_CACHING_NONE
1130 *
1131 * GPU access is not coherent with cpu caches. Default for machines without an
1132 * LLC.
1133 */
1134#define I915_CACHING_NONE 0
1135/**
1136 * I915_CACHING_CACHED
1137 *
1138 * GPU access is coherent with cpu caches and furthermore the data is cached in
1139 * last-level caches shared between cpu cores and the gpu GT. Default on
1140 * machines with HAS_LLC.
1141 */
1142#define I915_CACHING_CACHED 1
1143/**
1144 * I915_CACHING_DISPLAY
1145 *
1146 * Special GPU caching mode which is coherent with the scanout engines.
1147 * Transparently falls back to I915_CACHING_NONE on platforms where no special
1148 * cache mode (like write-through or gfdt flushing) is available. The kernel
1149 * automatically sets this mode when using a buffer as a scanout target.
1150 * Userspace can manually set this mode to avoid a costly stall and clflush in
1151 * the hotpath of drawing the first frame.
1152 */
1153#define I915_CACHING_DISPLAY 2
1154
1155struct drm_i915_gem_caching {
1156 /**
1157 * Handle of the buffer to set/get the caching level of. */
1158 __u32 handle;
1159
1160 /**
1161 * Cacheing level to apply or return value
1162 *
1163 * bits0-15 are for generic caching control (i.e. the above defined
1164 * values). bits16-31 are reserved for platform-specific variations
1165 * (e.g. l3$ caching on gen7). */
1166 __u32 caching;
1167};
1168
1169#define I915_TILING_NONE 0
1170#define I915_TILING_X 1
1171#define I915_TILING_Y 2
1172#define I915_TILING_LAST I915_TILING_Y
1173
1174#define I915_BIT_6_SWIZZLE_NONE 0
1175#define I915_BIT_6_SWIZZLE_9 1
1176#define I915_BIT_6_SWIZZLE_9_10 2
1177#define I915_BIT_6_SWIZZLE_9_11 3
1178#define I915_BIT_6_SWIZZLE_9_10_11 4
1179/* Not seen by userland */
1180#define I915_BIT_6_SWIZZLE_UNKNOWN 5
1181/* Seen by userland. */
1182#define I915_BIT_6_SWIZZLE_9_17 6
1183#define I915_BIT_6_SWIZZLE_9_10_17 7
1184
1185struct drm_i915_gem_set_tiling {
1186 /** Handle of the buffer to have its tiling state updated */
1187 __u32 handle;
1188
1189 /**
1190 * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
1191 * I915_TILING_Y).
1192 *
1193 * This value is to be set on request, and will be updated by the
1194 * kernel on successful return with the actual chosen tiling layout.
1195 *
1196 * The tiling mode may be demoted to I915_TILING_NONE when the system
1197 * has bit 6 swizzling that can't be managed correctly by GEM.
1198 *
1199 * Buffer contents become undefined when changing tiling_mode.
1200 */
1201 __u32 tiling_mode;
1202
1203 /**
1204 * Stride in bytes for the object when in I915_TILING_X or
1205 * I915_TILING_Y.
1206 */
1207 __u32 stride;
1208
1209 /**
1210 * Returned address bit 6 swizzling required for CPU access through
1211 * mmap mapping.
1212 */
1213 __u32 swizzle_mode;
1214};
1215
1216struct drm_i915_gem_get_tiling {
1217 /** Handle of the buffer to get tiling state for. */
1218 __u32 handle;
1219
1220 /**
1221 * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
1222 * I915_TILING_Y).
1223 */
1224 __u32 tiling_mode;
1225
1226 /**
1227 * Returned address bit 6 swizzling required for CPU access through
1228 * mmap mapping.
1229 */
1230 __u32 swizzle_mode;
1231
1232 /**
1233 * Returned address bit 6 swizzling required for CPU access through
1234 * mmap mapping whilst bound.
1235 */
1236 __u32 phys_swizzle_mode;
1237};
1238
1239struct drm_i915_gem_get_aperture {
1240 /** Total size of the aperture used by i915_gem_execbuffer, in bytes */
1241 __u64 aper_size;
1242
1243 /**
1244 * Available space in the aperture used by i915_gem_execbuffer, in
1245 * bytes
1246 */
1247 __u64 aper_available_size;
1248};
1249
1250struct drm_i915_get_pipe_from_crtc_id {
1251 /** ID of CRTC being requested **/
1252 __u32 crtc_id;
1253
1254 /** pipe of requested CRTC **/
1255 __u32 pipe;
1256};
1257
1258#define I915_MADV_WILLNEED 0
1259#define I915_MADV_DONTNEED 1
1260#define __I915_MADV_PURGED 2 /* internal state */
1261
1262struct drm_i915_gem_madvise {
1263 /** Handle of the buffer to change the backing store advice */
1264 __u32 handle;
1265
1266 /* Advice: either the buffer will be needed again in the near future,
1267 * or wont be and could be discarded under memory pressure.
1268 */
1269 __u32 madv;
1270
1271 /** Whether the backing store still exists. */
1272 __u32 retained;
1273};
1274
1275/* flags */
1276#define I915_OVERLAY_TYPE_MASK 0xff
1277#define I915_OVERLAY_YUV_PLANAR 0x01
1278#define I915_OVERLAY_YUV_PACKED 0x02
1279#define I915_OVERLAY_RGB 0x03
1280
1281#define I915_OVERLAY_DEPTH_MASK 0xff00
1282#define I915_OVERLAY_RGB24 0x1000
1283#define I915_OVERLAY_RGB16 0x2000
1284#define I915_OVERLAY_RGB15 0x3000
1285#define I915_OVERLAY_YUV422 0x0100
1286#define I915_OVERLAY_YUV411 0x0200
1287#define I915_OVERLAY_YUV420 0x0300
1288#define I915_OVERLAY_YUV410 0x0400
1289
1290#define I915_OVERLAY_SWAP_MASK 0xff0000
1291#define I915_OVERLAY_NO_SWAP 0x000000
1292#define I915_OVERLAY_UV_SWAP 0x010000
1293#define I915_OVERLAY_Y_SWAP 0x020000
1294#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
1295
1296#define I915_OVERLAY_FLAGS_MASK 0xff000000
1297#define I915_OVERLAY_ENABLE 0x01000000
1298
1299struct drm_intel_overlay_put_image {
1300 /* various flags and src format description */
1301 __u32 flags;
1302 /* source picture description */
1303 __u32 bo_handle;
1304 /* stride values and offsets are in bytes, buffer relative */
1305 __u16 stride_Y; /* stride for packed formats */
1306 __u16 stride_UV;
1307 __u32 offset_Y; /* offset for packet formats */
1308 __u32 offset_U;
1309 __u32 offset_V;
1310 /* in pixels */
1311 __u16 src_width;
1312 __u16 src_height;
1313 /* to compensate the scaling factors for partially covered surfaces */
1314 __u16 src_scan_width;
1315 __u16 src_scan_height;
1316 /* output crtc description */
1317 __u32 crtc_id;
1318 __u16 dst_x;
1319 __u16 dst_y;
1320 __u16 dst_width;
1321 __u16 dst_height;
1322};
1323
1324/* flags */
1325#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
1326#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
1327#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1<<2)
1328struct drm_intel_overlay_attrs {
1329 __u32 flags;
1330 __u32 color_key;
1331 __s32 brightness;
1332 __u32 contrast;
1333 __u32 saturation;
1334 __u32 gamma0;
1335 __u32 gamma1;
1336 __u32 gamma2;
1337 __u32 gamma3;
1338 __u32 gamma4;
1339 __u32 gamma5;
1340};
1341
1342/*
1343 * Intel sprite handling
1344 *
1345 * Color keying works with a min/mask/max tuple. Both source and destination
1346 * color keying is allowed.
1347 *
1348 * Source keying:
1349 * Sprite pixels within the min & max values, masked against the color channels
1350 * specified in the mask field, will be transparent. All other pixels will
1351 * be displayed on top of the primary plane. For RGB surfaces, only the min
1352 * and mask fields will be used; ranged compares are not allowed.
1353 *
1354 * Destination keying:
1355 * Primary plane pixels that match the min value, masked against the color
1356 * channels specified in the mask field, will be replaced by corresponding
1357 * pixels from the sprite plane.
1358 *
1359 * Note that source & destination keying are exclusive; only one can be
1360 * active on a given plane.
1361 */
1362
1363#define I915_SET_COLORKEY_NONE (1<<0) /* Deprecated. Instead set
1364 * flags==0 to disable colorkeying.
1365 */
1366#define I915_SET_COLORKEY_DESTINATION (1<<1)
1367#define I915_SET_COLORKEY_SOURCE (1<<2)
1368struct drm_intel_sprite_colorkey {
1369 __u32 plane_id;
1370 __u32 min_value;
1371 __u32 channel_mask;
1372 __u32 max_value;
1373 __u32 flags;
1374};
1375
1376struct drm_i915_gem_wait {
1377 /** Handle of BO we shall wait on */
1378 __u32 bo_handle;
1379 __u32 flags;
1380 /** Number of nanoseconds to wait, Returns time remaining. */
1381 __s64 timeout_ns;
1382};
1383
1384struct drm_i915_gem_context_create {
1385 /* output: id of new context*/
1386 __u32 ctx_id;
1387 __u32 pad;
1388};
1389
1390struct drm_i915_gem_context_destroy {
1391 __u32 ctx_id;
1392 __u32 pad;
1393};
1394
1395struct drm_i915_reg_read {
1396 /*
1397 * Register offset.
1398 * For 64bit wide registers where the upper 32bits don't immediately
1399 * follow the lower 32bits, the offset of the lower 32bits must
1400 * be specified
1401 */
1402 __u64 offset;
1403#define I915_REG_READ_8B_WA (1ul << 0)
1404
1405 __u64 val; /* Return value */
1406};
1407/* Known registers:
1408 *
1409 * Render engine timestamp - 0x2358 + 64bit - gen7+
1410 * - Note this register returns an invalid value if using the default
1411 * single instruction 8byte read, in order to workaround that pass
1412 * flag I915_REG_READ_8B_WA in offset field.
1413 *
1414 */
1415
1416struct drm_i915_reset_stats {
1417 __u32 ctx_id;
1418 __u32 flags;
1419
1420 /* All resets since boot/module reload, for all contexts */
1421 __u32 reset_count;
1422
1423 /* Number of batches lost when active in GPU, for this context */
1424 __u32 batch_active;
1425
1426 /* Number of batches lost pending for execution, for this context */
1427 __u32 batch_pending;
1428
1429 __u32 pad;
1430};
1431
1432struct drm_i915_gem_userptr {
1433 __u64 user_ptr;
1434 __u64 user_size;
1435 __u32 flags;
1436#define I915_USERPTR_READ_ONLY 0x1
1437#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
1438 /**
1439 * Returned handle for the object.
1440 *
1441 * Object handles are nonzero.
1442 */
1443 __u32 handle;
1444};
1445
1446struct drm_i915_gem_context_param {
1447 __u32 ctx_id;
1448 __u32 size;
1449 __u64 param;
1450#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
1451#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
1452#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
1453#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
1454#define I915_CONTEXT_PARAM_BANNABLE 0x5
1455#define I915_CONTEXT_PARAM_PRIORITY 0x6
1456#define I915_CONTEXT_MAX_USER_PRIORITY 1023 /* inclusive */
1457#define I915_CONTEXT_DEFAULT_PRIORITY 0
1458#define I915_CONTEXT_MIN_USER_PRIORITY -1023 /* inclusive */
1459 __u64 value;
1460};
1461
1462enum drm_i915_oa_format {
1463 I915_OA_FORMAT_A13 = 1, /* HSW only */
1464 I915_OA_FORMAT_A29, /* HSW only */
1465 I915_OA_FORMAT_A13_B8_C8, /* HSW only */
1466 I915_OA_FORMAT_B4_C8, /* HSW only */
1467 I915_OA_FORMAT_A45_B8_C8, /* HSW only */
1468 I915_OA_FORMAT_B4_C8_A16, /* HSW only */
1469 I915_OA_FORMAT_C4_B8, /* HSW+ */
1470
1471 /* Gen8+ */
1472 I915_OA_FORMAT_A12,
1473 I915_OA_FORMAT_A12_B8_C8,
1474 I915_OA_FORMAT_A32u40_A4u32_B8_C8,
1475
1476 I915_OA_FORMAT_MAX /* non-ABI */
1477};
1478
1479enum drm_i915_perf_property_id {
1480 /**
1481 * Open the stream for a specific context handle (as used with
1482 * execbuffer2). A stream opened for a specific context this way
1483 * won't typically require root privileges.
1484 */
1485 DRM_I915_PERF_PROP_CTX_HANDLE = 1,
1486
1487 /**
1488 * A value of 1 requests the inclusion of raw OA unit reports as
1489 * part of stream samples.
1490 */
1491 DRM_I915_PERF_PROP_SAMPLE_OA,
1492
1493 /**
1494 * The value specifies which set of OA unit metrics should be
1495 * be configured, defining the contents of any OA unit reports.
1496 */
1497 DRM_I915_PERF_PROP_OA_METRICS_SET,
1498
1499 /**
1500 * The value specifies the size and layout of OA unit reports.
1501 */
1502 DRM_I915_PERF_PROP_OA_FORMAT,
1503
1504 /**
1505 * Specifying this property implicitly requests periodic OA unit
1506 * sampling and (at least on Haswell) the sampling frequency is derived
1507 * from this exponent as follows:
1508 *
1509 * 80ns * 2^(period_exponent + 1)
1510 */
1511 DRM_I915_PERF_PROP_OA_EXPONENT,
1512
1513 DRM_I915_PERF_PROP_MAX /* non-ABI */
1514};
1515
1516struct drm_i915_perf_open_param {
1517 __u32 flags;
1518#define I915_PERF_FLAG_FD_CLOEXEC (1<<0)
1519#define I915_PERF_FLAG_FD_NONBLOCK (1<<1)
1520#define I915_PERF_FLAG_DISABLED (1<<2)
1521
1522 /** The number of u64 (id, value) pairs */
1523 __u32 num_properties;
1524
1525 /**
1526 * Pointer to array of u64 (id, value) pairs configuring the stream
1527 * to open.
1528 */
1529 __u64 properties_ptr;
1530};
1531
1532/**
1533 * Enable data capture for a stream that was either opened in a disabled state
1534 * via I915_PERF_FLAG_DISABLED or was later disabled via
1535 * I915_PERF_IOCTL_DISABLE.
1536 *
1537 * It is intended to be cheaper to disable and enable a stream than it may be
1538 * to close and re-open a stream with the same configuration.
1539 *
1540 * It's undefined whether any pending data for the stream will be lost.
1541 */
1542#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
1543
1544/**
1545 * Disable data capture for a stream.
1546 *
1547 * It is an error to try and read a stream that is disabled.
1548 */
1549#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
1550
1551/**
1552 * Common to all i915 perf records
1553 */
1554struct drm_i915_perf_record_header {
1555 __u32 type;
1556 __u16 pad;
1557 __u16 size;
1558};
1559
1560enum drm_i915_perf_record_type {
1561
1562 /**
1563 * Samples are the work horse record type whose contents are extensible
1564 * and defined when opening an i915 perf stream based on the given
1565 * properties.
1566 *
1567 * Boolean properties following the naming convention
1568 * DRM_I915_PERF_SAMPLE_xyz_PROP request the inclusion of 'xyz' data in
1569 * every sample.
1570 *
1571 * The order of these sample properties given by userspace has no
1572 * affect on the ordering of data within a sample. The order is
1573 * documented here.
1574 *
1575 * struct {
1576 * struct drm_i915_perf_record_header header;
1577 *
1578 * { u32 oa_report[]; } && DRM_I915_PERF_PROP_SAMPLE_OA
1579 * };
1580 */
1581 DRM_I915_PERF_RECORD_SAMPLE = 1,
1582
1583 /*
1584 * Indicates that one or more OA reports were not written by the
1585 * hardware. This can happen for example if an MI_REPORT_PERF_COUNT
1586 * command collides with periodic sampling - which would be more likely
1587 * at higher sampling frequencies.
1588 */
1589 DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
1590
1591 /**
1592 * An error occurred that resulted in all pending OA reports being lost.
1593 */
1594 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
1595
1596 DRM_I915_PERF_RECORD_MAX /* non-ABI */
1597};
1598
1599/**
1600 * Structure to upload perf dynamic configuration into the kernel.
1601 */
1602struct drm_i915_perf_oa_config {
1603 /** String formatted like "%08x-%04x-%04x-%04x-%012x" */
1604 char uuid[36];
1605
1606 __u32 n_mux_regs;
1607 __u32 n_boolean_regs;
1608 __u32 n_flex_regs;
1609
1610 /*
1611 * These fields are pointers to tuples of u32 values (register address,
1612 * value). For example the expected length of the buffer pointed by
1613 * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs).
1614 */
1615 __u64 mux_regs_ptr;
1616 __u64 boolean_regs_ptr;
1617 __u64 flex_regs_ptr;
1618};
1619
1620struct drm_i915_query_item {
1621 __u64 query_id;
1622#define DRM_I915_QUERY_TOPOLOGY_INFO 1
1623
1624 /*
1625 * When set to zero by userspace, this is filled with the size of the
1626 * data to be written at the data_ptr pointer. The kernel sets this
1627 * value to a negative value to signal an error on a particular query
1628 * item.
1629 */
1630 __s32 length;
1631
1632 /*
1633 * Unused for now. Must be cleared to zero.
1634 */
1635 __u32 flags;
1636
1637 /*
1638 * Data will be written at the location pointed by data_ptr when the
1639 * value of length matches the length of the data to be written by the
1640 * kernel.
1641 */
1642 __u64 data_ptr;
1643};
1644
1645struct drm_i915_query {
1646 __u32 num_items;
1647
1648 /*
1649 * Unused for now. Must be cleared to zero.
1650 */
1651 __u32 flags;
1652
1653 /*
1654 * This points to an array of num_items drm_i915_query_item structures.
1655 */
1656 __u64 items_ptr;
1657};
1658
1659/*
1660 * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO :
1661 *
1662 * data: contains the 3 pieces of information :
1663 *
1664 * - the slice mask with one bit per slice telling whether a slice is
1665 * available. The availability of slice X can be queried with the following
1666 * formula :
1667 *
1668 * (data[X / 8] >> (X % 8)) & 1
1669 *
1670 * - the subslice mask for each slice with one bit per subslice telling
1671 * whether a subslice is available. The availability of subslice Y in slice
1672 * X can be queried with the following formula :
1673 *
1674 * (data[subslice_offset +
1675 * X * subslice_stride +
1676 * Y / 8] >> (Y % 8)) & 1
1677 *
1678 * - the EU mask for each subslice in each slice with one bit per EU telling
1679 * whether an EU is available. The availability of EU Z in subslice Y in
1680 * slice X can be queried with the following formula :
1681 *
1682 * (data[eu_offset +
1683 * (X * max_subslices + Y) * eu_stride +
1684 * Z / 8] >> (Z % 8)) & 1
1685 */
1686struct drm_i915_query_topology_info {
1687 /*
1688 * Unused for now. Must be cleared to zero.
1689 */
1690 __u16 flags;
1691
1692 __u16 max_slices;
1693 __u16 max_subslices;
1694 __u16 max_eus_per_subslice;
1695
1696 /*
1697 * Offset in data[] at which the subslice masks are stored.
1698 */
1699 __u16 subslice_offset;
1700
1701 /*
1702 * Stride at which each of the subslice masks for each slice are
1703 * stored.
1704 */
1705 __u16 subslice_stride;
1706
1707 /*
1708 * Offset in data[] at which the EU masks are stored.
1709 */
1710 __u16 eu_offset;
1711
1712 /*
1713 * Stride at which each of the EU masks for each subslice are stored.
1714 */
1715 __u16 eu_stride;
1716
1717 __u8 data[];
1718};
1719
1720#if defined(__cplusplus)
1721}
1722#endif
1723
1724#endif /* _I915_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/mga_drm.h deleted-427
...@@ -1,427 +0,0 @@
1/* mga_drm.h -- Public header for the Matrox g200/g400 driver -*- linux-c -*-
2 * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
3 *
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6 * All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 *
27 * Authors:
28 * Jeff Hartmann <jhartmann@valinux.com>
29 * Keith Whitwell <keith@tungstengraphics.com>
30 *
31 * Rewritten by:
32 * Gareth Hughes <gareth@valinux.com>
33 */
34
35#ifndef __MGA_DRM_H__
36#define __MGA_DRM_H__
37
38#include "drm.h"
39
40#if defined(__cplusplus)
41extern "C" {
42#endif
43
44/* WARNING: If you change any of these defines, make sure to change the
45 * defines in the Xserver file (mga_sarea.h)
46 */
47
48#ifndef __MGA_SAREA_DEFINES__
49#define __MGA_SAREA_DEFINES__
50
51/* WARP pipe flags
52 */
53#define MGA_F 0x1 /* fog */
54#define MGA_A 0x2 /* alpha */
55#define MGA_S 0x4 /* specular */
56#define MGA_T2 0x8 /* multitexture */
57
58#define MGA_WARP_TGZ 0
59#define MGA_WARP_TGZF (MGA_F)
60#define MGA_WARP_TGZA (MGA_A)
61#define MGA_WARP_TGZAF (MGA_F|MGA_A)
62#define MGA_WARP_TGZS (MGA_S)
63#define MGA_WARP_TGZSF (MGA_S|MGA_F)
64#define MGA_WARP_TGZSA (MGA_S|MGA_A)
65#define MGA_WARP_TGZSAF (MGA_S|MGA_F|MGA_A)
66#define MGA_WARP_T2GZ (MGA_T2)
67#define MGA_WARP_T2GZF (MGA_T2|MGA_F)
68#define MGA_WARP_T2GZA (MGA_T2|MGA_A)
69#define MGA_WARP_T2GZAF (MGA_T2|MGA_A|MGA_F)
70#define MGA_WARP_T2GZS (MGA_T2|MGA_S)
71#define MGA_WARP_T2GZSF (MGA_T2|MGA_S|MGA_F)
72#define MGA_WARP_T2GZSA (MGA_T2|MGA_S|MGA_A)
73#define MGA_WARP_T2GZSAF (MGA_T2|MGA_S|MGA_F|MGA_A)
74
75#define MGA_MAX_G200_PIPES 8 /* no multitex */
76#define MGA_MAX_G400_PIPES 16
77#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
78#define MGA_WARP_UCODE_SIZE 32768 /* in bytes */
79
80#define MGA_CARD_TYPE_G200 1
81#define MGA_CARD_TYPE_G400 2
82#define MGA_CARD_TYPE_G450 3 /* not currently used */
83#define MGA_CARD_TYPE_G550 4
84
85#define MGA_FRONT 0x1
86#define MGA_BACK 0x2
87#define MGA_DEPTH 0x4
88
89/* What needs to be changed for the current vertex dma buffer?
90 */
91#define MGA_UPLOAD_CONTEXT 0x1
92#define MGA_UPLOAD_TEX0 0x2
93#define MGA_UPLOAD_TEX1 0x4
94#define MGA_UPLOAD_PIPE 0x8
95#define MGA_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */
96#define MGA_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */
97#define MGA_UPLOAD_2D 0x40
98#define MGA_WAIT_AGE 0x80 /* handled client-side */
99#define MGA_UPLOAD_CLIPRECTS 0x100 /* handled client-side */
100#if 0
101#define MGA_DMA_FLUSH 0x200 /* set when someone gets the lock
102 quiescent */
103#endif
104
105/* 32 buffers of 64k each, total 2 meg.
106 */
107#define MGA_BUFFER_SIZE (1 << 16)
108#define MGA_NUM_BUFFERS 128
109
110/* Keep these small for testing.
111 */
112#define MGA_NR_SAREA_CLIPRECTS 8
113
114/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
115 * regions, subject to a minimum region size of (1<<16) == 64k.
116 *
117 * Clients may subdivide regions internally, but when sharing between
118 * clients, the region size is the minimum granularity.
119 */
120
121#define MGA_CARD_HEAP 0
122#define MGA_AGP_HEAP 1
123#define MGA_NR_TEX_HEAPS 2
124#define MGA_NR_TEX_REGIONS 16
125#define MGA_LOG_MIN_TEX_REGION_SIZE 16
126
127#define DRM_MGA_IDLE_RETRY 2048
128
129#endif /* __MGA_SAREA_DEFINES__ */
130
131/* Setup registers for 3D context
132 */
133typedef struct {
134 unsigned int dstorg;
135 unsigned int maccess;
136 unsigned int plnwt;
137 unsigned int dwgctl;
138 unsigned int alphactrl;
139 unsigned int fogcolor;
140 unsigned int wflag;
141 unsigned int tdualstage0;
142 unsigned int tdualstage1;
143 unsigned int fcol;
144 unsigned int stencil;
145 unsigned int stencilctl;
146} drm_mga_context_regs_t;
147
148/* Setup registers for 2D, X server
149 */
150typedef struct {
151 unsigned int pitch;
152} drm_mga_server_regs_t;
153
154/* Setup registers for each texture unit
155 */
156typedef struct {
157 unsigned int texctl;
158 unsigned int texctl2;
159 unsigned int texfilter;
160 unsigned int texbordercol;
161 unsigned int texorg;
162 unsigned int texwidth;
163 unsigned int texheight;
164 unsigned int texorg1;
165 unsigned int texorg2;
166 unsigned int texorg3;
167 unsigned int texorg4;
168} drm_mga_texture_regs_t;
169
170/* General aging mechanism
171 */
172typedef struct {
173 unsigned int head; /* Position of head pointer */
174 unsigned int wrap; /* Primary DMA wrap count */
175} drm_mga_age_t;
176
177typedef struct _drm_mga_sarea {
178 /* The channel for communication of state information to the kernel
179 * on firing a vertex dma buffer.
180 */
181 drm_mga_context_regs_t context_state;
182 drm_mga_server_regs_t server_state;
183 drm_mga_texture_regs_t tex_state[2];
184 unsigned int warp_pipe;
185 unsigned int dirty;
186 unsigned int vertsize;
187
188 /* The current cliprects, or a subset thereof.
189 */
190 struct drm_clip_rect boxes[MGA_NR_SAREA_CLIPRECTS];
191 unsigned int nbox;
192
193 /* Information about the most recently used 3d drawable. The
194 * client fills in the req_* fields, the server fills in the
195 * exported_ fields and puts the cliprects into boxes, above.
196 *
197 * The client clears the exported_drawable field before
198 * clobbering the boxes data.
199 */
200 unsigned int req_drawable; /* the X drawable id */
201 unsigned int req_draw_buffer; /* MGA_FRONT or MGA_BACK */
202
203 unsigned int exported_drawable;
204 unsigned int exported_index;
205 unsigned int exported_stamp;
206 unsigned int exported_buffers;
207 unsigned int exported_nfront;
208 unsigned int exported_nback;
209 int exported_back_x, exported_front_x, exported_w;
210 int exported_back_y, exported_front_y, exported_h;
211 struct drm_clip_rect exported_boxes[MGA_NR_SAREA_CLIPRECTS];
212
213 /* Counters for aging textures and for client-side throttling.
214 */
215 unsigned int status[4];
216 unsigned int last_wrap;
217
218 drm_mga_age_t last_frame;
219 unsigned int last_enqueue; /* last time a buffer was enqueued */
220 unsigned int last_dispatch; /* age of the most recently dispatched buffer */
221 unsigned int last_quiescent; /* */
222
223 /* LRU lists for texture memory in agp space and on the card.
224 */
225 struct drm_tex_region texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS + 1];
226 unsigned int texAge[MGA_NR_TEX_HEAPS];
227
228 /* Mechanism to validate card state.
229 */
230 int ctxOwner;
231} drm_mga_sarea_t;
232
233/* MGA specific ioctls
234 * The device specific ioctl range is 0x40 to 0x79.
235 */
236#define DRM_MGA_INIT 0x00
237#define DRM_MGA_FLUSH 0x01
238#define DRM_MGA_RESET 0x02
239#define DRM_MGA_SWAP 0x03
240#define DRM_MGA_CLEAR 0x04
241#define DRM_MGA_VERTEX 0x05
242#define DRM_MGA_INDICES 0x06
243#define DRM_MGA_ILOAD 0x07
244#define DRM_MGA_BLIT 0x08
245#define DRM_MGA_GETPARAM 0x09
246
247/* 3.2:
248 * ioctls for operating on fences.
249 */
250#define DRM_MGA_SET_FENCE 0x0a
251#define DRM_MGA_WAIT_FENCE 0x0b
252#define DRM_MGA_DMA_BOOTSTRAP 0x0c
253
254#define DRM_IOCTL_MGA_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t)
255#define DRM_IOCTL_MGA_FLUSH DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_FLUSH, struct drm_lock)
256#define DRM_IOCTL_MGA_RESET DRM_IO( DRM_COMMAND_BASE + DRM_MGA_RESET)
257#define DRM_IOCTL_MGA_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_MGA_SWAP)
258#define DRM_IOCTL_MGA_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t)
259#define DRM_IOCTL_MGA_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t)
260#define DRM_IOCTL_MGA_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t)
261#define DRM_IOCTL_MGA_ILOAD DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
262#define DRM_IOCTL_MGA_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
263#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
264#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32)
265#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)
266#define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
267
268typedef struct _drm_mga_warp_index {
269 int installed;
270 unsigned long phys_addr;
271 int size;
272} drm_mga_warp_index_t;
273
274typedef struct drm_mga_init {
275 enum {
276 MGA_INIT_DMA = 0x01,
277 MGA_CLEANUP_DMA = 0x02
278 } func;
279
280 unsigned long sarea_priv_offset;
281
282 int chipset;
283 int sgram;
284
285 unsigned int maccess;
286
287 unsigned int fb_cpp;
288 unsigned int front_offset, front_pitch;
289 unsigned int back_offset, back_pitch;
290
291 unsigned int depth_cpp;
292 unsigned int depth_offset, depth_pitch;
293
294 unsigned int texture_offset[MGA_NR_TEX_HEAPS];
295 unsigned int texture_size[MGA_NR_TEX_HEAPS];
296
297 unsigned long fb_offset;
298 unsigned long mmio_offset;
299 unsigned long status_offset;
300 unsigned long warp_offset;
301 unsigned long primary_offset;
302 unsigned long buffers_offset;
303} drm_mga_init_t;
304
305typedef struct drm_mga_dma_bootstrap {
306 /**
307 * \name AGP texture region
308 *
309 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, these fields will
310 * be filled in with the actual AGP texture settings.
311 *
312 * \warning
313 * If these fields are non-zero, but dma_mga_dma_bootstrap::agp_mode
314 * is zero, it means that PCI memory (most likely through the use of
315 * an IOMMU) is being used for "AGP" textures.
316 */
317 /*@{ */
318 unsigned long texture_handle; /**< Handle used to map AGP textures. */
319 __u32 texture_size; /**< Size of the AGP texture region. */
320 /*@} */
321
322 /**
323 * Requested size of the primary DMA region.
324 *
325 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
326 * filled in with the actual AGP mode. If AGP was not available
327 */
328 __u32 primary_size;
329
330 /**
331 * Requested number of secondary DMA buffers.
332 *
333 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
334 * filled in with the actual number of secondary DMA buffers
335 * allocated. Particularly when PCI DMA is used, this may be
336 * (subtantially) less than the number requested.
337 */
338 __u32 secondary_bin_count;
339
340 /**
341 * Requested size of each secondary DMA buffer.
342 *
343 * While the kernel \b is free to reduce
344 * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed
345 * to reduce dma_mga_dma_bootstrap::secondary_bin_size.
346 */
347 __u32 secondary_bin_size;
348
349 /**
350 * Bit-wise mask of AGPSTAT2_* values. Currently only \c AGPSTAT2_1X,
351 * \c AGPSTAT2_2X, and \c AGPSTAT2_4X are supported. If this value is
352 * zero, it means that PCI DMA should be used, even if AGP is
353 * possible.
354 *
355 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
356 * filled in with the actual AGP mode. If AGP was not available
357 * (i.e., PCI DMA was used), this value will be zero.
358 */
359 __u32 agp_mode;
360
361 /**
362 * Desired AGP GART size, measured in megabytes.
363 */
364 __u8 agp_size;
365} drm_mga_dma_bootstrap_t;
366
367typedef struct drm_mga_clear {
368 unsigned int flags;
369 unsigned int clear_color;
370 unsigned int clear_depth;
371 unsigned int color_mask;
372 unsigned int depth_mask;
373} drm_mga_clear_t;
374
375typedef struct drm_mga_vertex {
376 int idx; /* buffer to queue */
377 int used; /* bytes in use */
378 int discard; /* client finished with buffer? */
379} drm_mga_vertex_t;
380
381typedef struct drm_mga_indices {
382 int idx; /* buffer to queue */
383 unsigned int start;
384 unsigned int end;
385 int discard; /* client finished with buffer? */
386} drm_mga_indices_t;
387
388typedef struct drm_mga_iload {
389 int idx;
390 unsigned int dstorg;
391 unsigned int length;
392} drm_mga_iload_t;
393
394typedef struct _drm_mga_blit {
395 unsigned int planemask;
396 unsigned int srcorg;
397 unsigned int dstorg;
398 int src_pitch, dst_pitch;
399 int delta_sx, delta_sy;
400 int delta_dx, delta_dy;
401 int height, ydir; /* flip image vertically */
402 int source_pitch, dest_pitch;
403} drm_mga_blit_t;
404
405/* 3.1: An ioctl to get parameters that aren't available to the 3d
406 * client any other way.
407 */
408#define MGA_PARAM_IRQ_NR 1
409
410/* 3.2: Query the actual card type. The DDX only distinguishes between
411 * G200 chips and non-G200 chips, which it calls G400. It turns out that
412 * there are some very sublte differences between the G4x0 chips and the G550
413 * chips. Using this parameter query, a client-side driver can detect the
414 * difference between a G4x0 and a G550.
415 */
416#define MGA_PARAM_CARD_TYPE 2
417
418typedef struct drm_mga_getparam {
419 int param;
420 void *value;
421} drm_mga_getparam_t;
422
423#if defined(__cplusplus)
424}
425#endif
426
427#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/msm_drm.h deleted-308
...@@ -1,308 +0,0 @@
1/*
2 * Copyright (C) 2013 Red Hat
3 * Author: Rob Clark <robdclark@gmail.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef __MSM_DRM_H__
26#define __MSM_DRM_H__
27
28#include "drm.h"
29
30#if defined(__cplusplus)
31extern "C" {
32#endif
33
34/* Please note that modifications to all structs defined here are
35 * subject to backwards-compatibility constraints:
36 * 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
37 * user/kernel compatibility
38 * 2) Keep fields aligned to their size
39 * 3) Because of how drm_ioctl() works, we can add new fields at
40 * the end of an ioctl if some care is taken: drm_ioctl() will
41 * zero out the new fields at the tail of the ioctl, so a zero
42 * value should have a backwards compatible meaning. And for
43 * output params, userspace won't see the newly added output
44 * fields.. so that has to be somehow ok.
45 */
46
47#define MSM_PIPE_NONE 0x00
48#define MSM_PIPE_2D0 0x01
49#define MSM_PIPE_2D1 0x02
50#define MSM_PIPE_3D0 0x10
51
52/* The pipe-id just uses the lower bits, so can be OR'd with flags in
53 * the upper 16 bits (which could be extended further, if needed, maybe
54 * we extend/overload the pipe-id some day to deal with multiple rings,
55 * but even then I don't think we need the full lower 16 bits).
56 */
57#define MSM_PIPE_ID_MASK 0xffff
58#define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK)
59#define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK)
60
61/* timeouts are specified in clock-monotonic absolute times (to simplify
62 * restarting interrupted ioctls). The following struct is logically the
63 * same as 'struct timespec' but 32/64b ABI safe.
64 */
65struct drm_msm_timespec {
66 __s64 tv_sec; /* seconds */
67 __s64 tv_nsec; /* nanoseconds */
68};
69
70#define MSM_PARAM_GPU_ID 0x01
71#define MSM_PARAM_GMEM_SIZE 0x02
72#define MSM_PARAM_CHIP_ID 0x03
73#define MSM_PARAM_MAX_FREQ 0x04
74#define MSM_PARAM_TIMESTAMP 0x05
75#define MSM_PARAM_GMEM_BASE 0x06
76#define MSM_PARAM_NR_RINGS 0x07
77
78struct drm_msm_param {
79 __u32 pipe; /* in, MSM_PIPE_x */
80 __u32 param; /* in, MSM_PARAM_x */
81 __u64 value; /* out (get_param) or in (set_param) */
82};
83
84/*
85 * GEM buffers:
86 */
87
88#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */
89#define MSM_BO_GPU_READONLY 0x00000002
90#define MSM_BO_CACHE_MASK 0x000f0000
91/* cache modes */
92#define MSM_BO_CACHED 0x00010000
93#define MSM_BO_WC 0x00020000
94#define MSM_BO_UNCACHED 0x00040000
95
96#define MSM_BO_FLAGS (MSM_BO_SCANOUT | \
97 MSM_BO_GPU_READONLY | \
98 MSM_BO_CACHED | \
99 MSM_BO_WC | \
100 MSM_BO_UNCACHED)
101
102struct drm_msm_gem_new {
103 __u64 size; /* in */
104 __u32 flags; /* in, mask of MSM_BO_x */
105 __u32 handle; /* out */
106};
107
108#define MSM_INFO_IOVA 0x01
109
110#define MSM_INFO_FLAGS (MSM_INFO_IOVA)
111
112struct drm_msm_gem_info {
113 __u32 handle; /* in */
114 __u32 flags; /* in - combination of MSM_INFO_* flags */
115 __u64 offset; /* out, mmap() offset or iova */
116};
117
118#define MSM_PREP_READ 0x01
119#define MSM_PREP_WRITE 0x02
120#define MSM_PREP_NOSYNC 0x04
121
122#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
123
124struct drm_msm_gem_cpu_prep {
125 __u32 handle; /* in */
126 __u32 op; /* in, mask of MSM_PREP_x */
127 struct drm_msm_timespec timeout; /* in */
128};
129
130struct drm_msm_gem_cpu_fini {
131 __u32 handle; /* in */
132};
133
134/*
135 * Cmdstream Submission:
136 */
137
138/* The value written into the cmdstream is logically:
139 *
140 * ((relocbuf->gpuaddr + reloc_offset) << shift) | or
141 *
142 * When we have GPU's w/ >32bit ptrs, it should be possible to deal
143 * with this by emit'ing two reloc entries with appropriate shift
144 * values. Or a new MSM_SUBMIT_CMD_x type would also be an option.
145 *
146 * NOTE that reloc's must be sorted by order of increasing submit_offset,
147 * otherwise EINVAL.
148 */
149struct drm_msm_gem_submit_reloc {
150 __u32 submit_offset; /* in, offset from submit_bo */
151 __u32 or; /* in, value OR'd with result */
152 __s32 shift; /* in, amount of left shift (can be negative) */
153 __u32 reloc_idx; /* in, index of reloc_bo buffer */
154 __u64 reloc_offset; /* in, offset from start of reloc_bo */
155};
156
157/* submit-types:
158 * BUF - this cmd buffer is executed normally.
159 * IB_TARGET_BUF - this cmd buffer is an IB target. Reloc's are
160 * processed normally, but the kernel does not setup an IB to
161 * this buffer in the first-level ringbuffer
162 * CTX_RESTORE_BUF - only executed if there has been a GPU context
163 * switch since the last SUBMIT ioctl
164 */
165#define MSM_SUBMIT_CMD_BUF 0x0001
166#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
167#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
168struct drm_msm_gem_submit_cmd {
169 __u32 type; /* in, one of MSM_SUBMIT_CMD_x */
170 __u32 submit_idx; /* in, index of submit_bo cmdstream buffer */
171 __u32 submit_offset; /* in, offset into submit_bo */
172 __u32 size; /* in, cmdstream size */
173 __u32 pad;
174 __u32 nr_relocs; /* in, number of submit_reloc's */
175 __u64 relocs; /* in, ptr to array of submit_reloc's */
176};
177
178/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
179 * cmdstream buffer(s) themselves or reloc entries) has one (and only
180 * one) entry in the submit->bos[] table.
181 *
182 * As a optimization, the current buffer (gpu virtual address) can be
183 * passed back through the 'presumed' field. If on a subsequent reloc,
184 * userspace passes back a 'presumed' address that is still valid,
185 * then patching the cmdstream for this entry is skipped. This can
186 * avoid kernel needing to map/access the cmdstream bo in the common
187 * case.
188 */
189#define MSM_SUBMIT_BO_READ 0x0001
190#define MSM_SUBMIT_BO_WRITE 0x0002
191
192#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
193
194struct drm_msm_gem_submit_bo {
195 __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
196 __u32 handle; /* in, GEM handle */
197 __u64 presumed; /* in/out, presumed buffer address */
198};
199
200/* Valid submit ioctl flags: */
201#define MSM_SUBMIT_NO_IMPLICIT 0x80000000 /* disable implicit sync */
202#define MSM_SUBMIT_FENCE_FD_IN 0x40000000 /* enable input fence_fd */
203#define MSM_SUBMIT_FENCE_FD_OUT 0x20000000 /* enable output fence_fd */
204#define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */
205#define MSM_SUBMIT_FLAGS ( \
206 MSM_SUBMIT_NO_IMPLICIT | \
207 MSM_SUBMIT_FENCE_FD_IN | \
208 MSM_SUBMIT_FENCE_FD_OUT | \
209 MSM_SUBMIT_SUDO | \
210 0)
211
212/* Each cmdstream submit consists of a table of buffers involved, and
213 * one or more cmdstream buffers. This allows for conditional execution
214 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
215 */
216struct drm_msm_gem_submit {
217 __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */
218 __u32 fence; /* out */
219 __u32 nr_bos; /* in, number of submit_bo's */
220 __u32 nr_cmds; /* in, number of submit_cmd's */
221 __u64 bos; /* in, ptr to array of submit_bo's */
222 __u64 cmds; /* in, ptr to array of submit_cmd's */
223 __s32 fence_fd; /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */
224 __u32 queueid; /* in, submitqueue id */
225};
226
227/* The normal way to synchronize with the GPU is just to CPU_PREP on
228 * a buffer if you need to access it from the CPU (other cmdstream
229 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
230 * handle the required synchronization under the hood). This ioctl
231 * mainly just exists as a way to implement the gallium pipe_fence
232 * APIs without requiring a dummy bo to synchronize on.
233 */
234struct drm_msm_wait_fence {
235 __u32 fence; /* in */
236 __u32 pad;
237 struct drm_msm_timespec timeout; /* in */
238 __u32 queueid; /* in, submitqueue id */
239};
240
241/* madvise provides a way to tell the kernel in case a buffers contents
242 * can be discarded under memory pressure, which is useful for userspace
243 * bo cache where we want to optimistically hold on to buffer allocate
244 * and potential mmap, but allow the pages to be discarded under memory
245 * pressure.
246 *
247 * Typical usage would involve madvise(DONTNEED) when buffer enters BO
248 * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
249 * In the WILLNEED case, 'retained' indicates to userspace whether the
250 * backing pages still exist.
251 */
252#define MSM_MADV_WILLNEED 0 /* backing pages are needed, status returned in 'retained' */
253#define MSM_MADV_DONTNEED 1 /* backing pages not needed */
254#define __MSM_MADV_PURGED 2 /* internal state */
255
256struct drm_msm_gem_madvise {
257 __u32 handle; /* in, GEM handle */
258 __u32 madv; /* in, MSM_MADV_x */
259 __u32 retained; /* out, whether backing store still exists */
260};
261
262/*
263 * Draw queues allow the user to set specific submission parameter. Command
264 * submissions specify a specific submitqueue to use. ID 0 is reserved for
265 * backwards compatibility as a "default" submitqueue
266 */
267
268#define MSM_SUBMITQUEUE_FLAGS (0)
269
270struct drm_msm_submitqueue {
271 __u32 flags; /* in, MSM_SUBMITQUEUE_x */
272 __u32 prio; /* in, Priority level */
273 __u32 id; /* out, identifier */
274};
275
276#define DRM_MSM_GET_PARAM 0x00
277/* placeholder:
278#define DRM_MSM_SET_PARAM 0x01
279 */
280#define DRM_MSM_GEM_NEW 0x02
281#define DRM_MSM_GEM_INFO 0x03
282#define DRM_MSM_GEM_CPU_PREP 0x04
283#define DRM_MSM_GEM_CPU_FINI 0x05
284#define DRM_MSM_GEM_SUBMIT 0x06
285#define DRM_MSM_WAIT_FENCE 0x07
286#define DRM_MSM_GEM_MADVISE 0x08
287/* placeholder:
288#define DRM_MSM_GEM_SVM_NEW 0x09
289 */
290#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
291#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
292
293#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
294#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
295#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
296#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
297#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
298#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
299#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
300#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
301#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
302#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
303
304#if defined(__cplusplus)
305}
306#endif
307
308#endif /* __MSM_DRM_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/nouveau_drm.h deleted-152
...@@ -1,152 +0,0 @@
1/*
2 * Copyright 2005 Stephane Marchesin.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef __NOUVEAU_DRM_H__
26#define __NOUVEAU_DRM_H__
27
28#define DRM_NOUVEAU_EVENT_NVIF 0x80000000
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
37#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
38#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
39#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
40#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
41
42#define NOUVEAU_GEM_TILE_COMP 0x00030000 /* nv50-only */
43#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
44#define NOUVEAU_GEM_TILE_16BPP 0x00000001
45#define NOUVEAU_GEM_TILE_32BPP 0x00000002
46#define NOUVEAU_GEM_TILE_ZETA 0x00000004
47#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
48
49struct drm_nouveau_gem_info {
50 __u32 handle;
51 __u32 domain;
52 __u64 size;
53 __u64 offset;
54 __u64 map_handle;
55 __u32 tile_mode;
56 __u32 tile_flags;
57};
58
59struct drm_nouveau_gem_new {
60 struct drm_nouveau_gem_info info;
61 __u32 channel_hint;
62 __u32 align;
63};
64
65#define NOUVEAU_GEM_MAX_BUFFERS 1024
66struct drm_nouveau_gem_pushbuf_bo_presumed {
67 __u32 valid;
68 __u32 domain;
69 __u64 offset;
70};
71
72struct drm_nouveau_gem_pushbuf_bo {
73 __u64 user_priv;
74 __u32 handle;
75 __u32 read_domains;
76 __u32 write_domains;
77 __u32 valid_domains;
78 struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
79};
80
81#define NOUVEAU_GEM_RELOC_LOW (1 << 0)
82#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
83#define NOUVEAU_GEM_RELOC_OR (1 << 2)
84#define NOUVEAU_GEM_MAX_RELOCS 1024
85struct drm_nouveau_gem_pushbuf_reloc {
86 __u32 reloc_bo_index;
87 __u32 reloc_bo_offset;
88 __u32 bo_index;
89 __u32 flags;
90 __u32 data;
91 __u32 vor;
92 __u32 tor;
93};
94
95#define NOUVEAU_GEM_MAX_PUSH 512
96struct drm_nouveau_gem_pushbuf_push {
97 __u32 bo_index;
98 __u32 pad;
99 __u64 offset;
100 __u64 length;
101};
102
103struct drm_nouveau_gem_pushbuf {
104 __u32 channel;
105 __u32 nr_buffers;
106 __u64 buffers;
107 __u32 nr_relocs;
108 __u32 nr_push;
109 __u64 relocs;
110 __u64 push;
111 __u32 suffix0;
112 __u32 suffix1;
113 __u64 vram_available;
114 __u64 gart_available;
115};
116
117#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
118#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
119struct drm_nouveau_gem_cpu_prep {
120 __u32 handle;
121 __u32 flags;
122};
123
124struct drm_nouveau_gem_cpu_fini {
125 __u32 handle;
126};
127
128#define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */
129#define DRM_NOUVEAU_SETPARAM 0x01 /* deprecated */
130#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02 /* deprecated */
131#define DRM_NOUVEAU_CHANNEL_FREE 0x03 /* deprecated */
132#define DRM_NOUVEAU_GROBJ_ALLOC 0x04 /* deprecated */
133#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05 /* deprecated */
134#define DRM_NOUVEAU_GPUOBJ_FREE 0x06 /* deprecated */
135#define DRM_NOUVEAU_NVIF 0x07
136#define DRM_NOUVEAU_GEM_NEW 0x40
137#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
138#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
139#define DRM_NOUVEAU_GEM_CPU_FINI 0x43
140#define DRM_NOUVEAU_GEM_INFO 0x44
141
142#define DRM_IOCTL_NOUVEAU_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_NEW, struct drm_nouveau_gem_new)
143#define DRM_IOCTL_NOUVEAU_GEM_PUSHBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_PUSHBUF, struct drm_nouveau_gem_pushbuf)
144#define DRM_IOCTL_NOUVEAU_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_PREP, struct drm_nouveau_gem_cpu_prep)
145#define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini)
146#define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
147
148#if defined(__cplusplus)
149}
150#endif
151
152#endif /* __NOUVEAU_DRM_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/omap_drm.h deleted-126
...@@ -1,126 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/uapi/drm/omap_drm.h
4 *
5 * Copyright (C) 2011 Texas Instruments
6 * Author: Rob Clark <rob@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __OMAP_DRM_H__
22#define __OMAP_DRM_H__
23
24#include "drm.h"
25
26#if defined(__cplusplus)
27extern "C" {
28#endif
29
30/* Please note that modifications to all structs defined here are
31 * subject to backwards-compatibility constraints.
32 */
33
34#define OMAP_PARAM_CHIPSET_ID 1 /* ie. 0x3430, 0x4430, etc */
35
36struct drm_omap_param {
37 __u64 param; /* in */
38 __u64 value; /* in (set_param), out (get_param) */
39};
40
41#define OMAP_BO_SCANOUT 0x00000001 /* scanout capable (phys contiguous) */
42#define OMAP_BO_CACHE_MASK 0x00000006 /* cache type mask, see cache modes */
43#define OMAP_BO_TILED_MASK 0x00000f00 /* tiled mapping mask, see tiled modes */
44
45/* cache modes */
46#define OMAP_BO_CACHED 0x00000000 /* default */
47#define OMAP_BO_WC 0x00000002 /* write-combine */
48#define OMAP_BO_UNCACHED 0x00000004 /* strongly-ordered (uncached) */
49
50/* tiled modes */
51#define OMAP_BO_TILED_8 0x00000100
52#define OMAP_BO_TILED_16 0x00000200
53#define OMAP_BO_TILED_32 0x00000300
54#define OMAP_BO_TILED (OMAP_BO_TILED_8 | OMAP_BO_TILED_16 | OMAP_BO_TILED_32)
55
56union omap_gem_size {
57 __u32 bytes; /* (for non-tiled formats) */
58 struct {
59 __u16 width;
60 __u16 height;
61 } tiled; /* (for tiled formats) */
62};
63
64struct drm_omap_gem_new {
65 union omap_gem_size size; /* in */
66 __u32 flags; /* in */
67 __u32 handle; /* out */
68 __u32 __pad;
69};
70
71/* mask of operations: */
72enum omap_gem_op {
73 OMAP_GEM_READ = 0x01,
74 OMAP_GEM_WRITE = 0x02,
75};
76
77struct drm_omap_gem_cpu_prep {
78 __u32 handle; /* buffer handle (in) */
79 __u32 op; /* mask of omap_gem_op (in) */
80};
81
82struct drm_omap_gem_cpu_fini {
83 __u32 handle; /* buffer handle (in) */
84 __u32 op; /* mask of omap_gem_op (in) */
85 /* TODO maybe here we pass down info about what regions are touched
86 * by sw so we can be clever about cache ops? For now a placeholder,
87 * set to zero and we just do full buffer flush..
88 */
89 __u32 nregions;
90 __u32 __pad;
91};
92
93struct drm_omap_gem_info {
94 __u32 handle; /* buffer handle (in) */
95 __u32 pad;
96 __u64 offset; /* mmap offset (out) */
97 /* note: in case of tiled buffers, the user virtual size can be
98 * different from the physical size (ie. how many pages are needed
99 * to back the object) which is returned in DRM_IOCTL_GEM_OPEN..
100 * This size here is the one that should be used if you want to
101 * mmap() the buffer:
102 */
103 __u32 size; /* virtual size for mmap'ing (out) */
104 __u32 __pad;
105};
106
107#define DRM_OMAP_GET_PARAM 0x00
108#define DRM_OMAP_SET_PARAM 0x01
109#define DRM_OMAP_GEM_NEW 0x03
110#define DRM_OMAP_GEM_CPU_PREP 0x04 /* Deprecated, to be removed */
111#define DRM_OMAP_GEM_CPU_FINI 0x05 /* Deprecated, to be removed */
112#define DRM_OMAP_GEM_INFO 0x06
113#define DRM_OMAP_NUM_IOCTLS 0x07
114
115#define DRM_IOCTL_OMAP_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param)
116#define DRM_IOCTL_OMAP_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param)
117#define DRM_IOCTL_OMAP_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new)
118#define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep)
119#define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini)
120#define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info)
121
122#if defined(__cplusplus)
123}
124#endif
125
126#endif /* __OMAP_DRM_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/qxl_drm.h deleted-158
...@@ -1,158 +0,0 @@
1/*
2 * Copyright 2013 Red Hat
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24#ifndef QXL_DRM_H
25#define QXL_DRM_H
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* Please note that modifications to all structs defined here are
34 * subject to backwards-compatibility constraints.
35 *
36 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
37 * compatibility Keep fields aligned to their size
38 */
39
40#define QXL_GEM_DOMAIN_CPU 0
41#define QXL_GEM_DOMAIN_VRAM 1
42#define QXL_GEM_DOMAIN_SURFACE 2
43
44#define DRM_QXL_ALLOC 0x00
45#define DRM_QXL_MAP 0x01
46#define DRM_QXL_EXECBUFFER 0x02
47#define DRM_QXL_UPDATE_AREA 0x03
48#define DRM_QXL_GETPARAM 0x04
49#define DRM_QXL_CLIENTCAP 0x05
50
51#define DRM_QXL_ALLOC_SURF 0x06
52
53struct drm_qxl_alloc {
54 __u32 size;
55 __u32 handle; /* 0 is an invalid handle */
56};
57
58struct drm_qxl_map {
59 __u64 offset; /* use for mmap system call */
60 __u32 handle;
61 __u32 pad;
62};
63
64/*
65 * dest is the bo we are writing the relocation into
66 * src is bo we are relocating.
67 * *(dest_handle.base_addr + dest_offset) = physical_address(src_handle.addr +
68 * src_offset)
69 */
70#define QXL_RELOC_TYPE_BO 1
71#define QXL_RELOC_TYPE_SURF 2
72
73struct drm_qxl_reloc {
74 __u64 src_offset; /* offset into src_handle or src buffer */
75 __u64 dst_offset; /* offset in dest handle */
76 __u32 src_handle; /* dest handle to compute address from */
77 __u32 dst_handle; /* 0 if to command buffer */
78 __u32 reloc_type;
79 __u32 pad;
80};
81
82struct drm_qxl_command {
83 __u64 command; /* void* */
84 __u64 relocs; /* struct drm_qxl_reloc* */
85 __u32 type;
86 __u32 command_size;
87 __u32 relocs_num;
88 __u32 pad;
89};
90
91struct drm_qxl_execbuffer {
92 __u32 flags; /* for future use */
93 __u32 commands_num;
94 __u64 commands; /* struct drm_qxl_command* */
95};
96
97struct drm_qxl_update_area {
98 __u32 handle;
99 __u32 top;
100 __u32 left;
101 __u32 bottom;
102 __u32 right;
103 __u32 pad;
104};
105
106#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
107#define QXL_PARAM_MAX_RELOCS 2
108struct drm_qxl_getparam {
109 __u64 param;
110 __u64 value;
111};
112
113/* these are one bit values */
114struct drm_qxl_clientcap {
115 __u32 index;
116 __u32 pad;
117};
118
119struct drm_qxl_alloc_surf {
120 __u32 format;
121 __u32 width;
122 __u32 height;
123 __s32 stride;
124 __u32 handle;
125 __u32 pad;
126};
127
128#define DRM_IOCTL_QXL_ALLOC \
129 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC, struct drm_qxl_alloc)
130
131#define DRM_IOCTL_QXL_MAP \
132 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_MAP, struct drm_qxl_map)
133
134#define DRM_IOCTL_QXL_EXECBUFFER \
135 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_EXECBUFFER,\
136 struct drm_qxl_execbuffer)
137
138#define DRM_IOCTL_QXL_UPDATE_AREA \
139 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_UPDATE_AREA,\
140 struct drm_qxl_update_area)
141
142#define DRM_IOCTL_QXL_GETPARAM \
143 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_GETPARAM,\
144 struct drm_qxl_getparam)
145
146#define DRM_IOCTL_QXL_CLIENTCAP \
147 DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP,\
148 struct drm_qxl_clientcap)
149
150#define DRM_IOCTL_QXL_ALLOC_SURF \
151 DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\
152 struct drm_qxl_alloc_surf)
153
154#if defined(__cplusplus)
155}
156#endif
157
158#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/r128_drm.h deleted-336
...@@ -1,336 +0,0 @@
1/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
2 * Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com
3 */
4/*
5 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
7 * All rights reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 *
28 * Authors:
29 * Gareth Hughes <gareth@valinux.com>
30 * Kevin E. Martin <martin@valinux.com>
31 */
32
33#ifndef __R128_DRM_H__
34#define __R128_DRM_H__
35
36#include "drm.h"
37
38#if defined(__cplusplus)
39extern "C" {
40#endif
41
42/* WARNING: If you change any of these defines, make sure to change the
43 * defines in the X server file (r128_sarea.h)
44 */
45#ifndef __R128_SAREA_DEFINES__
46#define __R128_SAREA_DEFINES__
47
48/* What needs to be changed for the current vertex buffer?
49 */
50#define R128_UPLOAD_CONTEXT 0x001
51#define R128_UPLOAD_SETUP 0x002
52#define R128_UPLOAD_TEX0 0x004
53#define R128_UPLOAD_TEX1 0x008
54#define R128_UPLOAD_TEX0IMAGES 0x010
55#define R128_UPLOAD_TEX1IMAGES 0x020
56#define R128_UPLOAD_CORE 0x040
57#define R128_UPLOAD_MASKS 0x080
58#define R128_UPLOAD_WINDOW 0x100
59#define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
60#define R128_REQUIRE_QUIESCENCE 0x400
61#define R128_UPLOAD_ALL 0x7ff
62
63#define R128_FRONT 0x1
64#define R128_BACK 0x2
65#define R128_DEPTH 0x4
66
67/* Primitive types
68 */
69#define R128_POINTS 0x1
70#define R128_LINES 0x2
71#define R128_LINE_STRIP 0x3
72#define R128_TRIANGLES 0x4
73#define R128_TRIANGLE_FAN 0x5
74#define R128_TRIANGLE_STRIP 0x6
75
76/* Vertex/indirect buffer size
77 */
78#define R128_BUFFER_SIZE 16384
79
80/* Byte offsets for indirect buffer data
81 */
82#define R128_INDEX_PRIM_OFFSET 20
83#define R128_HOSTDATA_BLIT_OFFSET 32
84
85/* Keep these small for testing.
86 */
87#define R128_NR_SAREA_CLIPRECTS 12
88
89/* There are 2 heaps (local/AGP). Each region within a heap is a
90 * minimum of 64k, and there are at most 64 of them per heap.
91 */
92#define R128_LOCAL_TEX_HEAP 0
93#define R128_AGP_TEX_HEAP 1
94#define R128_NR_TEX_HEAPS 2
95#define R128_NR_TEX_REGIONS 64
96#define R128_LOG_TEX_GRANULARITY 16
97
98#define R128_NR_CONTEXT_REGS 12
99
100#define R128_MAX_TEXTURE_LEVELS 11
101#define R128_MAX_TEXTURE_UNITS 2
102
103#endif /* __R128_SAREA_DEFINES__ */
104
105typedef struct {
106 /* Context state - can be written in one large chunk */
107 unsigned int dst_pitch_offset_c;
108 unsigned int dp_gui_master_cntl_c;
109 unsigned int sc_top_left_c;
110 unsigned int sc_bottom_right_c;
111 unsigned int z_offset_c;
112 unsigned int z_pitch_c;
113 unsigned int z_sten_cntl_c;
114 unsigned int tex_cntl_c;
115 unsigned int misc_3d_state_cntl_reg;
116 unsigned int texture_clr_cmp_clr_c;
117 unsigned int texture_clr_cmp_msk_c;
118 unsigned int fog_color_c;
119
120 /* Texture state */
121 unsigned int tex_size_pitch_c;
122 unsigned int constant_color_c;
123
124 /* Setup state */
125 unsigned int pm4_vc_fpu_setup;
126 unsigned int setup_cntl;
127
128 /* Mask state */
129 unsigned int dp_write_mask;
130 unsigned int sten_ref_mask_c;
131 unsigned int plane_3d_mask_c;
132
133 /* Window state */
134 unsigned int window_xy_offset;
135
136 /* Core state */
137 unsigned int scale_3d_cntl;
138} drm_r128_context_regs_t;
139
140/* Setup registers for each texture unit
141 */
142typedef struct {
143 unsigned int tex_cntl;
144 unsigned int tex_combine_cntl;
145 unsigned int tex_size_pitch;
146 unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
147 unsigned int tex_border_color;
148} drm_r128_texture_regs_t;
149
150typedef struct drm_r128_sarea {
151 /* The channel for communication of state information to the kernel
152 * on firing a vertex buffer.
153 */
154 drm_r128_context_regs_t context_state;
155 drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS];
156 unsigned int dirty;
157 unsigned int vertsize;
158 unsigned int vc_format;
159
160 /* The current cliprects, or a subset thereof.
161 */
162 struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
163 unsigned int nbox;
164
165 /* Counters for client-side throttling of rendering clients.
166 */
167 unsigned int last_frame;
168 unsigned int last_dispatch;
169
170 struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
171 unsigned int tex_age[R128_NR_TEX_HEAPS];
172 int ctx_owner;
173 int pfAllowPageFlip; /* number of 3d windows (0,1,2 or more) */
174 int pfCurrentPage; /* which buffer is being displayed? */
175} drm_r128_sarea_t;
176
177/* WARNING: If you change any of these defines, make sure to change the
178 * defines in the Xserver file (xf86drmR128.h)
179 */
180
181/* Rage 128 specific ioctls
182 * The device specific ioctl range is 0x40 to 0x79.
183 */
184#define DRM_R128_INIT 0x00
185#define DRM_R128_CCE_START 0x01
186#define DRM_R128_CCE_STOP 0x02
187#define DRM_R128_CCE_RESET 0x03
188#define DRM_R128_CCE_IDLE 0x04
189/* 0x05 not used */
190#define DRM_R128_RESET 0x06
191#define DRM_R128_SWAP 0x07
192#define DRM_R128_CLEAR 0x08
193#define DRM_R128_VERTEX 0x09
194#define DRM_R128_INDICES 0x0a
195#define DRM_R128_BLIT 0x0b
196#define DRM_R128_DEPTH 0x0c
197#define DRM_R128_STIPPLE 0x0d
198/* 0x0e not used */
199#define DRM_R128_INDIRECT 0x0f
200#define DRM_R128_FULLSCREEN 0x10
201#define DRM_R128_CLEAR2 0x11
202#define DRM_R128_GETPARAM 0x12
203#define DRM_R128_FLIP 0x13
204
205#define DRM_IOCTL_R128_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
206#define DRM_IOCTL_R128_CCE_START DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_START)
207#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
208#define DRM_IOCTL_R128_CCE_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
209#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
210/* 0x05 not used */
211#define DRM_IOCTL_R128_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_RESET)
212#define DRM_IOCTL_R128_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_R128_SWAP)
213#define DRM_IOCTL_R128_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
214#define DRM_IOCTL_R128_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
215#define DRM_IOCTL_R128_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
216#define DRM_IOCTL_R128_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
217#define DRM_IOCTL_R128_DEPTH DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
218#define DRM_IOCTL_R128_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
219/* 0x0e not used */
220#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
221#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
222#define DRM_IOCTL_R128_CLEAR2 DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
223#define DRM_IOCTL_R128_GETPARAM DRM_IOWR( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
224#define DRM_IOCTL_R128_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_R128_FLIP)
225
226typedef struct drm_r128_init {
227 enum {
228 R128_INIT_CCE = 0x01,
229 R128_CLEANUP_CCE = 0x02
230 } func;
231 unsigned long sarea_priv_offset;
232 int is_pci;
233 int cce_mode;
234 int cce_secure;
235 int ring_size;
236 int usec_timeout;
237
238 unsigned int fb_bpp;
239 unsigned int front_offset, front_pitch;
240 unsigned int back_offset, back_pitch;
241 unsigned int depth_bpp;
242 unsigned int depth_offset, depth_pitch;
243 unsigned int span_offset;
244
245 unsigned long fb_offset;
246 unsigned long mmio_offset;
247 unsigned long ring_offset;
248 unsigned long ring_rptr_offset;
249 unsigned long buffers_offset;
250 unsigned long agp_textures_offset;
251} drm_r128_init_t;
252
253typedef struct drm_r128_cce_stop {
254 int flush;
255 int idle;
256} drm_r128_cce_stop_t;
257
258typedef struct drm_r128_clear {
259 unsigned int flags;
260 unsigned int clear_color;
261 unsigned int clear_depth;
262 unsigned int color_mask;
263 unsigned int depth_mask;
264} drm_r128_clear_t;
265
266typedef struct drm_r128_vertex {
267 int prim;
268 int idx; /* Index of vertex buffer */
269 int count; /* Number of vertices in buffer */
270 int discard; /* Client finished with buffer? */
271} drm_r128_vertex_t;
272
273typedef struct drm_r128_indices {
274 int prim;
275 int idx;
276 int start;
277 int end;
278 int discard; /* Client finished with buffer? */
279} drm_r128_indices_t;
280
281typedef struct drm_r128_blit {
282 int idx;
283 int pitch;
284 int offset;
285 int format;
286 unsigned short x, y;
287 unsigned short width, height;
288} drm_r128_blit_t;
289
290typedef struct drm_r128_depth {
291 enum {
292 R128_WRITE_SPAN = 0x01,
293 R128_WRITE_PIXELS = 0x02,
294 R128_READ_SPAN = 0x03,
295 R128_READ_PIXELS = 0x04
296 } func;
297 int n;
298 int *x;
299 int *y;
300 unsigned int *buffer;
301 unsigned char *mask;
302} drm_r128_depth_t;
303
304typedef struct drm_r128_stipple {
305 unsigned int *mask;
306} drm_r128_stipple_t;
307
308typedef struct drm_r128_indirect {
309 int idx;
310 int start;
311 int end;
312 int discard;
313} drm_r128_indirect_t;
314
315typedef struct drm_r128_fullscreen {
316 enum {
317 R128_INIT_FULLSCREEN = 0x01,
318 R128_CLEANUP_FULLSCREEN = 0x02
319 } func;
320} drm_r128_fullscreen_t;
321
322/* 2.3: An ioctl to get parameters that aren't available to the 3d
323 * client any other way.
324 */
325#define R128_PARAM_IRQ_NR 1
326
327typedef struct drm_r128_getparam {
328 int param;
329 void *value;
330} drm_r128_getparam_t;
331
332#if defined(__cplusplus)
333}
334#endif
335
336#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/radeon_drm.h deleted-1078
...@@ -1,1078 +0,0 @@
1/* radeon_drm.h -- Public header for the radeon driver -*- linux-c -*-
2 *
3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
5 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
26 *
27 * Authors:
28 * Kevin E. Martin <martin@valinux.com>
29 * Gareth Hughes <gareth@valinux.com>
30 * Keith Whitwell <keith@tungstengraphics.com>
31 */
32
33#ifndef __RADEON_DRM_H__
34#define __RADEON_DRM_H__
35
36#include "drm.h"
37
38#if defined(__cplusplus)
39extern "C" {
40#endif
41
42/* WARNING: If you change any of these defines, make sure to change the
43 * defines in the X server file (radeon_sarea.h)
44 */
45#ifndef __RADEON_SAREA_DEFINES__
46#define __RADEON_SAREA_DEFINES__
47
48/* Old style state flags, required for sarea interface (1.1 and 1.2
49 * clears) and 1.2 drm_vertex2 ioctl.
50 */
51#define RADEON_UPLOAD_CONTEXT 0x00000001
52#define RADEON_UPLOAD_VERTFMT 0x00000002
53#define RADEON_UPLOAD_LINE 0x00000004
54#define RADEON_UPLOAD_BUMPMAP 0x00000008
55#define RADEON_UPLOAD_MASKS 0x00000010
56#define RADEON_UPLOAD_VIEWPORT 0x00000020
57#define RADEON_UPLOAD_SETUP 0x00000040
58#define RADEON_UPLOAD_TCL 0x00000080
59#define RADEON_UPLOAD_MISC 0x00000100
60#define RADEON_UPLOAD_TEX0 0x00000200
61#define RADEON_UPLOAD_TEX1 0x00000400
62#define RADEON_UPLOAD_TEX2 0x00000800
63#define RADEON_UPLOAD_TEX0IMAGES 0x00001000
64#define RADEON_UPLOAD_TEX1IMAGES 0x00002000
65#define RADEON_UPLOAD_TEX2IMAGES 0x00004000
66#define RADEON_UPLOAD_CLIPRECTS 0x00008000 /* handled client-side */
67#define RADEON_REQUIRE_QUIESCENCE 0x00010000
68#define RADEON_UPLOAD_ZBIAS 0x00020000 /* version 1.2 and newer */
69#define RADEON_UPLOAD_ALL 0x003effff
70#define RADEON_UPLOAD_CONTEXT_ALL 0x003e01ff
71
72/* New style per-packet identifiers for use in cmd_buffer ioctl with
73 * the RADEON_EMIT_PACKET command. Comments relate new packets to old
74 * state bits and the packet size:
75 */
76#define RADEON_EMIT_PP_MISC 0 /* context/7 */
77#define RADEON_EMIT_PP_CNTL 1 /* context/3 */
78#define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */
79#define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */
80#define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */
81#define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */
82#define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */
83#define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */
84#define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */
85#define RADEON_EMIT_SE_CNTL 9 /* setup/2 */
86#define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */
87#define RADEON_EMIT_RE_MISC 11 /* misc/1 */
88#define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */
89#define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */
90#define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */
91#define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */
92#define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */
93#define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */
94#define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */
95#define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */
96#define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */
97#define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */
98#define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */
99#define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */
100#define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */
101#define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */
102#define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */
103#define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */
104#define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */
105#define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/7 */
106#define R200_EMIT_TFACTOR_0 30 /* tf/7 */
107#define R200_EMIT_VTX_FMT_0 31 /* vtx/5 */
108#define R200_EMIT_VAP_CTL 32 /* vap/1 */
109#define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */
110#define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */
111#define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */
112#define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */
113#define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */
114#define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */
115#define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */
116#define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */
117#define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */
118#define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */
119#define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */
120#define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */
121#define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */
122#define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */
123#define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */
124#define R200_EMIT_VTE_CNTL 48 /* vte/1 */
125#define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */
126#define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */
127#define R200_EMIT_PP_CNTL_X 51 /* cst/1 */
128#define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */
129#define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */
130#define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */
131#define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */
132#define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */
133#define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */
134#define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */
135#define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */
136#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */
137#define R200_EMIT_PP_CUBIC_FACES_0 61
138#define R200_EMIT_PP_CUBIC_OFFSETS_0 62
139#define R200_EMIT_PP_CUBIC_FACES_1 63
140#define R200_EMIT_PP_CUBIC_OFFSETS_1 64
141#define R200_EMIT_PP_CUBIC_FACES_2 65
142#define R200_EMIT_PP_CUBIC_OFFSETS_2 66
143#define R200_EMIT_PP_CUBIC_FACES_3 67
144#define R200_EMIT_PP_CUBIC_OFFSETS_3 68
145#define R200_EMIT_PP_CUBIC_FACES_4 69
146#define R200_EMIT_PP_CUBIC_OFFSETS_4 70
147#define R200_EMIT_PP_CUBIC_FACES_5 71
148#define R200_EMIT_PP_CUBIC_OFFSETS_5 72
149#define RADEON_EMIT_PP_TEX_SIZE_0 73
150#define RADEON_EMIT_PP_TEX_SIZE_1 74
151#define RADEON_EMIT_PP_TEX_SIZE_2 75
152#define R200_EMIT_RB3D_BLENDCOLOR 76
153#define R200_EMIT_TCL_POINT_SPRITE_CNTL 77
154#define RADEON_EMIT_PP_CUBIC_FACES_0 78
155#define RADEON_EMIT_PP_CUBIC_OFFSETS_T0 79
156#define RADEON_EMIT_PP_CUBIC_FACES_1 80
157#define RADEON_EMIT_PP_CUBIC_OFFSETS_T1 81
158#define RADEON_EMIT_PP_CUBIC_FACES_2 82
159#define RADEON_EMIT_PP_CUBIC_OFFSETS_T2 83
160#define R200_EMIT_PP_TRI_PERF_CNTL 84
161#define R200_EMIT_PP_AFS_0 85
162#define R200_EMIT_PP_AFS_1 86
163#define R200_EMIT_ATF_TFACTOR 87
164#define R200_EMIT_PP_TXCTLALL_0 88
165#define R200_EMIT_PP_TXCTLALL_1 89
166#define R200_EMIT_PP_TXCTLALL_2 90
167#define R200_EMIT_PP_TXCTLALL_3 91
168#define R200_EMIT_PP_TXCTLALL_4 92
169#define R200_EMIT_PP_TXCTLALL_5 93
170#define R200_EMIT_VAP_PVS_CNTL 94
171#define RADEON_MAX_STATE_PACKETS 95
172
173/* Commands understood by cmd_buffer ioctl. More can be added but
174 * obviously these can't be removed or changed:
175 */
176#define RADEON_CMD_PACKET 1 /* emit one of the register packets above */
177#define RADEON_CMD_SCALARS 2 /* emit scalar data */
178#define RADEON_CMD_VECTORS 3 /* emit vector data */
179#define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */
180#define RADEON_CMD_PACKET3 5 /* emit hw packet */
181#define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */
182#define RADEON_CMD_SCALARS2 7 /* r200 stopgap */
183#define RADEON_CMD_WAIT 8 /* emit hw wait commands -- note:
184 * doesn't make the cpu wait, just
185 * the graphics hardware */
186#define RADEON_CMD_VECLINEAR 9 /* another r200 stopgap */
187
188typedef union {
189 int i;
190 struct {
191 unsigned char cmd_type, pad0, pad1, pad2;
192 } header;
193 struct {
194 unsigned char cmd_type, packet_id, pad0, pad1;
195 } packet;
196 struct {
197 unsigned char cmd_type, offset, stride, count;
198 } scalars;
199 struct {
200 unsigned char cmd_type, offset, stride, count;
201 } vectors;
202 struct {
203 unsigned char cmd_type, addr_lo, addr_hi, count;
204 } veclinear;
205 struct {
206 unsigned char cmd_type, buf_idx, pad0, pad1;
207 } dma;
208 struct {
209 unsigned char cmd_type, flags, pad0, pad1;
210 } wait;
211} drm_radeon_cmd_header_t;
212
213#define RADEON_WAIT_2D 0x1
214#define RADEON_WAIT_3D 0x2
215
216/* Allowed parameters for R300_CMD_PACKET3
217 */
218#define R300_CMD_PACKET3_CLEAR 0
219#define R300_CMD_PACKET3_RAW 1
220
221/* Commands understood by cmd_buffer ioctl for R300.
222 * The interface has not been stabilized, so some of these may be removed
223 * and eventually reordered before stabilization.
224 */
225#define R300_CMD_PACKET0 1
226#define R300_CMD_VPU 2 /* emit vertex program upload */
227#define R300_CMD_PACKET3 3 /* emit a packet3 */
228#define R300_CMD_END3D 4 /* emit sequence ending 3d rendering */
229#define R300_CMD_CP_DELAY 5
230#define R300_CMD_DMA_DISCARD 6
231#define R300_CMD_WAIT 7
232# define R300_WAIT_2D 0x1
233# define R300_WAIT_3D 0x2
234/* these two defines are DOING IT WRONG - however
235 * we have userspace which relies on using these.
236 * The wait interface is backwards compat new
237 * code should use the NEW_WAIT defines below
238 * THESE ARE NOT BIT FIELDS
239 */
240# define R300_WAIT_2D_CLEAN 0x3
241# define R300_WAIT_3D_CLEAN 0x4
242
243# define R300_NEW_WAIT_2D_3D 0x3
244# define R300_NEW_WAIT_2D_2D_CLEAN 0x4
245# define R300_NEW_WAIT_3D_3D_CLEAN 0x6
246# define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8
247
248#define R300_CMD_SCRATCH 8
249#define R300_CMD_R500FP 9
250
251typedef union {
252 unsigned int u;
253 struct {
254 unsigned char cmd_type, pad0, pad1, pad2;
255 } header;
256 struct {
257 unsigned char cmd_type, count, reglo, reghi;
258 } packet0;
259 struct {
260 unsigned char cmd_type, count, adrlo, adrhi;
261 } vpu;
262 struct {
263 unsigned char cmd_type, packet, pad0, pad1;
264 } packet3;
265 struct {
266 unsigned char cmd_type, packet;
267 unsigned short count; /* amount of packet2 to emit */
268 } delay;
269 struct {
270 unsigned char cmd_type, buf_idx, pad0, pad1;
271 } dma;
272 struct {
273 unsigned char cmd_type, flags, pad0, pad1;
274 } wait;
275 struct {
276 unsigned char cmd_type, reg, n_bufs, flags;
277 } scratch;
278 struct {
279 unsigned char cmd_type, count, adrlo, adrhi_flags;
280 } r500fp;
281} drm_r300_cmd_header_t;
282
283#define RADEON_FRONT 0x1
284#define RADEON_BACK 0x2
285#define RADEON_DEPTH 0x4
286#define RADEON_STENCIL 0x8
287#define RADEON_CLEAR_FASTZ 0x80000000
288#define RADEON_USE_HIERZ 0x40000000
289#define RADEON_USE_COMP_ZBUF 0x20000000
290
291#define R500FP_CONSTANT_TYPE (1 << 1)
292#define R500FP_CONSTANT_CLAMP (1 << 2)
293
294/* Primitive types
295 */
296#define RADEON_POINTS 0x1
297#define RADEON_LINES 0x2
298#define RADEON_LINE_STRIP 0x3
299#define RADEON_TRIANGLES 0x4
300#define RADEON_TRIANGLE_FAN 0x5
301#define RADEON_TRIANGLE_STRIP 0x6
302
303/* Vertex/indirect buffer size
304 */
305#define RADEON_BUFFER_SIZE 65536
306
307/* Byte offsets for indirect buffer data
308 */
309#define RADEON_INDEX_PRIM_OFFSET 20
310
311#define RADEON_SCRATCH_REG_OFFSET 32
312
313#define R600_SCRATCH_REG_OFFSET 256
314
315#define RADEON_NR_SAREA_CLIPRECTS 12
316
317/* There are 2 heaps (local/GART). Each region within a heap is a
318 * minimum of 64k, and there are at most 64 of them per heap.
319 */
320#define RADEON_LOCAL_TEX_HEAP 0
321#define RADEON_GART_TEX_HEAP 1
322#define RADEON_NR_TEX_HEAPS 2
323#define RADEON_NR_TEX_REGIONS 64
324#define RADEON_LOG_TEX_GRANULARITY 16
325
326#define RADEON_MAX_TEXTURE_LEVELS 12
327#define RADEON_MAX_TEXTURE_UNITS 3
328
329#define RADEON_MAX_SURFACES 8
330
331/* Blits have strict offset rules. All blit offset must be aligned on
332 * a 1K-byte boundary.
333 */
334#define RADEON_OFFSET_SHIFT 10
335#define RADEON_OFFSET_ALIGN (1 << RADEON_OFFSET_SHIFT)
336#define RADEON_OFFSET_MASK (RADEON_OFFSET_ALIGN - 1)
337
338#endif /* __RADEON_SAREA_DEFINES__ */
339
340typedef struct {
341 unsigned int red;
342 unsigned int green;
343 unsigned int blue;
344 unsigned int alpha;
345} radeon_color_regs_t;
346
347typedef struct {
348 /* Context state */
349 unsigned int pp_misc; /* 0x1c14 */
350 unsigned int pp_fog_color;
351 unsigned int re_solid_color;
352 unsigned int rb3d_blendcntl;
353 unsigned int rb3d_depthoffset;
354 unsigned int rb3d_depthpitch;
355 unsigned int rb3d_zstencilcntl;
356
357 unsigned int pp_cntl; /* 0x1c38 */
358 unsigned int rb3d_cntl;
359 unsigned int rb3d_coloroffset;
360 unsigned int re_width_height;
361 unsigned int rb3d_colorpitch;
362 unsigned int se_cntl;
363
364 /* Vertex format state */
365 unsigned int se_coord_fmt; /* 0x1c50 */
366
367 /* Line state */
368 unsigned int re_line_pattern; /* 0x1cd0 */
369 unsigned int re_line_state;
370
371 unsigned int se_line_width; /* 0x1db8 */
372
373 /* Bumpmap state */
374 unsigned int pp_lum_matrix; /* 0x1d00 */
375
376 unsigned int pp_rot_matrix_0; /* 0x1d58 */
377 unsigned int pp_rot_matrix_1;
378
379 /* Mask state */
380 unsigned int rb3d_stencilrefmask; /* 0x1d7c */
381 unsigned int rb3d_ropcntl;
382 unsigned int rb3d_planemask;
383
384 /* Viewport state */
385 unsigned int se_vport_xscale; /* 0x1d98 */
386 unsigned int se_vport_xoffset;
387 unsigned int se_vport_yscale;
388 unsigned int se_vport_yoffset;
389 unsigned int se_vport_zscale;
390 unsigned int se_vport_zoffset;
391
392 /* Setup state */
393 unsigned int se_cntl_status; /* 0x2140 */
394
395 /* Misc state */
396 unsigned int re_top_left; /* 0x26c0 */
397 unsigned int re_misc;
398} drm_radeon_context_regs_t;
399
400typedef struct {
401 /* Zbias state */
402 unsigned int se_zbias_factor; /* 0x1dac */
403 unsigned int se_zbias_constant;
404} drm_radeon_context2_regs_t;
405
406/* Setup registers for each texture unit
407 */
408typedef struct {
409 unsigned int pp_txfilter;
410 unsigned int pp_txformat;
411 unsigned int pp_txoffset;
412 unsigned int pp_txcblend;
413 unsigned int pp_txablend;
414 unsigned int pp_tfactor;
415 unsigned int pp_border_color;
416} drm_radeon_texture_regs_t;
417
418typedef struct {
419 unsigned int start;
420 unsigned int finish;
421 unsigned int prim:8;
422 unsigned int stateidx:8;
423 unsigned int numverts:16; /* overloaded as offset/64 for elt prims */
424 unsigned int vc_format; /* vertex format */
425} drm_radeon_prim_t;
426
427typedef struct {
428 drm_radeon_context_regs_t context;
429 drm_radeon_texture_regs_t tex[RADEON_MAX_TEXTURE_UNITS];
430 drm_radeon_context2_regs_t context2;
431 unsigned int dirty;
432} drm_radeon_state_t;
433
434typedef struct {
435 /* The channel for communication of state information to the
436 * kernel on firing a vertex buffer with either of the
437 * obsoleted vertex/index ioctls.
438 */
439 drm_radeon_context_regs_t context_state;
440 drm_radeon_texture_regs_t tex_state[RADEON_MAX_TEXTURE_UNITS];
441 unsigned int dirty;
442 unsigned int vertsize;
443 unsigned int vc_format;
444
445 /* The current cliprects, or a subset thereof.
446 */
447 struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
448 unsigned int nbox;
449
450 /* Counters for client-side throttling of rendering clients.
451 */
452 unsigned int last_frame;
453 unsigned int last_dispatch;
454 unsigned int last_clear;
455
456 struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
457 1];
458 unsigned int tex_age[RADEON_NR_TEX_HEAPS];
459 int ctx_owner;
460 int pfState; /* number of 3d windows (0,1,2ormore) */
461 int pfCurrentPage; /* which buffer is being displayed? */
462 int crtc2_base; /* CRTC2 frame offset */
463 int tiling_enabled; /* set by drm, read by 2d + 3d clients */
464} drm_radeon_sarea_t;
465
466/* WARNING: If you change any of these defines, make sure to change the
467 * defines in the Xserver file (xf86drmRadeon.h)
468 *
469 * KW: actually it's illegal to change any of this (backwards compatibility).
470 */
471
472/* Radeon specific ioctls
473 * The device specific ioctl range is 0x40 to 0x79.
474 */
475#define DRM_RADEON_CP_INIT 0x00
476#define DRM_RADEON_CP_START 0x01
477#define DRM_RADEON_CP_STOP 0x02
478#define DRM_RADEON_CP_RESET 0x03
479#define DRM_RADEON_CP_IDLE 0x04
480#define DRM_RADEON_RESET 0x05
481#define DRM_RADEON_FULLSCREEN 0x06
482#define DRM_RADEON_SWAP 0x07
483#define DRM_RADEON_CLEAR 0x08
484#define DRM_RADEON_VERTEX 0x09
485#define DRM_RADEON_INDICES 0x0A
486#define DRM_RADEON_NOT_USED
487#define DRM_RADEON_STIPPLE 0x0C
488#define DRM_RADEON_INDIRECT 0x0D
489#define DRM_RADEON_TEXTURE 0x0E
490#define DRM_RADEON_VERTEX2 0x0F
491#define DRM_RADEON_CMDBUF 0x10
492#define DRM_RADEON_GETPARAM 0x11
493#define DRM_RADEON_FLIP 0x12
494#define DRM_RADEON_ALLOC 0x13
495#define DRM_RADEON_FREE 0x14
496#define DRM_RADEON_INIT_HEAP 0x15
497#define DRM_RADEON_IRQ_EMIT 0x16
498#define DRM_RADEON_IRQ_WAIT 0x17
499#define DRM_RADEON_CP_RESUME 0x18
500#define DRM_RADEON_SETPARAM 0x19
501#define DRM_RADEON_SURF_ALLOC 0x1a
502#define DRM_RADEON_SURF_FREE 0x1b
503/* KMS ioctl */
504#define DRM_RADEON_GEM_INFO 0x1c
505#define DRM_RADEON_GEM_CREATE 0x1d
506#define DRM_RADEON_GEM_MMAP 0x1e
507#define DRM_RADEON_GEM_PREAD 0x21
508#define DRM_RADEON_GEM_PWRITE 0x22
509#define DRM_RADEON_GEM_SET_DOMAIN 0x23
510#define DRM_RADEON_GEM_WAIT_IDLE 0x24
511#define DRM_RADEON_CS 0x26
512#define DRM_RADEON_INFO 0x27
513#define DRM_RADEON_GEM_SET_TILING 0x28
514#define DRM_RADEON_GEM_GET_TILING 0x29
515#define DRM_RADEON_GEM_BUSY 0x2a
516#define DRM_RADEON_GEM_VA 0x2b
517#define DRM_RADEON_GEM_OP 0x2c
518#define DRM_RADEON_GEM_USERPTR 0x2d
519
520#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
521#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
522#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
523#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
524#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
525#define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET)
526#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
527#define DRM_IOCTL_RADEON_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_SWAP)
528#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
529#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
530#define DRM_IOCTL_RADEON_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
531#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
532#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
533#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
534#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
535#define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
536#define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
537#define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP)
538#define DRM_IOCTL_RADEON_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
539#define DRM_IOCTL_RADEON_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
540#define DRM_IOCTL_RADEON_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
541#define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
542#define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
543#define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
544#define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
545#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
546#define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
547/* KMS */
548#define DRM_IOCTL_RADEON_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info)
549#define DRM_IOCTL_RADEON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create)
550#define DRM_IOCTL_RADEON_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
551#define DRM_IOCTL_RADEON_GEM_PREAD DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread)
552#define DRM_IOCTL_RADEON_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
553#define DRM_IOCTL_RADEON_GEM_SET_DOMAIN DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
554#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
555#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
556#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
557#define DRM_IOCTL_RADEON_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
558#define DRM_IOCTL_RADEON_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
559#define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
560#define DRM_IOCTL_RADEON_GEM_VA DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_VA, struct drm_radeon_gem_va)
561#define DRM_IOCTL_RADEON_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_OP, struct drm_radeon_gem_op)
562#define DRM_IOCTL_RADEON_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_USERPTR, struct drm_radeon_gem_userptr)
563
564typedef struct drm_radeon_init {
565 enum {
566 RADEON_INIT_CP = 0x01,
567 RADEON_CLEANUP_CP = 0x02,
568 RADEON_INIT_R200_CP = 0x03,
569 RADEON_INIT_R300_CP = 0x04,
570 RADEON_INIT_R600_CP = 0x05
571 } func;
572 unsigned long sarea_priv_offset;
573 int is_pci;
574 int cp_mode;
575 int gart_size;
576 int ring_size;
577 int usec_timeout;
578
579 unsigned int fb_bpp;
580 unsigned int front_offset, front_pitch;
581 unsigned int back_offset, back_pitch;
582 unsigned int depth_bpp;
583 unsigned int depth_offset, depth_pitch;
584
585 unsigned long fb_offset;
586 unsigned long mmio_offset;
587 unsigned long ring_offset;
588 unsigned long ring_rptr_offset;
589 unsigned long buffers_offset;
590 unsigned long gart_textures_offset;
591} drm_radeon_init_t;
592
593typedef struct drm_radeon_cp_stop {
594 int flush;
595 int idle;
596} drm_radeon_cp_stop_t;
597
598typedef struct drm_radeon_fullscreen {
599 enum {
600 RADEON_INIT_FULLSCREEN = 0x01,
601 RADEON_CLEANUP_FULLSCREEN = 0x02
602 } func;
603} drm_radeon_fullscreen_t;
604
605#define CLEAR_X1 0
606#define CLEAR_Y1 1
607#define CLEAR_X2 2
608#define CLEAR_Y2 3
609#define CLEAR_DEPTH 4
610
611typedef union drm_radeon_clear_rect {
612 float f[5];
613 unsigned int ui[5];
614} drm_radeon_clear_rect_t;
615
616typedef struct drm_radeon_clear {
617 unsigned int flags;
618 unsigned int clear_color;
619 unsigned int clear_depth;
620 unsigned int color_mask;
621 unsigned int depth_mask; /* misnamed field: should be stencil */
622 drm_radeon_clear_rect_t *depth_boxes;
623} drm_radeon_clear_t;
624
625typedef struct drm_radeon_vertex {
626 int prim;
627 int idx; /* Index of vertex buffer */
628 int count; /* Number of vertices in buffer */
629 int discard; /* Client finished with buffer? */
630} drm_radeon_vertex_t;
631
632typedef struct drm_radeon_indices {
633 int prim;
634 int idx;
635 int start;
636 int end;
637 int discard; /* Client finished with buffer? */
638} drm_radeon_indices_t;
639
640/* v1.2 - obsoletes drm_radeon_vertex and drm_radeon_indices
641 * - allows multiple primitives and state changes in a single ioctl
642 * - supports driver change to emit native primitives
643 */
644typedef struct drm_radeon_vertex2 {
645 int idx; /* Index of vertex buffer */
646 int discard; /* Client finished with buffer? */
647 int nr_states;
648 drm_radeon_state_t *state;
649 int nr_prims;
650 drm_radeon_prim_t *prim;
651} drm_radeon_vertex2_t;
652
653/* v1.3 - obsoletes drm_radeon_vertex2
654 * - allows arbitrarily large cliprect list
655 * - allows updating of tcl packet, vector and scalar state
656 * - allows memory-efficient description of state updates
657 * - allows state to be emitted without a primitive
658 * (for clears, ctx switches)
659 * - allows more than one dma buffer to be referenced per ioctl
660 * - supports tcl driver
661 * - may be extended in future versions with new cmd types, packets
662 */
663typedef struct drm_radeon_cmd_buffer {
664 int bufsz;
665 char *buf;
666 int nbox;
667 struct drm_clip_rect *boxes;
668} drm_radeon_cmd_buffer_t;
669
670typedef struct drm_radeon_tex_image {
671 unsigned int x, y; /* Blit coordinates */
672 unsigned int width, height;
673 const void *data;
674} drm_radeon_tex_image_t;
675
676typedef struct drm_radeon_texture {
677 unsigned int offset;
678 int pitch;
679 int format;
680 int width; /* Texture image coordinates */
681 int height;
682 drm_radeon_tex_image_t *image;
683} drm_radeon_texture_t;
684
685typedef struct drm_radeon_stipple {
686 unsigned int *mask;
687} drm_radeon_stipple_t;
688
689typedef struct drm_radeon_indirect {
690 int idx;
691 int start;
692 int end;
693 int discard;
694} drm_radeon_indirect_t;
695
696/* enum for card type parameters */
697#define RADEON_CARD_PCI 0
698#define RADEON_CARD_AGP 1
699#define RADEON_CARD_PCIE 2
700
701/* 1.3: An ioctl to get parameters that aren't available to the 3d
702 * client any other way.
703 */
704#define RADEON_PARAM_GART_BUFFER_OFFSET 1 /* card offset of 1st GART buffer */
705#define RADEON_PARAM_LAST_FRAME 2
706#define RADEON_PARAM_LAST_DISPATCH 3
707#define RADEON_PARAM_LAST_CLEAR 4
708/* Added with DRM version 1.6. */
709#define RADEON_PARAM_IRQ_NR 5
710#define RADEON_PARAM_GART_BASE 6 /* card offset of GART base */
711/* Added with DRM version 1.8. */
712#define RADEON_PARAM_REGISTER_HANDLE 7 /* for drmMap() */
713#define RADEON_PARAM_STATUS_HANDLE 8
714#define RADEON_PARAM_SAREA_HANDLE 9
715#define RADEON_PARAM_GART_TEX_HANDLE 10
716#define RADEON_PARAM_SCRATCH_OFFSET 11
717#define RADEON_PARAM_CARD_TYPE 12
718#define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */
719#define RADEON_PARAM_FB_LOCATION 14 /* FB location */
720#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
721#define RADEON_PARAM_DEVICE_ID 16
722#define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */
723
724typedef struct drm_radeon_getparam {
725 int param;
726 void *value;
727} drm_radeon_getparam_t;
728
729/* 1.6: Set up a memory manager for regions of shared memory:
730 */
731#define RADEON_MEM_REGION_GART 1
732#define RADEON_MEM_REGION_FB 2
733
734typedef struct drm_radeon_mem_alloc {
735 int region;
736 int alignment;
737 int size;
738 int *region_offset; /* offset from start of fb or GART */
739} drm_radeon_mem_alloc_t;
740
741typedef struct drm_radeon_mem_free {
742 int region;
743 int region_offset;
744} drm_radeon_mem_free_t;
745
746typedef struct drm_radeon_mem_init_heap {
747 int region;
748 int size;
749 int start;
750} drm_radeon_mem_init_heap_t;
751
752/* 1.6: Userspace can request & wait on irq's:
753 */
754typedef struct drm_radeon_irq_emit {
755 int *irq_seq;
756} drm_radeon_irq_emit_t;
757
758typedef struct drm_radeon_irq_wait {
759 int irq_seq;
760} drm_radeon_irq_wait_t;
761
762/* 1.10: Clients tell the DRM where they think the framebuffer is located in
763 * the card's address space, via a new generic ioctl to set parameters
764 */
765
766typedef struct drm_radeon_setparam {
767 unsigned int param;
768 __s64 value;
769} drm_radeon_setparam_t;
770
771#define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */
772#define RADEON_SETPARAM_SWITCH_TILING 2 /* enable/disable color tiling */
773#define RADEON_SETPARAM_PCIGART_LOCATION 3 /* PCI Gart Location */
774#define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */
775#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */
776#define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */
777/* 1.14: Clients can allocate/free a surface
778 */
779typedef struct drm_radeon_surface_alloc {
780 unsigned int address;
781 unsigned int size;
782 unsigned int flags;
783} drm_radeon_surface_alloc_t;
784
785typedef struct drm_radeon_surface_free {
786 unsigned int address;
787} drm_radeon_surface_free_t;
788
789#define DRM_RADEON_VBLANK_CRTC1 1
790#define DRM_RADEON_VBLANK_CRTC2 2
791
792/*
793 * Kernel modesetting world below.
794 */
795#define RADEON_GEM_DOMAIN_CPU 0x1
796#define RADEON_GEM_DOMAIN_GTT 0x2
797#define RADEON_GEM_DOMAIN_VRAM 0x4
798
799struct drm_radeon_gem_info {
800 __u64 gart_size;
801 __u64 vram_size;
802 __u64 vram_visible;
803};
804
805#define RADEON_GEM_NO_BACKING_STORE (1 << 0)
806#define RADEON_GEM_GTT_UC (1 << 1)
807#define RADEON_GEM_GTT_WC (1 << 2)
808/* BO is expected to be accessed by the CPU */
809#define RADEON_GEM_CPU_ACCESS (1 << 3)
810/* CPU access is not expected to work for this BO */
811#define RADEON_GEM_NO_CPU_ACCESS (1 << 4)
812
813struct drm_radeon_gem_create {
814 __u64 size;
815 __u64 alignment;
816 __u32 handle;
817 __u32 initial_domain;
818 __u32 flags;
819};
820
821/*
822 * This is not a reliable API and you should expect it to fail for any
823 * number of reasons and have fallback path that do not use userptr to
824 * perform any operation.
825 */
826#define RADEON_GEM_USERPTR_READONLY (1 << 0)
827#define RADEON_GEM_USERPTR_ANONONLY (1 << 1)
828#define RADEON_GEM_USERPTR_VALIDATE (1 << 2)
829#define RADEON_GEM_USERPTR_REGISTER (1 << 3)
830
831struct drm_radeon_gem_userptr {
832 __u64 addr;
833 __u64 size;
834 __u32 flags;
835 __u32 handle;
836};
837
838#define RADEON_TILING_MACRO 0x1
839#define RADEON_TILING_MICRO 0x2
840#define RADEON_TILING_SWAP_16BIT 0x4
841#define RADEON_TILING_SWAP_32BIT 0x8
842/* this object requires a surface when mapped - i.e. front buffer */
843#define RADEON_TILING_SURFACE 0x10
844#define RADEON_TILING_MICRO_SQUARE 0x20
845#define RADEON_TILING_EG_BANKW_SHIFT 8
846#define RADEON_TILING_EG_BANKW_MASK 0xf
847#define RADEON_TILING_EG_BANKH_SHIFT 12
848#define RADEON_TILING_EG_BANKH_MASK 0xf
849#define RADEON_TILING_EG_MACRO_TILE_ASPECT_SHIFT 16
850#define RADEON_TILING_EG_MACRO_TILE_ASPECT_MASK 0xf
851#define RADEON_TILING_EG_TILE_SPLIT_SHIFT 24
852#define RADEON_TILING_EG_TILE_SPLIT_MASK 0xf
853#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_SHIFT 28
854#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf
855
856struct drm_radeon_gem_set_tiling {
857 __u32 handle;
858 __u32 tiling_flags;
859 __u32 pitch;
860};
861
862struct drm_radeon_gem_get_tiling {
863 __u32 handle;
864 __u32 tiling_flags;
865 __u32 pitch;
866};
867
868struct drm_radeon_gem_mmap {
869 __u32 handle;
870 __u32 pad;
871 __u64 offset;
872 __u64 size;
873 __u64 addr_ptr;
874};
875
876struct drm_radeon_gem_set_domain {
877 __u32 handle;
878 __u32 read_domains;
879 __u32 write_domain;
880};
881
882struct drm_radeon_gem_wait_idle {
883 __u32 handle;
884 __u32 pad;
885};
886
887struct drm_radeon_gem_busy {
888 __u32 handle;
889 __u32 domain;
890};
891
892struct drm_radeon_gem_pread {
893 /** Handle for the object being read. */
894 __u32 handle;
895 __u32 pad;
896 /** Offset into the object to read from */
897 __u64 offset;
898 /** Length of data to read */
899 __u64 size;
900 /** Pointer to write the data into. */
901 /* void *, but pointers are not 32/64 compatible */
902 __u64 data_ptr;
903};
904
905struct drm_radeon_gem_pwrite {
906 /** Handle for the object being written to. */
907 __u32 handle;
908 __u32 pad;
909 /** Offset into the object to write to */
910 __u64 offset;
911 /** Length of data to write */
912 __u64 size;
913 /** Pointer to read the data from. */
914 /* void *, but pointers are not 32/64 compatible */
915 __u64 data_ptr;
916};
917
918/* Sets or returns a value associated with a buffer. */
919struct drm_radeon_gem_op {
920 __u32 handle; /* buffer */
921 __u32 op; /* RADEON_GEM_OP_* */
922 __u64 value; /* input or return value */
923};
924
925#define RADEON_GEM_OP_GET_INITIAL_DOMAIN 0
926#define RADEON_GEM_OP_SET_INITIAL_DOMAIN 1
927
928#define RADEON_VA_MAP 1
929#define RADEON_VA_UNMAP 2
930
931#define RADEON_VA_RESULT_OK 0
932#define RADEON_VA_RESULT_ERROR 1
933#define RADEON_VA_RESULT_VA_EXIST 2
934
935#define RADEON_VM_PAGE_VALID (1 << 0)
936#define RADEON_VM_PAGE_READABLE (1 << 1)
937#define RADEON_VM_PAGE_WRITEABLE (1 << 2)
938#define RADEON_VM_PAGE_SYSTEM (1 << 3)
939#define RADEON_VM_PAGE_SNOOPED (1 << 4)
940
941struct drm_radeon_gem_va {
942 __u32 handle;
943 __u32 operation;
944 __u32 vm_id;
945 __u32 flags;
946 __u64 offset;
947};
948
949#define RADEON_CHUNK_ID_RELOCS 0x01
950#define RADEON_CHUNK_ID_IB 0x02
951#define RADEON_CHUNK_ID_FLAGS 0x03
952#define RADEON_CHUNK_ID_CONST_IB 0x04
953
954/* The first dword of RADEON_CHUNK_ID_FLAGS is a uint32 of these flags: */
955#define RADEON_CS_KEEP_TILING_FLAGS 0x01
956#define RADEON_CS_USE_VM 0x02
957#define RADEON_CS_END_OF_FRAME 0x04 /* a hint from userspace which CS is the last one */
958/* The second dword of RADEON_CHUNK_ID_FLAGS is a uint32 that sets the ring type */
959#define RADEON_CS_RING_GFX 0
960#define RADEON_CS_RING_COMPUTE 1
961#define RADEON_CS_RING_DMA 2
962#define RADEON_CS_RING_UVD 3
963#define RADEON_CS_RING_VCE 4
964/* The third dword of RADEON_CHUNK_ID_FLAGS is a sint32 that sets the priority */
965/* 0 = normal, + = higher priority, - = lower priority */
966
967struct drm_radeon_cs_chunk {
968 __u32 chunk_id;
969 __u32 length_dw;
970 __u64 chunk_data;
971};
972
973/* drm_radeon_cs_reloc.flags */
974#define RADEON_RELOC_PRIO_MASK (0xf << 0)
975
976struct drm_radeon_cs_reloc {
977 __u32 handle;
978 __u32 read_domains;
979 __u32 write_domain;
980 __u32 flags;
981};
982
983struct drm_radeon_cs {
984 __u32 num_chunks;
985 __u32 cs_id;
986 /* this points to __u64 * which point to cs chunks */
987 __u64 chunks;
988 /* updates to the limits after this CS ioctl */
989 __u64 gart_limit;
990 __u64 vram_limit;
991};
992
993#define RADEON_INFO_DEVICE_ID 0x00
994#define RADEON_INFO_NUM_GB_PIPES 0x01
995#define RADEON_INFO_NUM_Z_PIPES 0x02
996#define RADEON_INFO_ACCEL_WORKING 0x03
997#define RADEON_INFO_CRTC_FROM_ID 0x04
998#define RADEON_INFO_ACCEL_WORKING2 0x05
999#define RADEON_INFO_TILING_CONFIG 0x06
1000#define RADEON_INFO_WANT_HYPERZ 0x07
1001#define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */
1002#define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09 /* clock crystal frequency */
1003#define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */
1004#define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */
1005#define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */
1006#define RADEON_INFO_BACKEND_MAP 0x0d /* pipe to backend map, needed by mesa */
1007/* virtual address start, va < start are reserved by the kernel */
1008#define RADEON_INFO_VA_START 0x0e
1009/* maximum size of ib using the virtual memory cs */
1010#define RADEON_INFO_IB_VM_MAX_SIZE 0x0f
1011/* max pipes - needed for compute shaders */
1012#define RADEON_INFO_MAX_PIPES 0x10
1013/* timestamp for GL_ARB_timer_query (OpenGL), returns the current GPU clock */
1014#define RADEON_INFO_TIMESTAMP 0x11
1015/* max shader engines (SE) - needed for geometry shaders, etc. */
1016#define RADEON_INFO_MAX_SE 0x12
1017/* max SH per SE */
1018#define RADEON_INFO_MAX_SH_PER_SE 0x13
1019/* fast fb access is enabled */
1020#define RADEON_INFO_FASTFB_WORKING 0x14
1021/* query if a RADEON_CS_RING_* submission is supported */
1022#define RADEON_INFO_RING_WORKING 0x15
1023/* SI tile mode array */
1024#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16
1025/* query if CP DMA is supported on the compute ring */
1026#define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17
1027/* CIK macrotile mode array */
1028#define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18
1029/* query the number of render backends */
1030#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19
1031/* max engine clock - needed for OpenCL */
1032#define RADEON_INFO_MAX_SCLK 0x1a
1033/* version of VCE firmware */
1034#define RADEON_INFO_VCE_FW_VERSION 0x1b
1035/* version of VCE feedback */
1036#define RADEON_INFO_VCE_FB_VERSION 0x1c
1037#define RADEON_INFO_NUM_BYTES_MOVED 0x1d
1038#define RADEON_INFO_VRAM_USAGE 0x1e
1039#define RADEON_INFO_GTT_USAGE 0x1f
1040#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
1041#define RADEON_INFO_CURRENT_GPU_TEMP 0x21
1042#define RADEON_INFO_CURRENT_GPU_SCLK 0x22
1043#define RADEON_INFO_CURRENT_GPU_MCLK 0x23
1044#define RADEON_INFO_READ_REG 0x24
1045#define RADEON_INFO_VA_UNMAP_WORKING 0x25
1046#define RADEON_INFO_GPU_RESET_COUNTER 0x26
1047
1048struct drm_radeon_info {
1049 __u32 request;
1050 __u32 pad;
1051 __u64 value;
1052};
1053
1054/* Those correspond to the tile index to use, this is to explicitly state
1055 * the API that is implicitly defined by the tile mode array.
1056 */
1057#define SI_TILE_MODE_COLOR_LINEAR_ALIGNED 8
1058#define SI_TILE_MODE_COLOR_1D 13
1059#define SI_TILE_MODE_COLOR_1D_SCANOUT 9
1060#define SI_TILE_MODE_COLOR_2D_8BPP 14
1061#define SI_TILE_MODE_COLOR_2D_16BPP 15
1062#define SI_TILE_MODE_COLOR_2D_32BPP 16
1063#define SI_TILE_MODE_COLOR_2D_64BPP 17
1064#define SI_TILE_MODE_COLOR_2D_SCANOUT_16BPP 11
1065#define SI_TILE_MODE_COLOR_2D_SCANOUT_32BPP 12
1066#define SI_TILE_MODE_DEPTH_STENCIL_1D 4
1067#define SI_TILE_MODE_DEPTH_STENCIL_2D 0
1068#define SI_TILE_MODE_DEPTH_STENCIL_2D_2AA 3
1069#define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA 3
1070#define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA 2
1071
1072#define CIK_TILE_MODE_DEPTH_STENCIL_1D 5
1073
1074#if defined(__cplusplus)
1075}
1076#endif
1077
1078#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/savage_drm.h deleted-220
...@@ -1,220 +0,0 @@
1/* savage_drm.h -- Public header for the savage driver
2 *
3 * Copyright 2004 Felix Kuehling
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sub license,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NON-INFRINGEMENT. IN NO EVENT SHALL FELIX KUEHLING BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef __SAVAGE_DRM_H__
27#define __SAVAGE_DRM_H__
28
29#include "drm.h"
30
31#if defined(__cplusplus)
32extern "C" {
33#endif
34
35#ifndef __SAVAGE_SAREA_DEFINES__
36#define __SAVAGE_SAREA_DEFINES__
37
38/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
39 * regions, subject to a minimum region size of (1<<16) == 64k.
40 *
41 * Clients may subdivide regions internally, but when sharing between
42 * clients, the region size is the minimum granularity.
43 */
44
45#define SAVAGE_CARD_HEAP 0
46#define SAVAGE_AGP_HEAP 1
47#define SAVAGE_NR_TEX_HEAPS 2
48#define SAVAGE_NR_TEX_REGIONS 16
49#define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16
50
51#endif /* __SAVAGE_SAREA_DEFINES__ */
52
53typedef struct _drm_savage_sarea {
54 /* LRU lists for texture memory in agp space and on the card.
55 */
56 struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +
57 1];
58 unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
59
60 /* Mechanism to validate card state.
61 */
62 int ctxOwner;
63} drm_savage_sarea_t, *drm_savage_sarea_ptr;
64
65/* Savage-specific ioctls
66 */
67#define DRM_SAVAGE_BCI_INIT 0x00
68#define DRM_SAVAGE_BCI_CMDBUF 0x01
69#define DRM_SAVAGE_BCI_EVENT_EMIT 0x02
70#define DRM_SAVAGE_BCI_EVENT_WAIT 0x03
71
72#define DRM_IOCTL_SAVAGE_BCI_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t)
73#define DRM_IOCTL_SAVAGE_BCI_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t)
74#define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t)
75#define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t)
76
77#define SAVAGE_DMA_PCI 1
78#define SAVAGE_DMA_AGP 3
79typedef struct drm_savage_init {
80 enum {
81 SAVAGE_INIT_BCI = 1,
82 SAVAGE_CLEANUP_BCI = 2
83 } func;
84 unsigned int sarea_priv_offset;
85
86 /* some parameters */
87 unsigned int cob_size;
88 unsigned int bci_threshold_lo, bci_threshold_hi;
89 unsigned int dma_type;
90
91 /* frame buffer layout */
92 unsigned int fb_bpp;
93 unsigned int front_offset, front_pitch;
94 unsigned int back_offset, back_pitch;
95 unsigned int depth_bpp;
96 unsigned int depth_offset, depth_pitch;
97
98 /* local textures */
99 unsigned int texture_offset;
100 unsigned int texture_size;
101
102 /* physical locations of non-permanent maps */
103 unsigned long status_offset;
104 unsigned long buffers_offset;
105 unsigned long agp_textures_offset;
106 unsigned long cmd_dma_offset;
107} drm_savage_init_t;
108
109typedef union drm_savage_cmd_header drm_savage_cmd_header_t;
110typedef struct drm_savage_cmdbuf {
111 /* command buffer in client's address space */
112 drm_savage_cmd_header_t *cmd_addr;
113 unsigned int size; /* size of the command buffer in 64bit units */
114
115 unsigned int dma_idx; /* DMA buffer index to use */
116 int discard; /* discard DMA buffer when done */
117 /* vertex buffer in client's address space */
118 unsigned int *vb_addr;
119 unsigned int vb_size; /* size of client vertex buffer in bytes */
120 unsigned int vb_stride; /* stride of vertices in 32bit words */
121 /* boxes in client's address space */
122 struct drm_clip_rect *box_addr;
123 unsigned int nbox; /* number of clipping boxes */
124} drm_savage_cmdbuf_t;
125
126#define SAVAGE_WAIT_2D 0x1 /* wait for 2D idle before updating event tag */
127#define SAVAGE_WAIT_3D 0x2 /* wait for 3D idle before updating event tag */
128#define SAVAGE_WAIT_IRQ 0x4 /* emit or wait for IRQ, not implemented yet */
129typedef struct drm_savage_event {
130 unsigned int count;
131 unsigned int flags;
132} drm_savage_event_emit_t, drm_savage_event_wait_t;
133
134/* Commands for the cmdbuf ioctl
135 */
136#define SAVAGE_CMD_STATE 0 /* a range of state registers */
137#define SAVAGE_CMD_DMA_PRIM 1 /* vertices from DMA buffer */
138#define SAVAGE_CMD_VB_PRIM 2 /* vertices from client vertex buffer */
139#define SAVAGE_CMD_DMA_IDX 3 /* indexed vertices from DMA buffer */
140#define SAVAGE_CMD_VB_IDX 4 /* indexed vertices client vertex buffer */
141#define SAVAGE_CMD_CLEAR 5 /* clear buffers */
142#define SAVAGE_CMD_SWAP 6 /* swap buffers */
143
144/* Primitive types
145*/
146#define SAVAGE_PRIM_TRILIST 0 /* triangle list */
147#define SAVAGE_PRIM_TRISTRIP 1 /* triangle strip */
148#define SAVAGE_PRIM_TRIFAN 2 /* triangle fan */
149#define SAVAGE_PRIM_TRILIST_201 3 /* reorder verts for correct flat
150 * shading on s3d */
151
152/* Skip flags (vertex format)
153 */
154#define SAVAGE_SKIP_Z 0x01
155#define SAVAGE_SKIP_W 0x02
156#define SAVAGE_SKIP_C0 0x04
157#define SAVAGE_SKIP_C1 0x08
158#define SAVAGE_SKIP_S0 0x10
159#define SAVAGE_SKIP_T0 0x20
160#define SAVAGE_SKIP_ST0 0x30
161#define SAVAGE_SKIP_S1 0x40
162#define SAVAGE_SKIP_T1 0x80
163#define SAVAGE_SKIP_ST1 0xc0
164#define SAVAGE_SKIP_ALL_S3D 0x3f
165#define SAVAGE_SKIP_ALL_S4 0xff
166
167/* Buffer names for clear command
168 */
169#define SAVAGE_FRONT 0x1
170#define SAVAGE_BACK 0x2
171#define SAVAGE_DEPTH 0x4
172
173/* 64-bit command header
174 */
175union drm_savage_cmd_header {
176 struct {
177 unsigned char cmd; /* command */
178 unsigned char pad0;
179 unsigned short pad1;
180 unsigned short pad2;
181 unsigned short pad3;
182 } cmd; /* generic */
183 struct {
184 unsigned char cmd;
185 unsigned char global; /* need idle engine? */
186 unsigned short count; /* number of consecutive registers */
187 unsigned short start; /* first register */
188 unsigned short pad3;
189 } state; /* SAVAGE_CMD_STATE */
190 struct {
191 unsigned char cmd;
192 unsigned char prim; /* primitive type */
193 unsigned short skip; /* vertex format (skip flags) */
194 unsigned short count; /* number of vertices */
195 unsigned short start; /* first vertex in DMA/vertex buffer */
196 } prim; /* SAVAGE_CMD_DMA_PRIM, SAVAGE_CMD_VB_PRIM */
197 struct {
198 unsigned char cmd;
199 unsigned char prim;
200 unsigned short skip;
201 unsigned short count; /* number of indices that follow */
202 unsigned short pad3;
203 } idx; /* SAVAGE_CMD_DMA_IDX, SAVAGE_CMD_VB_IDX */
204 struct {
205 unsigned char cmd;
206 unsigned char pad0;
207 unsigned short pad1;
208 unsigned int flags;
209 } clear0; /* SAVAGE_CMD_CLEAR */
210 struct {
211 unsigned int mask;
212 unsigned int value;
213 } clear1; /* SAVAGE_CMD_CLEAR data */
214};
215
216#if defined(__cplusplus)
217}
218#endif
219
220#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/sis_drm.h deleted-77
...@@ -1,77 +0,0 @@
1/* sis_drv.h -- Private header for sis driver -*- linux-c -*- */
2/*
3 * Copyright 2005 Eric Anholt
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27#ifndef __SIS_DRM_H__
28#define __SIS_DRM_H__
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* SiS specific ioctls */
37#define NOT_USED_0_3
38#define DRM_SIS_FB_ALLOC 0x04
39#define DRM_SIS_FB_FREE 0x05
40#define NOT_USED_6_12
41#define DRM_SIS_AGP_INIT 0x13
42#define DRM_SIS_AGP_ALLOC 0x14
43#define DRM_SIS_AGP_FREE 0x15
44#define DRM_SIS_FB_INIT 0x16
45
46#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t)
47#define DRM_IOCTL_SIS_FB_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t)
48#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t)
49#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t)
50#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t)
51#define DRM_IOCTL_SIS_FB_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t)
52/*
53#define DRM_IOCTL_SIS_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
54#define DRM_IOCTL_SIS_FLIP_INIT DRM_IO( 0x49)
55#define DRM_IOCTL_SIS_FLIP_FINAL DRM_IO( 0x50)
56*/
57
58typedef struct {
59 int context;
60 unsigned long offset;
61 unsigned long size;
62 unsigned long free;
63} drm_sis_mem_t;
64
65typedef struct {
66 unsigned long offset, size;
67} drm_sis_agp_t;
68
69typedef struct {
70 unsigned long offset, size;
71} drm_sis_fb_t;
72
73#if defined(__cplusplus)
74}
75#endif
76
77#endif /* __SIS_DRM_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/tegra_drm.h deleted-681
...@@ -1,681 +0,0 @@
1/*
2 * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _TEGRA_DRM_H_
24#define _TEGRA_DRM_H_
25
26#include "drm.h"
27
28#if defined(__cplusplus)
29extern "C" {
30#endif
31
32#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
33#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
34
35/**
36 * struct drm_tegra_gem_create - parameters for the GEM object creation IOCTL
37 */
38struct drm_tegra_gem_create {
39 /**
40 * @size:
41 *
42 * The size, in bytes, of the buffer object to be created.
43 */
44 __u64 size;
45
46 /**
47 * @flags:
48 *
49 * A bitmask of flags that influence the creation of GEM objects:
50 *
51 * DRM_TEGRA_GEM_CREATE_TILED
52 * Use the 16x16 tiling format for this buffer.
53 *
54 * DRM_TEGRA_GEM_CREATE_BOTTOM_UP
55 * The buffer has a bottom-up layout.
56 */
57 __u32 flags;
58
59 /**
60 * @handle:
61 *
62 * The handle of the created GEM object. Set by the kernel upon
63 * successful completion of the IOCTL.
64 */
65 __u32 handle;
66};
67
68/**
69 * struct drm_tegra_gem_mmap - parameters for the GEM mmap IOCTL
70 */
71struct drm_tegra_gem_mmap {
72 /**
73 * @handle:
74 *
75 * Handle of the GEM object to obtain an mmap offset for.
76 */
77 __u32 handle;
78
79 /**
80 * @pad:
81 *
82 * Structure padding that may be used in the future. Must be 0.
83 */
84 __u32 pad;
85
86 /**
87 * @offset:
88 *
89 * The mmap offset for the given GEM object. Set by the kernel upon
90 * successful completion of the IOCTL.
91 */
92 __u64 offset;
93};
94
95/**
96 * struct drm_tegra_syncpt_read - parameters for the read syncpoint IOCTL
97 */
98struct drm_tegra_syncpt_read {
99 /**
100 * @id:
101 *
102 * ID of the syncpoint to read the current value from.
103 */
104 __u32 id;
105
106 /**
107 * @value:
108 *
109 * The current syncpoint value. Set by the kernel upon successful
110 * completion of the IOCTL.
111 */
112 __u32 value;
113};
114
115/**
116 * struct drm_tegra_syncpt_incr - parameters for the increment syncpoint IOCTL
117 */
118struct drm_tegra_syncpt_incr {
119 /**
120 * @id:
121 *
122 * ID of the syncpoint to increment.
123 */
124 __u32 id;
125
126 /**
127 * @pad:
128 *
129 * Structure padding that may be used in the future. Must be 0.
130 */
131 __u32 pad;
132};
133
134/**
135 * struct drm_tegra_syncpt_wait - parameters for the wait syncpoint IOCTL
136 */
137struct drm_tegra_syncpt_wait {
138 /**
139 * @id:
140 *
141 * ID of the syncpoint to wait on.
142 */
143 __u32 id;
144
145 /**
146 * @thresh:
147 *
148 * Threshold value for which to wait.
149 */
150 __u32 thresh;
151
152 /**
153 * @timeout:
154 *
155 * Timeout, in milliseconds, to wait.
156 */
157 __u32 timeout;
158
159 /**
160 * @value:
161 *
162 * The new syncpoint value after the wait. Set by the kernel upon
163 * successful completion of the IOCTL.
164 */
165 __u32 value;
166};
167
168#define DRM_TEGRA_NO_TIMEOUT (0xffffffff)
169
170/**
171 * struct drm_tegra_open_channel - parameters for the open channel IOCTL
172 */
173struct drm_tegra_open_channel {
174 /**
175 * @client:
176 *
177 * The client ID for this channel.
178 */
179 __u32 client;
180
181 /**
182 * @pad:
183 *
184 * Structure padding that may be used in the future. Must be 0.
185 */
186 __u32 pad;
187
188 /**
189 * @context:
190 *
191 * The application context of this channel. Set by the kernel upon
192 * successful completion of the IOCTL. This context needs to be passed
193 * to the DRM_TEGRA_CHANNEL_CLOSE or the DRM_TEGRA_SUBMIT IOCTLs.
194 */
195 __u64 context;
196};
197
198/**
199 * struct drm_tegra_close_channel - parameters for the close channel IOCTL
200 */
201struct drm_tegra_close_channel {
202 /**
203 * @context:
204 *
205 * The application context of this channel. This is obtained from the
206 * DRM_TEGRA_OPEN_CHANNEL IOCTL.
207 */
208 __u64 context;
209};
210
211/**
212 * struct drm_tegra_get_syncpt - parameters for the get syncpoint IOCTL
213 */
214struct drm_tegra_get_syncpt {
215 /**
216 * @context:
217 *
218 * The application context identifying the channel for which to obtain
219 * the syncpoint ID.
220 */
221 __u64 context;
222
223 /**
224 * @index:
225 *
226 * Index of the client syncpoint for which to obtain the ID.
227 */
228 __u32 index;
229
230 /**
231 * @id:
232 *
233 * The ID of the given syncpoint. Set by the kernel upon successful
234 * completion of the IOCTL.
235 */
236 __u32 id;
237};
238
239/**
240 * struct drm_tegra_get_syncpt_base - parameters for the get wait base IOCTL
241 */
242struct drm_tegra_get_syncpt_base {
243 /**
244 * @context:
245 *
246 * The application context identifying for which channel to obtain the
247 * wait base.
248 */
249 __u64 context;
250
251 /**
252 * @syncpt:
253 *
254 * ID of the syncpoint for which to obtain the wait base.
255 */
256 __u32 syncpt;
257
258 /**
259 * @id:
260 *
261 * The ID of the wait base corresponding to the client syncpoint. Set
262 * by the kernel upon successful completion of the IOCTL.
263 */
264 __u32 id;
265};
266
267/**
268 * struct drm_tegra_syncpt - syncpoint increment operation
269 */
270struct drm_tegra_syncpt {
271 /**
272 * @id:
273 *
274 * ID of the syncpoint to operate on.
275 */
276 __u32 id;
277
278 /**
279 * @incrs:
280 *
281 * Number of increments to perform for the syncpoint.
282 */
283 __u32 incrs;
284};
285
286/**
287 * struct drm_tegra_cmdbuf - structure describing a command buffer
288 */
289struct drm_tegra_cmdbuf {
290 /**
291 * @handle:
292 *
293 * Handle to a GEM object containing the command buffer.
294 */
295 __u32 handle;
296
297 /**
298 * @offset:
299 *
300 * Offset, in bytes, into the GEM object identified by @handle at
301 * which the command buffer starts.
302 */
303 __u32 offset;
304
305 /**
306 * @words:
307 *
308 * Number of 32-bit words in this command buffer.
309 */
310 __u32 words;
311
312 /**
313 * @pad:
314 *
315 * Structure padding that may be used in the future. Must be 0.
316 */
317 __u32 pad;
318};
319
320/**
321 * struct drm_tegra_reloc - GEM object relocation structure
322 */
323struct drm_tegra_reloc {
324 struct {
325 /**
326 * @cmdbuf.handle:
327 *
328 * Handle to the GEM object containing the command buffer for
329 * which to perform this GEM object relocation.
330 */
331 __u32 handle;
332
333 /**
334 * @cmdbuf.offset:
335 *
336 * Offset, in bytes, into the command buffer at which to
337 * insert the relocated address.
338 */
339 __u32 offset;
340 } cmdbuf;
341 struct {
342 /**
343 * @target.handle:
344 *
345 * Handle to the GEM object to be relocated.
346 */
347 __u32 handle;
348
349 /**
350 * @target.offset:
351 *
352 * Offset, in bytes, into the target GEM object at which the
353 * relocated data starts.
354 */
355 __u32 offset;
356 } target;
357
358 /**
359 * @shift:
360 *
361 * The number of bits by which to shift relocated addresses.
362 */
363 __u32 shift;
364
365 /**
366 * @pad:
367 *
368 * Structure padding that may be used in the future. Must be 0.
369 */
370 __u32 pad;
371};
372
373/**
374 * struct drm_tegra_waitchk - wait check structure
375 */
376struct drm_tegra_waitchk {
377 /**
378 * @handle:
379 *
380 * Handle to the GEM object containing a command stream on which to
381 * perform the wait check.
382 */
383 __u32 handle;
384
385 /**
386 * @offset:
387 *
388 * Offset, in bytes, of the location in the command stream to perform
389 * the wait check on.
390 */
391 __u32 offset;
392
393 /**
394 * @syncpt:
395 *
396 * ID of the syncpoint to wait check.
397 */
398 __u32 syncpt;
399
400 /**
401 * @thresh:
402 *
403 * Threshold value for which to check.
404 */
405 __u32 thresh;
406};
407
408/**
409 * struct drm_tegra_submit - job submission structure
410 */
411struct drm_tegra_submit {
412 /**
413 * @context:
414 *
415 * The application context identifying the channel to use for the
416 * execution of this job.
417 */
418 __u64 context;
419
420 /**
421 * @num_syncpts:
422 *
423 * The number of syncpoints operated on by this job. This defines the
424 * length of the array pointed to by @syncpts.
425 */
426 __u32 num_syncpts;
427
428 /**
429 * @num_cmdbufs:
430 *
431 * The number of command buffers to execute as part of this job. This
432 * defines the length of the array pointed to by @cmdbufs.
433 */
434 __u32 num_cmdbufs;
435
436 /**
437 * @num_relocs:
438 *
439 * The number of relocations to perform before executing this job.
440 * This defines the length of the array pointed to by @relocs.
441 */
442 __u32 num_relocs;
443
444 /**
445 * @num_waitchks:
446 *
447 * The number of wait checks to perform as part of this job. This
448 * defines the length of the array pointed to by @waitchks.
449 */
450 __u32 num_waitchks;
451
452 /**
453 * @waitchk_mask:
454 *
455 * Bitmask of valid wait checks.
456 */
457 __u32 waitchk_mask;
458
459 /**
460 * @timeout:
461 *
462 * Timeout, in milliseconds, before this job is cancelled.
463 */
464 __u32 timeout;
465
466 /**
467 * @syncpts:
468 *
469 * A pointer to an array of &struct drm_tegra_syncpt structures that
470 * specify the syncpoint operations performed as part of this job.
471 * The number of elements in the array must be equal to the value
472 * given by @num_syncpts.
473 */
474 __u64 syncpts;
475
476 /**
477 * @cmdbufs:
478 *
479 * A pointer to an array of &struct drm_tegra_cmdbuf structures that
480 * define the command buffers to execute as part of this job. The
481 * number of elements in the array must be equal to the value given
482 * by @num_syncpts.
483 */
484 __u64 cmdbufs;
485
486 /**
487 * @relocs:
488 *
489 * A pointer to an array of &struct drm_tegra_reloc structures that
490 * specify the relocations that need to be performed before executing
491 * this job. The number of elements in the array must be equal to the
492 * value given by @num_relocs.
493 */
494 __u64 relocs;
495
496 /**
497 * @waitchks:
498 *
499 * A pointer to an array of &struct drm_tegra_waitchk structures that
500 * specify the wait checks to be performed while executing this job.
501 * The number of elements in the array must be equal to the value
502 * given by @num_waitchks.
503 */
504 __u64 waitchks;
505
506 /**
507 * @fence:
508 *
509 * The threshold of the syncpoint associated with this job after it
510 * has been completed. Set by the kernel upon successful completion of
511 * the IOCTL. This can be used with the DRM_TEGRA_SYNCPT_WAIT IOCTL to
512 * wait for this job to be finished.
513 */
514 __u32 fence;
515
516 /**
517 * @reserved:
518 *
519 * This field is reserved for future use. Must be 0.
520 */
521 __u32 reserved[5];
522};
523
524#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0
525#define DRM_TEGRA_GEM_TILING_MODE_TILED 1
526#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2
527
528/**
529 * struct drm_tegra_gem_set_tiling - parameters for the set tiling IOCTL
530 */
531struct drm_tegra_gem_set_tiling {
532 /**
533 * @handle:
534 *
535 * Handle to the GEM object for which to set the tiling parameters.
536 */
537 __u32 handle;
538
539 /**
540 * @mode:
541 *
542 * The tiling mode to set. Must be one of:
543 *
544 * DRM_TEGRA_GEM_TILING_MODE_PITCH
545 * pitch linear format
546 *
547 * DRM_TEGRA_GEM_TILING_MODE_TILED
548 * 16x16 tiling format
549 *
550 * DRM_TEGRA_GEM_TILING_MODE_BLOCK
551 * 16Bx2 tiling format
552 */
553 __u32 mode;
554
555 /**
556 * @value:
557 *
558 * The value to set for the tiling mode parameter.
559 */
560 __u32 value;
561
562 /**
563 * @pad:
564 *
565 * Structure padding that may be used in the future. Must be 0.
566 */
567 __u32 pad;
568};
569
570/**
571 * struct drm_tegra_gem_get_tiling - parameters for the get tiling IOCTL
572 */
573struct drm_tegra_gem_get_tiling {
574 /**
575 * @handle:
576 *
577 * Handle to the GEM object for which to query the tiling parameters.
578 */
579 __u32 handle;
580
581 /**
582 * @mode:
583 *
584 * The tiling mode currently associated with the GEM object. Set by
585 * the kernel upon successful completion of the IOCTL.
586 */
587 __u32 mode;
588
589 /**
590 * @value:
591 *
592 * The tiling mode parameter currently associated with the GEM object.
593 * Set by the kernel upon successful completion of the IOCTL.
594 */
595 __u32 value;
596
597 /**
598 * @pad:
599 *
600 * Structure padding that may be used in the future. Must be 0.
601 */
602 __u32 pad;
603};
604
605#define DRM_TEGRA_GEM_BOTTOM_UP (1 << 0)
606#define DRM_TEGRA_GEM_FLAGS (DRM_TEGRA_GEM_BOTTOM_UP)
607
608/**
609 * struct drm_tegra_gem_set_flags - parameters for the set flags IOCTL
610 */
611struct drm_tegra_gem_set_flags {
612 /**
613 * @handle:
614 *
615 * Handle to the GEM object for which to set the flags.
616 */
617 __u32 handle;
618
619 /**
620 * @flags:
621 *
622 * The flags to set for the GEM object.
623 */
624 __u32 flags;
625};
626
627/**
628 * struct drm_tegra_gem_get_flags - parameters for the get flags IOCTL
629 */
630struct drm_tegra_gem_get_flags {
631 /**
632 * @handle:
633 *
634 * Handle to the GEM object for which to query the flags.
635 */
636 __u32 handle;
637
638 /**
639 * @flags:
640 *
641 * The flags currently associated with the GEM object. Set by the
642 * kernel upon successful completion of the IOCTL.
643 */
644 __u32 flags;
645};
646
647#define DRM_TEGRA_GEM_CREATE 0x00
648#define DRM_TEGRA_GEM_MMAP 0x01
649#define DRM_TEGRA_SYNCPT_READ 0x02
650#define DRM_TEGRA_SYNCPT_INCR 0x03
651#define DRM_TEGRA_SYNCPT_WAIT 0x04
652#define DRM_TEGRA_OPEN_CHANNEL 0x05
653#define DRM_TEGRA_CLOSE_CHANNEL 0x06
654#define DRM_TEGRA_GET_SYNCPT 0x07
655#define DRM_TEGRA_SUBMIT 0x08
656#define DRM_TEGRA_GET_SYNCPT_BASE 0x09
657#define DRM_TEGRA_GEM_SET_TILING 0x0a
658#define DRM_TEGRA_GEM_GET_TILING 0x0b
659#define DRM_TEGRA_GEM_SET_FLAGS 0x0c
660#define DRM_TEGRA_GEM_GET_FLAGS 0x0d
661
662#define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
663#define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
664#define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
665#define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
666#define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
667#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
668#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_close_channel)
669#define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
670#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
671#define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
672#define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling)
673#define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling)
674#define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
675#define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
676
677#if defined(__cplusplus)
678}
679#endif
680
681#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/v3d_drm.h deleted-194
...@@ -1,194 +0,0 @@
1/*
2 * Copyright © 2014-2018 Broadcom
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#ifndef _V3D_DRM_H_
25#define _V3D_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33#define DRM_V3D_SUBMIT_CL 0x00
34#define DRM_V3D_WAIT_BO 0x01
35#define DRM_V3D_CREATE_BO 0x02
36#define DRM_V3D_MMAP_BO 0x03
37#define DRM_V3D_GET_PARAM 0x04
38#define DRM_V3D_GET_BO_OFFSET 0x05
39
40#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
41#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
42#define DRM_IOCTL_V3D_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_CREATE_BO, struct drm_v3d_create_bo)
43#define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
44#define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
45#define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
46
47/**
48 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
49 * engine.
50 *
51 * This asks the kernel to have the GPU execute an optional binner
52 * command list, and a render command list.
53 */
54struct drm_v3d_submit_cl {
55 /* Pointer to the binner command list.
56 *
57 * This is the first set of commands executed, which runs the
58 * coordinate shader to determine where primitives land on the screen,
59 * then writes out the state updates and draw calls necessary per tile
60 * to the tile allocation BO.
61 */
62 __u32 bcl_start;
63
64 /** End address of the BCL (first byte after the BCL) */
65 __u32 bcl_end;
66
67 /* Offset of the render command list.
68 *
69 * This is the second set of commands executed, which will either
70 * execute the tiles that have been set up by the BCL, or a fixed set
71 * of tiles (in the case of RCL-only blits).
72 */
73 __u32 rcl_start;
74
75 /** End address of the RCL (first byte after the RCL) */
76 __u32 rcl_end;
77
78 /** An optional sync object to wait on before starting the BCL. */
79 __u32 in_sync_bcl;
80 /** An optional sync object to wait on before starting the RCL. */
81 __u32 in_sync_rcl;
82 /** An optional sync object to place the completion fence in. */
83 __u32 out_sync;
84
85 /* Offset of the tile alloc memory
86 *
87 * This is optional on V3D 3.3 (where the CL can set the value) but
88 * required on V3D 4.1.
89 */
90 __u32 qma;
91
92 /** Size of the tile alloc memory. */
93 __u32 qms;
94
95 /** Offset of the tile state data array. */
96 __u32 qts;
97
98 /* Pointer to a u32 array of the BOs that are referenced by the job.
99 */
100 __u64 bo_handles;
101
102 /* Number of BO handles passed in (size is that times 4). */
103 __u32 bo_handle_count;
104
105 /* Pad, must be zero-filled. */
106 __u32 pad;
107};
108
109/**
110 * struct drm_v3d_wait_bo - ioctl argument for waiting for
111 * completion of the last DRM_V3D_SUBMIT_CL on a BO.
112 *
113 * This is useful for cases where multiple processes might be
114 * rendering to a BO and you want to wait for all rendering to be
115 * completed.
116 */
117struct drm_v3d_wait_bo {
118 __u32 handle;
119 __u32 pad;
120 __u64 timeout_ns;
121};
122
123/**
124 * struct drm_v3d_create_bo - ioctl argument for creating V3D BOs.
125 *
126 * There are currently no values for the flags argument, but it may be
127 * used in a future extension.
128 */
129struct drm_v3d_create_bo {
130 __u32 size;
131 __u32 flags;
132 /** Returned GEM handle for the BO. */
133 __u32 handle;
134 /**
135 * Returned offset for the BO in the V3D address space. This offset
136 * is private to the DRM fd and is valid for the lifetime of the GEM
137 * handle.
138 *
139 * This offset value will always be nonzero, since various HW
140 * units treat 0 specially.
141 */
142 __u32 offset;
143};
144
145/**
146 * struct drm_v3d_mmap_bo - ioctl argument for mapping V3D BOs.
147 *
148 * This doesn't actually perform an mmap. Instead, it returns the
149 * offset you need to use in an mmap on the DRM device node. This
150 * means that tools like valgrind end up knowing about the mapped
151 * memory.
152 *
153 * There are currently no values for the flags argument, but it may be
154 * used in a future extension.
155 */
156struct drm_v3d_mmap_bo {
157 /** Handle for the object being mapped. */
158 __u32 handle;
159 __u32 flags;
160 /** offset into the drm node to use for subsequent mmap call. */
161 __u64 offset;
162};
163
164enum drm_v3d_param {
165 DRM_V3D_PARAM_V3D_UIFCFG,
166 DRM_V3D_PARAM_V3D_HUB_IDENT1,
167 DRM_V3D_PARAM_V3D_HUB_IDENT2,
168 DRM_V3D_PARAM_V3D_HUB_IDENT3,
169 DRM_V3D_PARAM_V3D_CORE0_IDENT0,
170 DRM_V3D_PARAM_V3D_CORE0_IDENT1,
171 DRM_V3D_PARAM_V3D_CORE0_IDENT2,
172};
173
174struct drm_v3d_get_param {
175 __u32 param;
176 __u32 pad;
177 __u64 value;
178};
179
180/**
181 * Returns the offset for the BO in the V3D address space for this DRM fd.
182 * This is the same value returned by drm_v3d_create_bo, if that was called
183 * from this DRM fd.
184 */
185struct drm_v3d_get_bo_offset {
186 __u32 handle;
187 __u32 offset;
188};
189
190#if defined(__cplusplus)
191}
192#endif
193
194#endif /* _V3D_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/vc4_drm.h deleted-442
...@@ -1,442 +0,0 @@
1/*
2 * Copyright © 2014-2015 Broadcom
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#ifndef _VC4_DRM_H_
25#define _VC4_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33#define DRM_VC4_SUBMIT_CL 0x00
34#define DRM_VC4_WAIT_SEQNO 0x01
35#define DRM_VC4_WAIT_BO 0x02
36#define DRM_VC4_CREATE_BO 0x03
37#define DRM_VC4_MMAP_BO 0x04
38#define DRM_VC4_CREATE_SHADER_BO 0x05
39#define DRM_VC4_GET_HANG_STATE 0x06
40#define DRM_VC4_GET_PARAM 0x07
41#define DRM_VC4_SET_TILING 0x08
42#define DRM_VC4_GET_TILING 0x09
43#define DRM_VC4_LABEL_BO 0x0a
44#define DRM_VC4_GEM_MADVISE 0x0b
45#define DRM_VC4_PERFMON_CREATE 0x0c
46#define DRM_VC4_PERFMON_DESTROY 0x0d
47#define DRM_VC4_PERFMON_GET_VALUES 0x0e
48
49#define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl)
50#define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno)
51#define DRM_IOCTL_VC4_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_BO, struct drm_vc4_wait_bo)
52#define DRM_IOCTL_VC4_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo)
53#define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo)
54#define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo)
55#define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state)
56#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param)
57#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling)
58#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling)
59#define DRM_IOCTL_VC4_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_LABEL_BO, struct drm_vc4_label_bo)
60#define DRM_IOCTL_VC4_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GEM_MADVISE, struct drm_vc4_gem_madvise)
61#define DRM_IOCTL_VC4_PERFMON_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_CREATE, struct drm_vc4_perfmon_create)
62#define DRM_IOCTL_VC4_PERFMON_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_DESTROY, struct drm_vc4_perfmon_destroy)
63#define DRM_IOCTL_VC4_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_GET_VALUES, struct drm_vc4_perfmon_get_values)
64
65struct drm_vc4_submit_rcl_surface {
66 __u32 hindex; /* Handle index, or ~0 if not present. */
67 __u32 offset; /* Offset to start of buffer. */
68 /*
69 * Bits for either render config (color_write) or load/store packet.
70 * Bits should all be 0 for MSAA load/stores.
71 */
72 __u16 bits;
73
74#define VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES (1 << 0)
75 __u16 flags;
76};
77
78/**
79 * struct drm_vc4_submit_cl - ioctl argument for submitting commands to the 3D
80 * engine.
81 *
82 * Drivers typically use GPU BOs to store batchbuffers / command lists and
83 * their associated state. However, because the VC4 lacks an MMU, we have to
84 * do validation of memory accesses by the GPU commands. If we were to store
85 * our commands in BOs, we'd need to do uncached readback from them to do the
86 * validation process, which is too expensive. Instead, userspace accumulates
87 * commands and associated state in plain memory, then the kernel copies the
88 * data to its own address space, and then validates and stores it in a GPU
89 * BO.
90 */
91struct drm_vc4_submit_cl {
92 /* Pointer to the binner command list.
93 *
94 * This is the first set of commands executed, which runs the
95 * coordinate shader to determine where primitives land on the screen,
96 * then writes out the state updates and draw calls necessary per tile
97 * to the tile allocation BO.
98 */
99 __u64 bin_cl;
100
101 /* Pointer to the shader records.
102 *
103 * Shader records are the structures read by the hardware that contain
104 * pointers to uniforms, shaders, and vertex attributes. The
105 * reference to the shader record has enough information to determine
106 * how many pointers are necessary (fixed number for shaders/uniforms,
107 * and an attribute count), so those BO indices into bo_handles are
108 * just stored as __u32s before each shader record passed in.
109 */
110 __u64 shader_rec;
111
112 /* Pointer to uniform data and texture handles for the textures
113 * referenced by the shader.
114 *
115 * For each shader state record, there is a set of uniform data in the
116 * order referenced by the record (FS, VS, then CS). Each set of
117 * uniform data has a __u32 index into bo_handles per texture
118 * sample operation, in the order the QPU_W_TMUn_S writes appear in
119 * the program. Following the texture BO handle indices is the actual
120 * uniform data.
121 *
122 * The individual uniform state blocks don't have sizes passed in,
123 * because the kernel has to determine the sizes anyway during shader
124 * code validation.
125 */
126 __u64 uniforms;
127 __u64 bo_handles;
128
129 /* Size in bytes of the binner command list. */
130 __u32 bin_cl_size;
131 /* Size in bytes of the set of shader records. */
132 __u32 shader_rec_size;
133 /* Number of shader records.
134 *
135 * This could just be computed from the contents of shader_records and
136 * the address bits of references to them from the bin CL, but it
137 * keeps the kernel from having to resize some allocations it makes.
138 */
139 __u32 shader_rec_count;
140 /* Size in bytes of the uniform state. */
141 __u32 uniforms_size;
142
143 /* Number of BO handles passed in (size is that times 4). */
144 __u32 bo_handle_count;
145
146 /* RCL setup: */
147 __u16 width;
148 __u16 height;
149 __u8 min_x_tile;
150 __u8 min_y_tile;
151 __u8 max_x_tile;
152 __u8 max_y_tile;
153 struct drm_vc4_submit_rcl_surface color_read;
154 struct drm_vc4_submit_rcl_surface color_write;
155 struct drm_vc4_submit_rcl_surface zs_read;
156 struct drm_vc4_submit_rcl_surface zs_write;
157 struct drm_vc4_submit_rcl_surface msaa_color_write;
158 struct drm_vc4_submit_rcl_surface msaa_zs_write;
159 __u32 clear_color[2];
160 __u32 clear_z;
161 __u8 clear_s;
162
163 __u32 pad:24;
164
165#define VC4_SUBMIT_CL_USE_CLEAR_COLOR (1 << 0)
166/* By default, the kernel gets to choose the order that the tiles are
167 * rendered in. If this is set, then the tiles will be rendered in a
168 * raster order, with the right-to-left vs left-to-right and
169 * top-to-bottom vs bottom-to-top dictated by
170 * VC4_SUBMIT_CL_RCL_ORDER_INCREASING_*. This allows overlapping
171 * blits to be implemented using the 3D engine.
172 */
173#define VC4_SUBMIT_CL_FIXED_RCL_ORDER (1 << 1)
174#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_X (1 << 2)
175#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_Y (1 << 3)
176 __u32 flags;
177
178 /* Returned value of the seqno of this render job (for the
179 * wait ioctl).
180 */
181 __u64 seqno;
182
183 /* ID of the perfmon to attach to this job. 0 means no perfmon. */
184 __u32 perfmonid;
185
186 /* Syncobj handle to wait on. If set, processing of this render job
187 * will not start until the syncobj is signaled. 0 means ignore.
188 */
189 __u32 in_sync;
190
191 /* Syncobj handle to export fence to. If set, the fence in the syncobj
192 * will be replaced with a fence that signals upon completion of this
193 * render job. 0 means ignore.
194 */
195 __u32 out_sync;
196
197 __u32 pad2;
198};
199
200/**
201 * struct drm_vc4_wait_seqno - ioctl argument for waiting for
202 * DRM_VC4_SUBMIT_CL completion using its returned seqno.
203 *
204 * timeout_ns is the timeout in nanoseconds, where "0" means "don't
205 * block, just return the status."
206 */
207struct drm_vc4_wait_seqno {
208 __u64 seqno;
209 __u64 timeout_ns;
210};
211
212/**
213 * struct drm_vc4_wait_bo - ioctl argument for waiting for
214 * completion of the last DRM_VC4_SUBMIT_CL on a BO.
215 *
216 * This is useful for cases where multiple processes might be
217 * rendering to a BO and you want to wait for all rendering to be
218 * completed.
219 */
220struct drm_vc4_wait_bo {
221 __u32 handle;
222 __u32 pad;
223 __u64 timeout_ns;
224};
225
226/**
227 * struct drm_vc4_create_bo - ioctl argument for creating VC4 BOs.
228 *
229 * There are currently no values for the flags argument, but it may be
230 * used in a future extension.
231 */
232struct drm_vc4_create_bo {
233 __u32 size;
234 __u32 flags;
235 /** Returned GEM handle for the BO. */
236 __u32 handle;
237 __u32 pad;
238};
239
240/**
241 * struct drm_vc4_mmap_bo - ioctl argument for mapping VC4 BOs.
242 *
243 * This doesn't actually perform an mmap. Instead, it returns the
244 * offset you need to use in an mmap on the DRM device node. This
245 * means that tools like valgrind end up knowing about the mapped
246 * memory.
247 *
248 * There are currently no values for the flags argument, but it may be
249 * used in a future extension.
250 */
251struct drm_vc4_mmap_bo {
252 /** Handle for the object being mapped. */
253 __u32 handle;
254 __u32 flags;
255 /** offset into the drm node to use for subsequent mmap call. */
256 __u64 offset;
257};
258
259/**
260 * struct drm_vc4_create_shader_bo - ioctl argument for creating VC4
261 * shader BOs.
262 *
263 * Since allowing a shader to be overwritten while it's also being
264 * executed from would allow privlege escalation, shaders must be
265 * created using this ioctl, and they can't be mmapped later.
266 */
267struct drm_vc4_create_shader_bo {
268 /* Size of the data argument. */
269 __u32 size;
270 /* Flags, currently must be 0. */
271 __u32 flags;
272
273 /* Pointer to the data. */
274 __u64 data;
275
276 /** Returned GEM handle for the BO. */
277 __u32 handle;
278 /* Pad, must be 0. */
279 __u32 pad;
280};
281
282struct drm_vc4_get_hang_state_bo {
283 __u32 handle;
284 __u32 paddr;
285 __u32 size;
286 __u32 pad;
287};
288
289/**
290 * struct drm_vc4_hang_state - ioctl argument for collecting state
291 * from a GPU hang for analysis.
292*/
293struct drm_vc4_get_hang_state {
294 /** Pointer to array of struct drm_vc4_get_hang_state_bo. */
295 __u64 bo;
296 /**
297 * On input, the size of the bo array. Output is the number
298 * of bos to be returned.
299 */
300 __u32 bo_count;
301
302 __u32 start_bin, start_render;
303
304 __u32 ct0ca, ct0ea;
305 __u32 ct1ca, ct1ea;
306 __u32 ct0cs, ct1cs;
307 __u32 ct0ra0, ct1ra0;
308
309 __u32 bpca, bpcs;
310 __u32 bpoa, bpos;
311
312 __u32 vpmbase;
313
314 __u32 dbge;
315 __u32 fdbgo;
316 __u32 fdbgb;
317 __u32 fdbgr;
318 __u32 fdbgs;
319 __u32 errstat;
320
321 /* Pad that we may save more registers into in the future. */
322 __u32 pad[16];
323};
324
325#define DRM_VC4_PARAM_V3D_IDENT0 0
326#define DRM_VC4_PARAM_V3D_IDENT1 1
327#define DRM_VC4_PARAM_V3D_IDENT2 2
328#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3
329#define DRM_VC4_PARAM_SUPPORTS_ETC1 4
330#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS 5
331#define DRM_VC4_PARAM_SUPPORTS_FIXED_RCL_ORDER 6
332#define DRM_VC4_PARAM_SUPPORTS_MADVISE 7
333#define DRM_VC4_PARAM_SUPPORTS_PERFMON 8
334
335struct drm_vc4_get_param {
336 __u32 param;
337 __u32 pad;
338 __u64 value;
339};
340
341struct drm_vc4_get_tiling {
342 __u32 handle;
343 __u32 flags;
344 __u64 modifier;
345};
346
347struct drm_vc4_set_tiling {
348 __u32 handle;
349 __u32 flags;
350 __u64 modifier;
351};
352
353/**
354 * struct drm_vc4_label_bo - Attach a name to a BO for debug purposes.
355 */
356struct drm_vc4_label_bo {
357 __u32 handle;
358 __u32 len;
359 __u64 name;
360};
361
362/*
363 * States prefixed with '__' are internal states and cannot be passed to the
364 * DRM_IOCTL_VC4_GEM_MADVISE ioctl.
365 */
366#define VC4_MADV_WILLNEED 0
367#define VC4_MADV_DONTNEED 1
368#define __VC4_MADV_PURGED 2
369#define __VC4_MADV_NOTSUPP 3
370
371struct drm_vc4_gem_madvise {
372 __u32 handle;
373 __u32 madv;
374 __u32 retained;
375 __u32 pad;
376};
377
378enum {
379 VC4_PERFCNT_FEP_VALID_PRIMS_NO_RENDER,
380 VC4_PERFCNT_FEP_VALID_PRIMS_RENDER,
381 VC4_PERFCNT_FEP_CLIPPED_QUADS,
382 VC4_PERFCNT_FEP_VALID_QUADS,
383 VC4_PERFCNT_TLB_QUADS_NOT_PASSING_STENCIL,
384 VC4_PERFCNT_TLB_QUADS_NOT_PASSING_Z_AND_STENCIL,
385 VC4_PERFCNT_TLB_QUADS_PASSING_Z_AND_STENCIL,
386 VC4_PERFCNT_TLB_QUADS_ZERO_COVERAGE,
387 VC4_PERFCNT_TLB_QUADS_NON_ZERO_COVERAGE,
388 VC4_PERFCNT_TLB_QUADS_WRITTEN_TO_COLOR_BUF,
389 VC4_PERFCNT_PLB_PRIMS_OUTSIDE_VIEWPORT,
390 VC4_PERFCNT_PLB_PRIMS_NEED_CLIPPING,
391 VC4_PERFCNT_PSE_PRIMS_REVERSED,
392 VC4_PERFCNT_QPU_TOTAL_IDLE_CYCLES,
393 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_VERTEX_COORD_SHADING,
394 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_FRAGMENT_SHADING,
395 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_EXEC_VALID_INST,
396 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_TMUS,
397 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_SCOREBOARD,
398 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_VARYINGS,
399 VC4_PERFCNT_QPU_TOTAL_INST_CACHE_HIT,
400 VC4_PERFCNT_QPU_TOTAL_INST_CACHE_MISS,
401 VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_HIT,
402 VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_MISS,
403 VC4_PERFCNT_TMU_TOTAL_TEXT_QUADS_PROCESSED,
404 VC4_PERFCNT_TMU_TOTAL_TEXT_CACHE_MISS,
405 VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VDW_STALLED,
406 VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VCD_STALLED,
407 VC4_PERFCNT_L2C_TOTAL_L2_CACHE_HIT,
408 VC4_PERFCNT_L2C_TOTAL_L2_CACHE_MISS,
409 VC4_PERFCNT_NUM_EVENTS,
410};
411
412#define DRM_VC4_MAX_PERF_COUNTERS 16
413
414struct drm_vc4_perfmon_create {
415 __u32 id;
416 __u32 ncounters;
417 __u8 events[DRM_VC4_MAX_PERF_COUNTERS];
418};
419
420struct drm_vc4_perfmon_destroy {
421 __u32 id;
422};
423
424/*
425 * Returns the values of the performance counters tracked by this
426 * perfmon (as an array of ncounters u64 values).
427 *
428 * No implicit synchronization is performed, so the user has to
429 * guarantee that any jobs using this perfmon have already been
430 * completed (probably by blocking on the seqno returned by the
431 * last exec that used the perfmon).
432 */
433struct drm_vc4_perfmon_get_values {
434 __u32 id;
435 __u64 values_ptr;
436};
437
438#if defined(__cplusplus)
439}
440#endif
441
442#endif /* _VC4_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/vgem_drm.h deleted-62
...@@ -1,62 +0,0 @@
1/*
2 * Copyright 2016 Intel Corporation
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
27#ifndef _VGEM_DRM_H_
28#define _VGEM_DRM_H_
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* Please note that modifications to all structs defined here are
37 * subject to backwards-compatibility constraints.
38 */
39#define DRM_VGEM_FENCE_ATTACH 0x1
40#define DRM_VGEM_FENCE_SIGNAL 0x2
41
42#define DRM_IOCTL_VGEM_FENCE_ATTACH DRM_IOWR( DRM_COMMAND_BASE + DRM_VGEM_FENCE_ATTACH, struct drm_vgem_fence_attach)
43#define DRM_IOCTL_VGEM_FENCE_SIGNAL DRM_IOW( DRM_COMMAND_BASE + DRM_VGEM_FENCE_SIGNAL, struct drm_vgem_fence_signal)
44
45struct drm_vgem_fence_attach {
46 __u32 handle;
47 __u32 flags;
48#define VGEM_FENCE_WRITE 0x1
49 __u32 out_fence;
50 __u32 pad;
51};
52
53struct drm_vgem_fence_signal {
54 __u32 fence;
55 __u32 flags;
56};
57
58#if defined(__cplusplus)
59}
60#endif
61
62#endif /* _VGEM_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/via_drm.h deleted-282
...@@ -1,282 +0,0 @@
1/*
2 * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24#ifndef _VIA_DRM_H_
25#define _VIA_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* WARNING: These defines must be the same as what the Xserver uses.
34 * if you change them, you must change the defines in the Xserver.
35 */
36
37#ifndef _VIA_DEFINES_
38#define _VIA_DEFINES_
39
40
41#define VIA_NR_SAREA_CLIPRECTS 8
42#define VIA_NR_XVMC_PORTS 10
43#define VIA_NR_XVMC_LOCKS 5
44#define VIA_MAX_CACHELINE_SIZE 64
45#define XVMCLOCKPTR(saPriv,lockNo) \
46 ((__volatile__ struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
47 (VIA_MAX_CACHELINE_SIZE - 1)) & \
48 ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
49 VIA_MAX_CACHELINE_SIZE*(lockNo)))
50
51/* Each region is a minimum of 64k, and there are at most 64 of them.
52 */
53#define VIA_NR_TEX_REGIONS 64
54#define VIA_LOG_MIN_TEX_REGION_SIZE 16
55#endif
56
57#define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
58#define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
59#define VIA_UPLOAD_CTX 0x4
60#define VIA_UPLOAD_BUFFERS 0x8
61#define VIA_UPLOAD_TEX0 0x10
62#define VIA_UPLOAD_TEX1 0x20
63#define VIA_UPLOAD_CLIPRECTS 0x40
64#define VIA_UPLOAD_ALL 0xff
65
66/* VIA specific ioctls */
67#define DRM_VIA_ALLOCMEM 0x00
68#define DRM_VIA_FREEMEM 0x01
69#define DRM_VIA_AGP_INIT 0x02
70#define DRM_VIA_FB_INIT 0x03
71#define DRM_VIA_MAP_INIT 0x04
72#define DRM_VIA_DEC_FUTEX 0x05
73#define NOT_USED
74#define DRM_VIA_DMA_INIT 0x07
75#define DRM_VIA_CMDBUFFER 0x08
76#define DRM_VIA_FLUSH 0x09
77#define DRM_VIA_PCICMD 0x0a
78#define DRM_VIA_CMDBUF_SIZE 0x0b
79#define NOT_USED
80#define DRM_VIA_WAIT_IRQ 0x0d
81#define DRM_VIA_DMA_BLIT 0x0e
82#define DRM_VIA_BLIT_SYNC 0x0f
83
84#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
85#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
86#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
87#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
88#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
89#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
90#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
91#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
92#define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
93#define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
94#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
95 drm_via_cmdbuf_size_t)
96#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
97#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
98#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
99
100/* Indices into buf.Setup where various bits of state are mirrored per
101 * context and per buffer. These can be fired at the card as a unit,
102 * or in a piecewise fashion as required.
103 */
104
105#define VIA_TEX_SETUP_SIZE 8
106
107/* Flags for clear ioctl
108 */
109#define VIA_FRONT 0x1
110#define VIA_BACK 0x2
111#define VIA_DEPTH 0x4
112#define VIA_STENCIL 0x8
113#define VIA_MEM_VIDEO 0 /* matches drm constant */
114#define VIA_MEM_AGP 1 /* matches drm constant */
115#define VIA_MEM_SYSTEM 2
116#define VIA_MEM_MIXED 3
117#define VIA_MEM_UNKNOWN 4
118
119typedef struct {
120 __u32 offset;
121 __u32 size;
122} drm_via_agp_t;
123
124typedef struct {
125 __u32 offset;
126 __u32 size;
127} drm_via_fb_t;
128
129typedef struct {
130 __u32 context;
131 __u32 type;
132 __u32 size;
133 unsigned long index;
134 unsigned long offset;
135} drm_via_mem_t;
136
137typedef struct _drm_via_init {
138 enum {
139 VIA_INIT_MAP = 0x01,
140 VIA_CLEANUP_MAP = 0x02
141 } func;
142
143 unsigned long sarea_priv_offset;
144 unsigned long fb_offset;
145 unsigned long mmio_offset;
146 unsigned long agpAddr;
147} drm_via_init_t;
148
149typedef struct _drm_via_futex {
150 enum {
151 VIA_FUTEX_WAIT = 0x00,
152 VIA_FUTEX_WAKE = 0X01
153 } func;
154 __u32 ms;
155 __u32 lock;
156 __u32 val;
157} drm_via_futex_t;
158
159typedef struct _drm_via_dma_init {
160 enum {
161 VIA_INIT_DMA = 0x01,
162 VIA_CLEANUP_DMA = 0x02,
163 VIA_DMA_INITIALIZED = 0x03
164 } func;
165
166 unsigned long offset;
167 unsigned long size;
168 unsigned long reg_pause_addr;
169} drm_via_dma_init_t;
170
171typedef struct _drm_via_cmdbuffer {
172 char *buf;
173 unsigned long size;
174} drm_via_cmdbuffer_t;
175
176/* Warning: If you change the SAREA structure you must change the Xserver
177 * structure as well */
178
179typedef struct _drm_via_tex_region {
180 unsigned char next, prev; /* indices to form a circular LRU */
181 unsigned char inUse; /* owned by a client, or free? */
182 int age; /* tracked by clients to update local LRU's */
183} drm_via_tex_region_t;
184
185typedef struct _drm_via_sarea {
186 unsigned int dirty;
187 unsigned int nbox;
188 struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
189 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
190 int texAge; /* last time texture was uploaded */
191 int ctxOwner; /* last context to upload state */
192 int vertexPrim;
193
194 /*
195 * Below is for XvMC.
196 * We want the lock integers alone on, and aligned to, a cache line.
197 * Therefore this somewhat strange construct.
198 */
199
200 char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
201
202 unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
203 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
204 unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
205
206 /* Used by the 3d driver only at this point, for pageflipping:
207 */
208 unsigned int pfCurrentOffset;
209} drm_via_sarea_t;
210
211typedef struct _drm_via_cmdbuf_size {
212 enum {
213 VIA_CMDBUF_SPACE = 0x01,
214 VIA_CMDBUF_LAG = 0x02
215 } func;
216 int wait;
217 __u32 size;
218} drm_via_cmdbuf_size_t;
219
220typedef enum {
221 VIA_IRQ_ABSOLUTE = 0x0,
222 VIA_IRQ_RELATIVE = 0x1,
223 VIA_IRQ_SIGNAL = 0x10000000,
224 VIA_IRQ_FORCE_SEQUENCE = 0x20000000
225} via_irq_seq_type_t;
226
227#define VIA_IRQ_FLAGS_MASK 0xF0000000
228
229enum drm_via_irqs {
230 drm_via_irq_hqv0 = 0,
231 drm_via_irq_hqv1,
232 drm_via_irq_dma0_dd,
233 drm_via_irq_dma0_td,
234 drm_via_irq_dma1_dd,
235 drm_via_irq_dma1_td,
236 drm_via_irq_num
237};
238
239struct drm_via_wait_irq_request {
240 unsigned irq;
241 via_irq_seq_type_t type;
242 __u32 sequence;
243 __u32 signal;
244};
245
246typedef union drm_via_irqwait {
247 struct drm_via_wait_irq_request request;
248 struct drm_wait_vblank_reply reply;
249} drm_via_irqwait_t;
250
251typedef struct drm_via_blitsync {
252 __u32 sync_handle;
253 unsigned engine;
254} drm_via_blitsync_t;
255
256/* - * Below,"flags" is currently unused but will be used for possible future
257 * extensions like kernel space bounce buffers for bad alignments and
258 * blit engine busy-wait polling for better latency in the absence of
259 * interrupts.
260 */
261
262typedef struct drm_via_dmablit {
263 __u32 num_lines;
264 __u32 line_length;
265
266 __u32 fb_addr;
267 __u32 fb_stride;
268
269 unsigned char *mem_addr;
270 __u32 mem_stride;
271
272 __u32 flags;
273 int to_fb;
274
275 drm_via_blitsync_t sync;
276} drm_via_dmablit_t;
277
278#if defined(__cplusplus)
279}
280#endif
281
282#endif /* _VIA_DRM_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/drm/virtgpu_drm.h deleted-175
...@@ -1,175 +0,0 @@
1/*
2 * Copyright 2013 Red Hat
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24#ifndef VIRTGPU_DRM_H
25#define VIRTGPU_DRM_H
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* Please note that modifications to all structs defined here are
34 * subject to backwards-compatibility constraints.
35 *
36 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
37 * compatibility Keep fields aligned to their size
38 */
39
40#define DRM_VIRTGPU_MAP 0x01
41#define DRM_VIRTGPU_EXECBUFFER 0x02
42#define DRM_VIRTGPU_GETPARAM 0x03
43#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
44#define DRM_VIRTGPU_RESOURCE_INFO 0x05
45#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
46#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
47#define DRM_VIRTGPU_WAIT 0x08
48#define DRM_VIRTGPU_GET_CAPS 0x09
49
50struct drm_virtgpu_map {
51 __u64 offset; /* use for mmap system call */
52 __u32 handle;
53 __u32 pad;
54};
55
56struct drm_virtgpu_execbuffer {
57 __u32 flags; /* for future use */
58 __u32 size;
59 __u64 command; /* void* */
60 __u64 bo_handles;
61 __u32 num_bo_handles;
62 __u32 pad;
63};
64
65#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
66#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */
67
68struct drm_virtgpu_getparam {
69 __u64 param;
70 __u64 value;
71};
72
73/* NO_BO flags? NO resource flag? */
74/* resource flag for y_0_top */
75struct drm_virtgpu_resource_create {
76 __u32 target;
77 __u32 format;
78 __u32 bind;
79 __u32 width;
80 __u32 height;
81 __u32 depth;
82 __u32 array_size;
83 __u32 last_level;
84 __u32 nr_samples;
85 __u32 flags;
86 __u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
87 __u32 res_handle; /* returned by kernel */
88 __u32 size; /* validate transfer in the host */
89 __u32 stride; /* validate transfer in the host */
90};
91
92struct drm_virtgpu_resource_info {
93 __u32 bo_handle;
94 __u32 res_handle;
95 __u32 size;
96 __u32 stride;
97};
98
99struct drm_virtgpu_3d_box {
100 __u32 x;
101 __u32 y;
102 __u32 z;
103 __u32 w;
104 __u32 h;
105 __u32 d;
106};
107
108struct drm_virtgpu_3d_transfer_to_host {
109 __u32 bo_handle;
110 struct drm_virtgpu_3d_box box;
111 __u32 level;
112 __u32 offset;
113};
114
115struct drm_virtgpu_3d_transfer_from_host {
116 __u32 bo_handle;
117 struct drm_virtgpu_3d_box box;
118 __u32 level;
119 __u32 offset;
120};
121
122#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
123struct drm_virtgpu_3d_wait {
124 __u32 handle; /* 0 is an invalid handle */
125 __u32 flags;
126};
127
128struct drm_virtgpu_get_caps {
129 __u32 cap_set_id;
130 __u32 cap_set_ver;
131 __u64 addr;
132 __u32 size;
133 __u32 pad;
134};
135
136#define DRM_IOCTL_VIRTGPU_MAP \
137 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
138
139#define DRM_IOCTL_VIRTGPU_EXECBUFFER \
140 DRM_IOW(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\
141 struct drm_virtgpu_execbuffer)
142
143#define DRM_IOCTL_VIRTGPU_GETPARAM \
144 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM,\
145 struct drm_virtgpu_getparam)
146
147#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE \
148 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE, \
149 struct drm_virtgpu_resource_create)
150
151#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO \
152 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, \
153 struct drm_virtgpu_resource_info)
154
155#define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST \
156 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST, \
157 struct drm_virtgpu_3d_transfer_from_host)
158
159#define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST \
160 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST, \
161 struct drm_virtgpu_3d_transfer_to_host)
162
163#define DRM_IOCTL_VIRTGPU_WAIT \
164 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT, \
165 struct drm_virtgpu_3d_wait)
166
167#define DRM_IOCTL_VIRTGPU_GET_CAPS \
168 DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
169 struct drm_virtgpu_get_caps)
170
171#if defined(__cplusplus)
172}
173#endif
174
175#endif
\ No newline at end of file
lib/libc/include/generic-musl/drm/vmwgfx_drm.h deleted-1218
...@@ -1,1218 +0,0 @@
1/**************************************************************************
2 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28#ifndef __VMWGFX_DRM_H__
29#define __VMWGFX_DRM_H__
30
31#include "drm.h"
32
33#if defined(__cplusplus)
34extern "C" {
35#endif
36
37#define DRM_VMW_MAX_SURFACE_FACES 6
38#define DRM_VMW_MAX_MIP_LEVELS 24
39
40
41#define DRM_VMW_GET_PARAM 0
42#define DRM_VMW_ALLOC_DMABUF 1
43#define DRM_VMW_ALLOC_BO 1
44#define DRM_VMW_UNREF_DMABUF 2
45#define DRM_VMW_HANDLE_CLOSE 2
46#define DRM_VMW_CURSOR_BYPASS 3
47/* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/
48#define DRM_VMW_CONTROL_STREAM 4
49#define DRM_VMW_CLAIM_STREAM 5
50#define DRM_VMW_UNREF_STREAM 6
51/* guarded by DRM_VMW_PARAM_3D == 1 */
52#define DRM_VMW_CREATE_CONTEXT 7
53#define DRM_VMW_UNREF_CONTEXT 8
54#define DRM_VMW_CREATE_SURFACE 9
55#define DRM_VMW_UNREF_SURFACE 10
56#define DRM_VMW_REF_SURFACE 11
57#define DRM_VMW_EXECBUF 12
58#define DRM_VMW_GET_3D_CAP 13
59#define DRM_VMW_FENCE_WAIT 14
60#define DRM_VMW_FENCE_SIGNALED 15
61#define DRM_VMW_FENCE_UNREF 16
62#define DRM_VMW_FENCE_EVENT 17
63#define DRM_VMW_PRESENT 18
64#define DRM_VMW_PRESENT_READBACK 19
65#define DRM_VMW_UPDATE_LAYOUT 20
66#define DRM_VMW_CREATE_SHADER 21
67#define DRM_VMW_UNREF_SHADER 22
68#define DRM_VMW_GB_SURFACE_CREATE 23
69#define DRM_VMW_GB_SURFACE_REF 24
70#define DRM_VMW_SYNCCPU 25
71#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
72#define DRM_VMW_GB_SURFACE_CREATE_EXT 27
73#define DRM_VMW_GB_SURFACE_REF_EXT 28
74
75/*************************************************************************/
76/**
77 * DRM_VMW_GET_PARAM - get device information.
78 *
79 * DRM_VMW_PARAM_FIFO_OFFSET:
80 * Offset to use to map the first page of the FIFO read-only.
81 * The fifo is mapped using the mmap() system call on the drm device.
82 *
83 * DRM_VMW_PARAM_OVERLAY_IOCTL:
84 * Does the driver support the overlay ioctl.
85 *
86 * DRM_VMW_PARAM_SM4_1
87 * SM4_1 support is enabled.
88 */
89
90#define DRM_VMW_PARAM_NUM_STREAMS 0
91#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
92#define DRM_VMW_PARAM_3D 2
93#define DRM_VMW_PARAM_HW_CAPS 3
94#define DRM_VMW_PARAM_FIFO_CAPS 4
95#define DRM_VMW_PARAM_MAX_FB_SIZE 5
96#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
97#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
98#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
99#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
100#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
101#define DRM_VMW_PARAM_SCREEN_TARGET 11
102#define DRM_VMW_PARAM_DX 12
103#define DRM_VMW_PARAM_HW_CAPS2 13
104#define DRM_VMW_PARAM_SM4_1 14
105
106/**
107 * enum drm_vmw_handle_type - handle type for ref ioctls
108 *
109 */
110enum drm_vmw_handle_type {
111 DRM_VMW_HANDLE_LEGACY = 0,
112 DRM_VMW_HANDLE_PRIME = 1
113};
114
115/**
116 * struct drm_vmw_getparam_arg
117 *
118 * @value: Returned value. //Out
119 * @param: Parameter to query. //In.
120 *
121 * Argument to the DRM_VMW_GET_PARAM Ioctl.
122 */
123
124struct drm_vmw_getparam_arg {
125 __u64 value;
126 __u32 param;
127 __u32 pad64;
128};
129
130/*************************************************************************/
131/**
132 * DRM_VMW_CREATE_CONTEXT - Create a host context.
133 *
134 * Allocates a device unique context id, and queues a create context command
135 * for the host. Does not wait for host completion.
136 */
137
138/**
139 * struct drm_vmw_context_arg
140 *
141 * @cid: Device unique context ID.
142 *
143 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
144 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
145 */
146
147struct drm_vmw_context_arg {
148 __s32 cid;
149 __u32 pad64;
150};
151
152/*************************************************************************/
153/**
154 * DRM_VMW_UNREF_CONTEXT - Create a host context.
155 *
156 * Frees a global context id, and queues a destroy host command for the host.
157 * Does not wait for host completion. The context ID can be used directly
158 * in the command stream and shows up as the same context ID on the host.
159 */
160
161/*************************************************************************/
162/**
163 * DRM_VMW_CREATE_SURFACE - Create a host suface.
164 *
165 * Allocates a device unique surface id, and queues a create surface command
166 * for the host. Does not wait for host completion. The surface ID can be
167 * used directly in the command stream and shows up as the same surface
168 * ID on the host.
169 */
170
171/**
172 * struct drm_wmv_surface_create_req
173 *
174 * @flags: Surface flags as understood by the host.
175 * @format: Surface format as understood by the host.
176 * @mip_levels: Number of mip levels for each face.
177 * An unused face should have 0 encoded.
178 * @size_addr: Address of a user-space array of sruct drm_vmw_size
179 * cast to an __u64 for 32-64 bit compatibility.
180 * The size of the array should equal the total number of mipmap levels.
181 * @shareable: Boolean whether other clients (as identified by file descriptors)
182 * may reference this surface.
183 * @scanout: Boolean whether the surface is intended to be used as a
184 * scanout.
185 *
186 * Input data to the DRM_VMW_CREATE_SURFACE Ioctl.
187 * Output data from the DRM_VMW_REF_SURFACE Ioctl.
188 */
189
190struct drm_vmw_surface_create_req {
191 __u32 flags;
192 __u32 format;
193 __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
194 __u64 size_addr;
195 __s32 shareable;
196 __s32 scanout;
197};
198
199/**
200 * struct drm_wmv_surface_arg
201 *
202 * @sid: Surface id of created surface or surface to destroy or reference.
203 * @handle_type: Handle type for DRM_VMW_REF_SURFACE Ioctl.
204 *
205 * Output data from the DRM_VMW_CREATE_SURFACE Ioctl.
206 * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl.
207 * Input argument to the DRM_VMW_REF_SURFACE Ioctl.
208 */
209
210struct drm_vmw_surface_arg {
211 __s32 sid;
212 enum drm_vmw_handle_type handle_type;
213};
214
215/**
216 * struct drm_vmw_size ioctl.
217 *
218 * @width - mip level width
219 * @height - mip level height
220 * @depth - mip level depth
221 *
222 * Description of a mip level.
223 * Input data to the DRM_WMW_CREATE_SURFACE Ioctl.
224 */
225
226struct drm_vmw_size {
227 __u32 width;
228 __u32 height;
229 __u32 depth;
230 __u32 pad64;
231};
232
233/**
234 * union drm_vmw_surface_create_arg
235 *
236 * @rep: Output data as described above.
237 * @req: Input data as described above.
238 *
239 * Argument to the DRM_VMW_CREATE_SURFACE Ioctl.
240 */
241
242union drm_vmw_surface_create_arg {
243 struct drm_vmw_surface_arg rep;
244 struct drm_vmw_surface_create_req req;
245};
246
247/*************************************************************************/
248/**
249 * DRM_VMW_REF_SURFACE - Reference a host surface.
250 *
251 * Puts a reference on a host surface with a give sid, as previously
252 * returned by the DRM_VMW_CREATE_SURFACE ioctl.
253 * A reference will make sure the surface isn't destroyed while we hold
254 * it and will allow the calling client to use the surface ID in the command
255 * stream.
256 *
257 * On successful return, the Ioctl returns the surface information given
258 * in the DRM_VMW_CREATE_SURFACE ioctl.
259 */
260
261/**
262 * union drm_vmw_surface_reference_arg
263 *
264 * @rep: Output data as described above.
265 * @req: Input data as described above.
266 *
267 * Argument to the DRM_VMW_REF_SURFACE Ioctl.
268 */
269
270union drm_vmw_surface_reference_arg {
271 struct drm_vmw_surface_create_req rep;
272 struct drm_vmw_surface_arg req;
273};
274
275/*************************************************************************/
276/**
277 * DRM_VMW_UNREF_SURFACE - Unreference a host surface.
278 *
279 * Clear a reference previously put on a host surface.
280 * When all references are gone, including the one implicitly placed
281 * on creation,
282 * a destroy surface command will be queued for the host.
283 * Does not wait for completion.
284 */
285
286/*************************************************************************/
287/**
288 * DRM_VMW_EXECBUF
289 *
290 * Submit a command buffer for execution on the host, and return a
291 * fence seqno that when signaled, indicates that the command buffer has
292 * executed.
293 */
294
295/**
296 * struct drm_vmw_execbuf_arg
297 *
298 * @commands: User-space address of a command buffer cast to an __u64.
299 * @command-size: Size in bytes of the command buffer.
300 * @throttle-us: Sleep until software is less than @throttle_us
301 * microseconds ahead of hardware. The driver may round this value
302 * to the nearest kernel tick.
303 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
304 * __u64.
305 * @version: Allows expanding the execbuf ioctl parameters without breaking
306 * backwards compatibility, since user-space will always tell the kernel
307 * which version it uses.
308 * @flags: Execbuf flags.
309 * @imported_fence_fd: FD for a fence imported from another device
310 *
311 * Argument to the DRM_VMW_EXECBUF Ioctl.
312 */
313
314#define DRM_VMW_EXECBUF_VERSION 2
315
316#define DRM_VMW_EXECBUF_FLAG_IMPORT_FENCE_FD (1 << 0)
317#define DRM_VMW_EXECBUF_FLAG_EXPORT_FENCE_FD (1 << 1)
318
319struct drm_vmw_execbuf_arg {
320 __u64 commands;
321 __u32 command_size;
322 __u32 throttle_us;
323 __u64 fence_rep;
324 __u32 version;
325 __u32 flags;
326 __u32 context_handle;
327 __s32 imported_fence_fd;
328};
329
330/**
331 * struct drm_vmw_fence_rep
332 *
333 * @handle: Fence object handle for fence associated with a command submission.
334 * @mask: Fence flags relevant for this fence object.
335 * @seqno: Fence sequence number in fifo. A fence object with a lower
336 * seqno will signal the EXEC flag before a fence object with a higher
337 * seqno. This can be used by user-space to avoid kernel calls to determine
338 * whether a fence has signaled the EXEC flag. Note that @seqno will
339 * wrap at 32-bit.
340 * @passed_seqno: The highest seqno number processed by the hardware
341 * so far. This can be used to mark user-space fence objects as signaled, and
342 * to determine whether a fence seqno might be stale.
343 * @fd: FD associated with the fence, -1 if not exported
344 * @error: This member should've been set to -EFAULT on submission.
345 * The following actions should be take on completion:
346 * error == -EFAULT: Fence communication failed. The host is synchronized.
347 * Use the last fence id read from the FIFO fence register.
348 * error != 0 && error != -EFAULT:
349 * Fence submission failed. The host is synchronized. Use the fence_seq member.
350 * error == 0: All is OK, The host may not be synchronized.
351 * Use the fence_seq member.
352 *
353 * Input / Output data to the DRM_VMW_EXECBUF Ioctl.
354 */
355
356struct drm_vmw_fence_rep {
357 __u32 handle;
358 __u32 mask;
359 __u32 seqno;
360 __u32 passed_seqno;
361 __s32 fd;
362 __s32 error;
363};
364
365/*************************************************************************/
366/**
367 * DRM_VMW_ALLOC_BO
368 *
369 * Allocate a buffer object that is visible also to the host.
370 * NOTE: The buffer is
371 * identified by a handle and an offset, which are private to the guest, but
372 * useable in the command stream. The guest kernel may translate these
373 * and patch up the command stream accordingly. In the future, the offset may
374 * be zero at all times, or it may disappear from the interface before it is
375 * fixed.
376 *
377 * The buffer object may stay user-space mapped in the guest at all times,
378 * and is thus suitable for sub-allocation.
379 *
380 * Buffer objects are mapped using the mmap() syscall on the drm device.
381 */
382
383/**
384 * struct drm_vmw_alloc_bo_req
385 *
386 * @size: Required minimum size of the buffer.
387 *
388 * Input data to the DRM_VMW_ALLOC_BO Ioctl.
389 */
390
391struct drm_vmw_alloc_bo_req {
392 __u32 size;
393 __u32 pad64;
394};
395#define drm_vmw_alloc_dmabuf_req drm_vmw_alloc_bo_req
396
397/**
398 * struct drm_vmw_bo_rep
399 *
400 * @map_handle: Offset to use in the mmap() call used to map the buffer.
401 * @handle: Handle unique to this buffer. Used for unreferencing.
402 * @cur_gmr_id: GMR id to use in the command stream when this buffer is
403 * referenced. See not above.
404 * @cur_gmr_offset: Offset to use in the command stream when this buffer is
405 * referenced. See note above.
406 *
407 * Output data from the DRM_VMW_ALLOC_BO Ioctl.
408 */
409
410struct drm_vmw_bo_rep {
411 __u64 map_handle;
412 __u32 handle;
413 __u32 cur_gmr_id;
414 __u32 cur_gmr_offset;
415 __u32 pad64;
416};
417#define drm_vmw_dmabuf_rep drm_vmw_bo_rep
418
419/**
420 * union drm_vmw_alloc_bo_arg
421 *
422 * @req: Input data as described above.
423 * @rep: Output data as described above.
424 *
425 * Argument to the DRM_VMW_ALLOC_BO Ioctl.
426 */
427
428union drm_vmw_alloc_bo_arg {
429 struct drm_vmw_alloc_bo_req req;
430 struct drm_vmw_bo_rep rep;
431};
432#define drm_vmw_alloc_dmabuf_arg drm_vmw_alloc_bo_arg
433
434/*************************************************************************/
435/**
436 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams.
437 *
438 * This IOCTL controls the overlay units of the svga device.
439 * The SVGA overlay units does not work like regular hardware units in
440 * that they do not automaticaly read back the contents of the given dma
441 * buffer. But instead only read back for each call to this ioctl, and
442 * at any point between this call being made and a following call that
443 * either changes the buffer or disables the stream.
444 */
445
446/**
447 * struct drm_vmw_rect
448 *
449 * Defines a rectangle. Used in the overlay ioctl to define
450 * source and destination rectangle.
451 */
452
453struct drm_vmw_rect {
454 __s32 x;
455 __s32 y;
456 __u32 w;
457 __u32 h;
458};
459
460/**
461 * struct drm_vmw_control_stream_arg
462 *
463 * @stream_id: Stearm to control
464 * @enabled: If false all following arguments are ignored.
465 * @handle: Handle to buffer for getting data from.
466 * @format: Format of the overlay as understood by the host.
467 * @width: Width of the overlay.
468 * @height: Height of the overlay.
469 * @size: Size of the overlay in bytes.
470 * @pitch: Array of pitches, the two last are only used for YUV12 formats.
471 * @offset: Offset from start of dma buffer to overlay.
472 * @src: Source rect, must be within the defined area above.
473 * @dst: Destination rect, x and y may be negative.
474 *
475 * Argument to the DRM_VMW_CONTROL_STREAM Ioctl.
476 */
477
478struct drm_vmw_control_stream_arg {
479 __u32 stream_id;
480 __u32 enabled;
481
482 __u32 flags;
483 __u32 color_key;
484
485 __u32 handle;
486 __u32 offset;
487 __s32 format;
488 __u32 size;
489 __u32 width;
490 __u32 height;
491 __u32 pitch[3];
492
493 __u32 pad64;
494 struct drm_vmw_rect src;
495 struct drm_vmw_rect dst;
496};
497
498/*************************************************************************/
499/**
500 * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
501 *
502 */
503
504#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
505#define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
506
507/**
508 * struct drm_vmw_cursor_bypass_arg
509 *
510 * @flags: Flags.
511 * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
512 * @xpos: X position of cursor.
513 * @ypos: Y position of cursor.
514 * @xhot: X hotspot.
515 * @yhot: Y hotspot.
516 *
517 * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
518 */
519
520struct drm_vmw_cursor_bypass_arg {
521 __u32 flags;
522 __u32 crtc_id;
523 __s32 xpos;
524 __s32 ypos;
525 __s32 xhot;
526 __s32 yhot;
527};
528
529/*************************************************************************/
530/**
531 * DRM_VMW_CLAIM_STREAM - Claim a single stream.
532 */
533
534/**
535 * struct drm_vmw_context_arg
536 *
537 * @stream_id: Device unique context ID.
538 *
539 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
540 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
541 */
542
543struct drm_vmw_stream_arg {
544 __u32 stream_id;
545 __u32 pad64;
546};
547
548/*************************************************************************/
549/**
550 * DRM_VMW_UNREF_STREAM - Unclaim a stream.
551 *
552 * Return a single stream that was claimed by this process. Also makes
553 * sure that the stream has been stopped.
554 */
555
556/*************************************************************************/
557/**
558 * DRM_VMW_GET_3D_CAP
559 *
560 * Read 3D capabilities from the FIFO
561 *
562 */
563
564/**
565 * struct drm_vmw_get_3d_cap_arg
566 *
567 * @buffer: Pointer to a buffer for capability data, cast to an __u64
568 * @size: Max size to copy
569 *
570 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
571 * ioctls.
572 */
573
574struct drm_vmw_get_3d_cap_arg {
575 __u64 buffer;
576 __u32 max_size;
577 __u32 pad64;
578};
579
580/*************************************************************************/
581/**
582 * DRM_VMW_FENCE_WAIT
583 *
584 * Waits for a fence object to signal. The wait is interruptible, so that
585 * signals may be delivered during the interrupt. The wait may timeout,
586 * in which case the calls returns -EBUSY. If the wait is restarted,
587 * that is restarting without resetting @cookie_valid to zero,
588 * the timeout is computed from the first call.
589 *
590 * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
591 * on:
592 * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
593 * stream
594 * have executed.
595 * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
596 * commands
597 * in the buffer given to the EXECBUF ioctl returning the fence object handle
598 * are available to user-space.
599 *
600 * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
601 * fenc wait ioctl returns 0, the fence object has been unreferenced after
602 * the wait.
603 */
604
605#define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
606#define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
607
608#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
609
610/**
611 * struct drm_vmw_fence_wait_arg
612 *
613 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
614 * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
615 * @kernel_cookie: Set to 0 on first call. Left alone on restart.
616 * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
617 * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
618 * before returning.
619 * @flags: Fence flags to wait on.
620 * @wait_options: Options that control the behaviour of the wait ioctl.
621 *
622 * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
623 */
624
625struct drm_vmw_fence_wait_arg {
626 __u32 handle;
627 __s32 cookie_valid;
628 __u64 kernel_cookie;
629 __u64 timeout_us;
630 __s32 lazy;
631 __s32 flags;
632 __s32 wait_options;
633 __s32 pad64;
634};
635
636/*************************************************************************/
637/**
638 * DRM_VMW_FENCE_SIGNALED
639 *
640 * Checks if a fence object is signaled..
641 */
642
643/**
644 * struct drm_vmw_fence_signaled_arg
645 *
646 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
647 * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
648 * @signaled: Out: Flags signaled.
649 * @sequence: Out: Highest sequence passed so far. Can be used to signal the
650 * EXEC flag of user-space fence objects.
651 *
652 * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
653 * ioctls.
654 */
655
656struct drm_vmw_fence_signaled_arg {
657 __u32 handle;
658 __u32 flags;
659 __s32 signaled;
660 __u32 passed_seqno;
661 __u32 signaled_flags;
662 __u32 pad64;
663};
664
665/*************************************************************************/
666/**
667 * DRM_VMW_FENCE_UNREF
668 *
669 * Unreferences a fence object, and causes it to be destroyed if there are no
670 * other references to it.
671 *
672 */
673
674/**
675 * struct drm_vmw_fence_arg
676 *
677 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
678 *
679 * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
680 */
681
682struct drm_vmw_fence_arg {
683 __u32 handle;
684 __u32 pad64;
685};
686
687
688/*************************************************************************/
689/**
690 * DRM_VMW_FENCE_EVENT
691 *
692 * Queues an event on a fence to be delivered on the drm character device
693 * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
694 * Optionally the approximate time when the fence signaled is
695 * given by the event.
696 */
697
698/*
699 * The event type
700 */
701#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
702
703struct drm_vmw_event_fence {
704 struct drm_event base;
705 __u64 user_data;
706 __u32 tv_sec;
707 __u32 tv_usec;
708};
709
710/*
711 * Flags that may be given to the command.
712 */
713/* Request fence signaled time on the event. */
714#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
715
716/**
717 * struct drm_vmw_fence_event_arg
718 *
719 * @fence_rep: Pointer to fence_rep structure cast to __u64 or 0 if
720 * the fence is not supposed to be referenced by user-space.
721 * @user_info: Info to be delivered with the event.
722 * @handle: Attach the event to this fence only.
723 * @flags: A set of flags as defined above.
724 */
725struct drm_vmw_fence_event_arg {
726 __u64 fence_rep;
727 __u64 user_data;
728 __u32 handle;
729 __u32 flags;
730};
731
732
733/*************************************************************************/
734/**
735 * DRM_VMW_PRESENT
736 *
737 * Executes an SVGA present on a given fb for a given surface. The surface
738 * is placed on the framebuffer. Cliprects are given relative to the given
739 * point (the point disignated by dest_{x|y}).
740 *
741 */
742
743/**
744 * struct drm_vmw_present_arg
745 * @fb_id: framebuffer id to present / read back from.
746 * @sid: Surface id to present from.
747 * @dest_x: X placement coordinate for surface.
748 * @dest_y: Y placement coordinate for surface.
749 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
750 * @num_clips: Number of cliprects given relative to the framebuffer origin,
751 * in the same coordinate space as the frame buffer.
752 * @pad64: Unused 64-bit padding.
753 *
754 * Input argument to the DRM_VMW_PRESENT ioctl.
755 */
756
757struct drm_vmw_present_arg {
758 __u32 fb_id;
759 __u32 sid;
760 __s32 dest_x;
761 __s32 dest_y;
762 __u64 clips_ptr;
763 __u32 num_clips;
764 __u32 pad64;
765};
766
767
768/*************************************************************************/
769/**
770 * DRM_VMW_PRESENT_READBACK
771 *
772 * Executes an SVGA present readback from a given fb to the dma buffer
773 * currently bound as the fb. If there is no dma buffer bound to the fb,
774 * an error will be returned.
775 *
776 */
777
778/**
779 * struct drm_vmw_present_arg
780 * @fb_id: fb_id to present / read back from.
781 * @num_clips: Number of cliprects.
782 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
783 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an __u64.
784 * If this member is NULL, then the ioctl should not return a fence.
785 */
786
787struct drm_vmw_present_readback_arg {
788 __u32 fb_id;
789 __u32 num_clips;
790 __u64 clips_ptr;
791 __u64 fence_rep;
792};
793
794/*************************************************************************/
795/**
796 * DRM_VMW_UPDATE_LAYOUT - Update layout
797 *
798 * Updates the preferred modes and connection status for connectors. The
799 * command consists of one drm_vmw_update_layout_arg pointing to an array
800 * of num_outputs drm_vmw_rect's.
801 */
802
803/**
804 * struct drm_vmw_update_layout_arg
805 *
806 * @num_outputs: number of active connectors
807 * @rects: pointer to array of drm_vmw_rect cast to an __u64
808 *
809 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
810 */
811struct drm_vmw_update_layout_arg {
812 __u32 num_outputs;
813 __u32 pad64;
814 __u64 rects;
815};
816
817
818/*************************************************************************/
819/**
820 * DRM_VMW_CREATE_SHADER - Create shader
821 *
822 * Creates a shader and optionally binds it to a dma buffer containing
823 * the shader byte-code.
824 */
825
826/**
827 * enum drm_vmw_shader_type - Shader types
828 */
829enum drm_vmw_shader_type {
830 drm_vmw_shader_type_vs = 0,
831 drm_vmw_shader_type_ps,
832};
833
834
835/**
836 * struct drm_vmw_shader_create_arg
837 *
838 * @shader_type: Shader type of the shader to create.
839 * @size: Size of the byte-code in bytes.
840 * where the shader byte-code starts
841 * @buffer_handle: Buffer handle identifying the buffer containing the
842 * shader byte-code
843 * @shader_handle: On successful completion contains a handle that
844 * can be used to subsequently identify the shader.
845 * @offset: Offset in bytes into the buffer given by @buffer_handle,
846 *
847 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
848 */
849struct drm_vmw_shader_create_arg {
850 enum drm_vmw_shader_type shader_type;
851 __u32 size;
852 __u32 buffer_handle;
853 __u32 shader_handle;
854 __u64 offset;
855};
856
857/*************************************************************************/
858/**
859 * DRM_VMW_UNREF_SHADER - Unreferences a shader
860 *
861 * Destroys a user-space reference to a shader, optionally destroying
862 * it.
863 */
864
865/**
866 * struct drm_vmw_shader_arg
867 *
868 * @handle: Handle identifying the shader to destroy.
869 *
870 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
871 */
872struct drm_vmw_shader_arg {
873 __u32 handle;
874 __u32 pad64;
875};
876
877/*************************************************************************/
878/**
879 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
880 *
881 * Allocates a surface handle and queues a create surface command
882 * for the host on the first use of the surface. The surface ID can
883 * be used as the surface ID in commands referencing the surface.
884 */
885
886/**
887 * enum drm_vmw_surface_flags
888 *
889 * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
890 * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
891 * surface.
892 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
893 * given.
894 */
895enum drm_vmw_surface_flags {
896 drm_vmw_surface_flag_shareable = (1 << 0),
897 drm_vmw_surface_flag_scanout = (1 << 1),
898 drm_vmw_surface_flag_create_buffer = (1 << 2)
899};
900
901/**
902 * struct drm_vmw_gb_surface_create_req
903 *
904 * @svga3d_flags: SVGA3d surface flags for the device.
905 * @format: SVGA3d format.
906 * @mip_level: Number of mip levels for all faces.
907 * @drm_surface_flags Flags as described above.
908 * @multisample_count Future use. Set to 0.
909 * @autogen_filter Future use. Set to 0.
910 * @buffer_handle Buffer handle of backup buffer. SVGA3D_INVALID_ID
911 * if none.
912 * @base_size Size of the base mip level for all faces.
913 * @array_size Must be zero for non-DX hardware, and if non-zero
914 * svga3d_flags must have proper bind flags setup.
915 *
916 * Input argument to the DRM_VMW_GB_SURFACE_CREATE Ioctl.
917 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
918 */
919struct drm_vmw_gb_surface_create_req {
920 __u32 svga3d_flags;
921 __u32 format;
922 __u32 mip_levels;
923 enum drm_vmw_surface_flags drm_surface_flags;
924 __u32 multisample_count;
925 __u32 autogen_filter;
926 __u32 buffer_handle;
927 __u32 array_size;
928 struct drm_vmw_size base_size;
929};
930
931/**
932 * struct drm_vmw_gb_surface_create_rep
933 *
934 * @handle: Surface handle.
935 * @backup_size: Size of backup buffers for this surface.
936 * @buffer_handle: Handle of backup buffer. SVGA3D_INVALID_ID if none.
937 * @buffer_size: Actual size of the buffer identified by
938 * @buffer_handle
939 * @buffer_map_handle: Offset into device address space for the buffer
940 * identified by @buffer_handle.
941 *
942 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
943 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
944 */
945struct drm_vmw_gb_surface_create_rep {
946 __u32 handle;
947 __u32 backup_size;
948 __u32 buffer_handle;
949 __u32 buffer_size;
950 __u64 buffer_map_handle;
951};
952
953/**
954 * union drm_vmw_gb_surface_create_arg
955 *
956 * @req: Input argument as described above.
957 * @rep: Output argument as described above.
958 *
959 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
960 */
961union drm_vmw_gb_surface_create_arg {
962 struct drm_vmw_gb_surface_create_rep rep;
963 struct drm_vmw_gb_surface_create_req req;
964};
965
966/*************************************************************************/
967/**
968 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
969 *
970 * Puts a reference on a host surface with a given handle, as previously
971 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
972 * A reference will make sure the surface isn't destroyed while we hold
973 * it and will allow the calling client to use the surface handle in
974 * the command stream.
975 *
976 * On successful return, the Ioctl returns the surface information given
977 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
978 */
979
980/**
981 * struct drm_vmw_gb_surface_reference_arg
982 *
983 * @creq: The data used as input when the surface was created, as described
984 * above at "struct drm_vmw_gb_surface_create_req"
985 * @crep: Additional data output when the surface was created, as described
986 * above at "struct drm_vmw_gb_surface_create_rep"
987 *
988 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
989 */
990struct drm_vmw_gb_surface_ref_rep {
991 struct drm_vmw_gb_surface_create_req creq;
992 struct drm_vmw_gb_surface_create_rep crep;
993};
994
995/**
996 * union drm_vmw_gb_surface_reference_arg
997 *
998 * @req: Input data as described above at "struct drm_vmw_surface_arg"
999 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
1000 *
1001 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
1002 */
1003union drm_vmw_gb_surface_reference_arg {
1004 struct drm_vmw_gb_surface_ref_rep rep;
1005 struct drm_vmw_surface_arg req;
1006};
1007
1008
1009/*************************************************************************/
1010/**
1011 * DRM_VMW_SYNCCPU - Sync a DMA buffer / MOB for CPU access.
1012 *
1013 * Idles any previously submitted GPU operations on the buffer and
1014 * by default blocks command submissions that reference the buffer.
1015 * If the file descriptor used to grab a blocking CPU sync is closed, the
1016 * cpu sync is released.
1017 * The flags argument indicates how the grab / release operation should be
1018 * performed:
1019 */
1020
1021/**
1022 * enum drm_vmw_synccpu_flags - Synccpu flags:
1023 *
1024 * @drm_vmw_synccpu_read: Sync for read. If sync is done for read only, it's a
1025 * hint to the kernel to allow command submissions that references the buffer
1026 * for read-only.
1027 * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
1028 * referencing this buffer.
1029 * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
1030 * -EBUSY should the buffer be busy.
1031 * @drm_vmw_synccpu_allow_cs: Allow command submission that touches the buffer
1032 * while the buffer is synced for CPU. This is similar to the GEM bo idle
1033 * behavior.
1034 */
1035enum drm_vmw_synccpu_flags {
1036 drm_vmw_synccpu_read = (1 << 0),
1037 drm_vmw_synccpu_write = (1 << 1),
1038 drm_vmw_synccpu_dontblock = (1 << 2),
1039 drm_vmw_synccpu_allow_cs = (1 << 3)
1040};
1041
1042/**
1043 * enum drm_vmw_synccpu_op - Synccpu operations:
1044 *
1045 * @drm_vmw_synccpu_grab: Grab the buffer for CPU operations
1046 * @drm_vmw_synccpu_release: Release a previous grab.
1047 */
1048enum drm_vmw_synccpu_op {
1049 drm_vmw_synccpu_grab,
1050 drm_vmw_synccpu_release
1051};
1052
1053/**
1054 * struct drm_vmw_synccpu_arg
1055 *
1056 * @op: The synccpu operation as described above.
1057 * @handle: Handle identifying the buffer object.
1058 * @flags: Flags as described above.
1059 */
1060struct drm_vmw_synccpu_arg {
1061 enum drm_vmw_synccpu_op op;
1062 enum drm_vmw_synccpu_flags flags;
1063 __u32 handle;
1064 __u32 pad64;
1065};
1066
1067/*************************************************************************/
1068/**
1069 * DRM_VMW_CREATE_EXTENDED_CONTEXT - Create a host context.
1070 *
1071 * Allocates a device unique context id, and queues a create context command
1072 * for the host. Does not wait for host completion.
1073 */
1074enum drm_vmw_extended_context {
1075 drm_vmw_context_legacy,
1076 drm_vmw_context_dx
1077};
1078
1079/**
1080 * union drm_vmw_extended_context_arg
1081 *
1082 * @req: Context type.
1083 * @rep: Context identifier.
1084 *
1085 * Argument to the DRM_VMW_CREATE_EXTENDED_CONTEXT Ioctl.
1086 */
1087union drm_vmw_extended_context_arg {
1088 enum drm_vmw_extended_context req;
1089 struct drm_vmw_context_arg rep;
1090};
1091
1092/*************************************************************************/
1093/*
1094 * DRM_VMW_HANDLE_CLOSE - Close a user-space handle and release its
1095 * underlying resource.
1096 *
1097 * Note that this ioctl is overlaid on the deprecated DRM_VMW_UNREF_DMABUF
1098 * Ioctl.
1099 */
1100
1101/**
1102 * struct drm_vmw_handle_close_arg
1103 *
1104 * @handle: Handle to close.
1105 *
1106 * Argument to the DRM_VMW_HANDLE_CLOSE Ioctl.
1107 */
1108struct drm_vmw_handle_close_arg {
1109 __u32 handle;
1110 __u32 pad64;
1111};
1112#define drm_vmw_unref_dmabuf_arg drm_vmw_handle_close_arg
1113
1114/*************************************************************************/
1115/**
1116 * DRM_VMW_GB_SURFACE_CREATE_EXT - Create a host guest-backed surface.
1117 *
1118 * Allocates a surface handle and queues a create surface command
1119 * for the host on the first use of the surface. The surface ID can
1120 * be used as the surface ID in commands referencing the surface.
1121 *
1122 * This new command extends DRM_VMW_GB_SURFACE_CREATE by adding version
1123 * parameter and 64 bit svga flag.
1124 */
1125
1126/**
1127 * enum drm_vmw_surface_version
1128 *
1129 * @drm_vmw_surface_gb_v1: Corresponds to current gb surface format with
1130 * svga3d surface flags split into 2, upper half and lower half.
1131 */
1132enum drm_vmw_surface_version {
1133 drm_vmw_gb_surface_v1
1134};
1135
1136/**
1137 * struct drm_vmw_gb_surface_create_ext_req
1138 *
1139 * @base: Surface create parameters.
1140 * @version: Version of surface create ioctl.
1141 * @svga3d_flags_upper_32_bits: Upper 32 bits of svga3d flags.
1142 * @multisample_pattern: Multisampling pattern when msaa is supported.
1143 * @quality_level: Precision settings for each sample.
1144 * @must_be_zero: Reserved for future usage.
1145 *
1146 * Input argument to the DRM_VMW_GB_SURFACE_CREATE_EXT Ioctl.
1147 * Part of output argument for the DRM_VMW_GB_SURFACE_REF_EXT Ioctl.
1148 */
1149struct drm_vmw_gb_surface_create_ext_req {
1150 struct drm_vmw_gb_surface_create_req base;
1151 enum drm_vmw_surface_version version;
1152 uint32_t svga3d_flags_upper_32_bits;
1153 SVGA3dMSPattern multisample_pattern;
1154 SVGA3dMSQualityLevel quality_level;
1155 uint64_t must_be_zero;
1156};
1157
1158/**
1159 * union drm_vmw_gb_surface_create_ext_arg
1160 *
1161 * @req: Input argument as described above.
1162 * @rep: Output argument as described above.
1163 *
1164 * Argument to the DRM_VMW_GB_SURFACE_CREATE_EXT ioctl.
1165 */
1166union drm_vmw_gb_surface_create_ext_arg {
1167 struct drm_vmw_gb_surface_create_rep rep;
1168 struct drm_vmw_gb_surface_create_ext_req req;
1169};
1170
1171/*************************************************************************/
1172/**
1173 * DRM_VMW_GB_SURFACE_REF_EXT - Reference a host surface.
1174 *
1175 * Puts a reference on a host surface with a given handle, as previously
1176 * returned by the DRM_VMW_GB_SURFACE_CREATE_EXT ioctl.
1177 * A reference will make sure the surface isn't destroyed while we hold
1178 * it and will allow the calling client to use the surface handle in
1179 * the command stream.
1180 *
1181 * On successful return, the Ioctl returns the surface information given
1182 * to and returned from the DRM_VMW_GB_SURFACE_CREATE_EXT ioctl.
1183 */
1184
1185/**
1186 * struct drm_vmw_gb_surface_ref_ext_rep
1187 *
1188 * @creq: The data used as input when the surface was created, as described
1189 * above at "struct drm_vmw_gb_surface_create_ext_req"
1190 * @crep: Additional data output when the surface was created, as described
1191 * above at "struct drm_vmw_gb_surface_create_rep"
1192 *
1193 * Output Argument to the DRM_VMW_GB_SURFACE_REF_EXT ioctl.
1194 */
1195struct drm_vmw_gb_surface_ref_ext_rep {
1196 struct drm_vmw_gb_surface_create_ext_req creq;
1197 struct drm_vmw_gb_surface_create_rep crep;
1198};
1199
1200/**
1201 * union drm_vmw_gb_surface_reference_ext_arg
1202 *
1203 * @req: Input data as described above at "struct drm_vmw_surface_arg"
1204 * @rep: Output data as described above at
1205 * "struct drm_vmw_gb_surface_ref_ext_rep"
1206 *
1207 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
1208 */
1209union drm_vmw_gb_surface_reference_ext_arg {
1210 struct drm_vmw_gb_surface_ref_ext_rep rep;
1211 struct drm_vmw_surface_arg req;
1212};
1213
1214#if defined(__cplusplus)
1215}
1216#endif
1217
1218#endif
\ No newline at end of file
lib/libc/include/generic-musl/elf.h+119-1
...@@ -314,7 +314,8 @@ typedef struct {...@@ -314,7 +314,8 @@ typedef struct {
314#define EM_AMDGPU 224314#define EM_AMDGPU 224
315#define EM_RISCV 243315#define EM_RISCV 243
316#define EM_BPF 247316#define EM_BPF 247
317#define EM_NUM 248317#define EM_CSKY 252
318#define EM_NUM 253
318319
319#define EM_ALPHA 0x9026320#define EM_ALPHA 0x9026
320321
...@@ -681,11 +682,17 @@ typedef struct {...@@ -681,11 +682,17 @@ typedef struct {
681#define NT_ARM_HW_WATCH 0x403682#define NT_ARM_HW_WATCH 0x403
682#define NT_ARM_SYSTEM_CALL 0x404683#define NT_ARM_SYSTEM_CALL 0x404
683#define NT_ARM_SVE 0x405684#define NT_ARM_SVE 0x405
685#define NT_ARM_PAC_MASK 0x406
686#define NT_ARM_PACA_KEYS 0x407
687#define NT_ARM_PACG_KEYS 0x408
684#define NT_METAG_CBUF 0x500688#define NT_METAG_CBUF 0x500
685#define NT_METAG_RPIPE 0x501689#define NT_METAG_RPIPE 0x501
686#define NT_METAG_TLS 0x502690#define NT_METAG_TLS 0x502
687#define NT_ARC_V2 0x600691#define NT_ARC_V2 0x600
688#define NT_VMCOREDD 0x700692#define NT_VMCOREDD 0x700
693#define NT_MIPS_DSP 0x800
694#define NT_MIPS_FP_MODE 0x801
695#define NT_MIPS_MSA 0x802
689#define NT_VERSION 1696#define NT_VERSION 1
690697
691698
...@@ -2619,6 +2626,61 @@ enum...@@ -2619,6 +2626,61 @@ enum
2619#define R_ARM_NUM 2562626#define R_ARM_NUM 256
26202627
26212628
2629#define R_CKCORE_NONE 0
2630#define R_CKCORE_ADDR32 1
2631#define R_CKCORE_PCRELIMM8BY4 2
2632#define R_CKCORE_PCRELIMM11BY2 3
2633#define R_CKCORE_PCREL32 5
2634#define R_CKCORE_PCRELJSR_IMM11BY2 6
2635#define R_CKCORE_RELATIVE 9
2636#define R_CKCORE_COPY 10
2637#define R_CKCORE_GLOB_DAT 11
2638#define R_CKCORE_JUMP_SLOT 12
2639#define R_CKCORE_GOTOFF 13
2640#define R_CKCORE_GOTPC 14
2641#define R_CKCORE_GOT32 15
2642#define R_CKCORE_PLT32 16
2643#define R_CKCORE_ADDRGOT 17
2644#define R_CKCORE_ADDRPLT 18
2645#define R_CKCORE_PCREL_IMM26BY2 19
2646#define R_CKCORE_PCREL_IMM16BY2 20
2647#define R_CKCORE_PCREL_IMM16BY4 21
2648#define R_CKCORE_PCREL_IMM10BY2 22
2649#define R_CKCORE_PCREL_IMM10BY4 23
2650#define R_CKCORE_ADDR_HI16 24
2651#define R_CKCORE_ADDR_LO16 25
2652#define R_CKCORE_GOTPC_HI16 26
2653#define R_CKCORE_GOTPC_LO16 27
2654#define R_CKCORE_GOTOFF_HI16 28
2655#define R_CKCORE_GOTOFF_LO16 29
2656#define R_CKCORE_GOT12 30
2657#define R_CKCORE_GOT_HI16 31
2658#define R_CKCORE_GOT_LO16 32
2659#define R_CKCORE_PLT12 33
2660#define R_CKCORE_PLT_HI16 34
2661#define R_CKCORE_PLT_LO16 35
2662#define R_CKCORE_ADDRGOT_HI16 36
2663#define R_CKCORE_ADDRGOT_LO16 37
2664#define R_CKCORE_ADDRPLT_HI16 38
2665#define R_CKCORE_ADDRPLT_LO16 39
2666#define R_CKCORE_PCREL_JSR_IMM26BY2 40
2667#define R_CKCORE_TOFFSET_LO16 41
2668#define R_CKCORE_DOFFSET_LO16 42
2669#define R_CKCORE_PCREL_IMM18BY2 43
2670#define R_CKCORE_DOFFSET_IMM18 44
2671#define R_CKCORE_DOFFSET_IMM18BY2 45
2672#define R_CKCORE_DOFFSET_IMM18BY4 46
2673#define R_CKCORE_GOT_IMM18BY4 48
2674#define R_CKCORE_PLT_IMM18BY4 49
2675#define R_CKCORE_PCREL_IMM7BY4 50
2676#define R_CKCORE_TLS_LE32 51
2677#define R_CKCORE_TLS_IE32 52
2678#define R_CKCORE_TLS_GD32 53
2679#define R_CKCORE_TLS_LDM32 54
2680#define R_CKCORE_TLS_LDO32 55
2681#define R_CKCORE_TLS_DTPMOD32 56
2682#define R_CKCORE_TLS_DTPOFF32 57
2683#define R_CKCORE_TLS_TPOFF32 58
26222684
26232685
2624#define EF_IA_64_MASKOS 0x0000000f2686#define EF_IA_64_MASKOS 0x0000000f
...@@ -3166,6 +3228,62 @@ enum...@@ -3166,6 +3228,62 @@ enum
3166#define R_BPF_NONE 03228#define R_BPF_NONE 0
3167#define R_BPF_MAP_FD 13229#define R_BPF_MAP_FD 1
31683230
3231#define R_RISCV_NONE 0
3232#define R_RISCV_32 1
3233#define R_RISCV_64 2
3234#define R_RISCV_RELATIVE 3
3235#define R_RISCV_COPY 4
3236#define R_RISCV_JUMP_SLOT 5
3237#define R_RISCV_TLS_DTPMOD32 6
3238#define R_RISCV_TLS_DTPMOD64 7
3239#define R_RISCV_TLS_DTPREL32 8
3240#define R_RISCV_TLS_DTPREL64 9
3241#define R_RISCV_TLS_TPREL32 10
3242#define R_RISCV_TLS_TPREL64 11
3243
3244#define R_RISCV_BRANCH 16
3245#define R_RISCV_JAL 17
3246#define R_RISCV_CALL 18
3247#define R_RISCV_CALL_PLT 19
3248#define R_RISCV_GOT_HI20 20
3249#define R_RISCV_TLS_GOT_HI20 21
3250#define R_RISCV_TLS_GD_HI20 22
3251#define R_RISCV_PCREL_HI20 23
3252#define R_RISCV_PCREL_LO12_I 24
3253#define R_RISCV_PCREL_LO12_S 25
3254#define R_RISCV_HI20 26
3255#define R_RISCV_LO12_I 27
3256#define R_RISCV_LO12_S 28
3257#define R_RISCV_TPREL_HI20 29
3258#define R_RISCV_TPREL_LO12_I 30
3259#define R_RISCV_TPREL_LO12_S 31
3260#define R_RISCV_TPREL_ADD 32
3261#define R_RISCV_ADD8 33
3262#define R_RISCV_ADD16 34
3263#define R_RISCV_ADD32 35
3264#define R_RISCV_ADD64 36
3265#define R_RISCV_SUB8 37
3266#define R_RISCV_SUB16 38
3267#define R_RISCV_SUB32 39
3268#define R_RISCV_SUB64 40
3269#define R_RISCV_GNU_VTINHERIT 41
3270#define R_RISCV_GNU_VTENTRY 42
3271#define R_RISCV_ALIGN 43
3272#define R_RISCV_RVC_BRANCH 44
3273#define R_RISCV_RVC_JUMP 45
3274#define R_RISCV_RVC_LUI 46
3275#define R_RISCV_GPREL_I 47
3276#define R_RISCV_GPREL_S 48
3277#define R_RISCV_TPREL_I 49
3278#define R_RISCV_TPREL_S 50
3279#define R_RISCV_RELAX 51
3280#define R_RISCV_SUB6 52
3281#define R_RISCV_SET6 53
3282#define R_RISCV_SET8 54
3283#define R_RISCV_SET16 55
3284#define R_RISCV_SET32 56
3285#define R_RISCV_32_PCREL 57
3286
3169#ifdef __cplusplus3287#ifdef __cplusplus
3170}3288}
3171#endif3289#endif
lib/libc/include/generic-musl/fcntl.h+6-2
...@@ -36,8 +36,9 @@ int openat(int, const char *, int, ...);...@@ -36,8 +36,9 @@ int openat(int, const char *, int, ...);
36int posix_fadvise(int, off_t, off_t, int);36int posix_fadvise(int, off_t, off_t, int);
37int posix_fallocate(int, off_t, off_t);37int posix_fallocate(int, off_t, off_t);
3838
39#define O_SEARCH O_PATH39#define O_SEARCH O_PATH
40#define O_EXEC O_PATH40#define O_EXEC O_PATH
41#define O_TTY_INIT 0
4142
42#define O_ACCMODE (03|O_SEARCH)43#define O_ACCMODE (03|O_SEARCH)
43#define O_RDONLY 0044#define O_RDONLY 00
...@@ -66,8 +67,10 @@ int posix_fallocate(int, off_t, off_t);...@@ -66,8 +67,10 @@ int posix_fallocate(int, off_t, off_t);
66#define POSIX_FADV_RANDOM 167#define POSIX_FADV_RANDOM 1
67#define POSIX_FADV_SEQUENTIAL 268#define POSIX_FADV_SEQUENTIAL 2
68#define POSIX_FADV_WILLNEED 369#define POSIX_FADV_WILLNEED 3
70#ifndef POSIX_FADV_DONTNEED
69#define POSIX_FADV_DONTNEED 471#define POSIX_FADV_DONTNEED 4
70#define POSIX_FADV_NOREUSE 572#define POSIX_FADV_NOREUSE 5
73#endif
7174
72#undef SEEK_SET75#undef SEEK_SET
73#undef SEEK_CUR76#undef SEEK_CUR
...@@ -126,6 +129,7 @@ int posix_fallocate(int, off_t, off_t);...@@ -126,6 +129,7 @@ int posix_fallocate(int, off_t, off_t);
126#define F_SEAL_SHRINK 0x0002129#define F_SEAL_SHRINK 0x0002
127#define F_SEAL_GROW 0x0004130#define F_SEAL_GROW 0x0004
128#define F_SEAL_WRITE 0x0008131#define F_SEAL_WRITE 0x0008
132#define F_SEAL_FUTURE_WRITE 0x0010
129133
130#define F_GET_RW_HINT 1035134#define F_GET_RW_HINT 1035
131#define F_SET_RW_HINT 1036135#define F_SET_RW_HINT 1036
lib/libc/include/generic-musl/math.h+12
...@@ -36,6 +36,18 @@ extern "C" {...@@ -36,6 +36,18 @@ extern "C" {
36#define FP_SUBNORMAL 336#define FP_SUBNORMAL 3
37#define FP_NORMAL 437#define FP_NORMAL 4
3838
39#ifdef __FP_FAST_FMA
40#define FP_FAST_FMA 1
41#endif
42
43#ifdef __FP_FAST_FMAF
44#define FP_FAST_FMAF 1
45#endif
46
47#ifdef __FP_FAST_FMAL
48#define FP_FAST_FMAL 1
49#endif
50
39int __fpclassify(double);51int __fpclassify(double);
40int __fpclassifyf(float);52int __fpclassifyf(float);
41int __fpclassifyl(long double);53int __fpclassifyl(long double);
lib/libc/include/generic-musl/misc/cxl.h deleted-156
...@@ -1,156 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright 2014 IBM Corp.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _MISC_CXL_H
12#define _MISC_CXL_H
13
14#include <linux/types.h>
15#include <linux/ioctl.h>
16
17
18struct cxl_ioctl_start_work {
19 __u64 flags;
20 __u64 work_element_descriptor;
21 __u64 amr;
22 __s16 num_interrupts;
23 __u16 tid;
24 __s32 reserved1;
25 __u64 reserved2;
26 __u64 reserved3;
27 __u64 reserved4;
28 __u64 reserved5;
29};
30
31#define CXL_START_WORK_AMR 0x0000000000000001ULL
32#define CXL_START_WORK_NUM_IRQS 0x0000000000000002ULL
33#define CXL_START_WORK_ERR_FF 0x0000000000000004ULL
34#define CXL_START_WORK_TID 0x0000000000000008ULL
35#define CXL_START_WORK_ALL (CXL_START_WORK_AMR |\
36 CXL_START_WORK_NUM_IRQS |\
37 CXL_START_WORK_ERR_FF |\
38 CXL_START_WORK_TID)
39
40
41/* Possible modes that an afu can be in */
42#define CXL_MODE_DEDICATED 0x1
43#define CXL_MODE_DIRECTED 0x2
44
45/* possible flags for the cxl_afu_id flags field */
46#define CXL_AFUID_FLAG_SLAVE 0x1 /* In directed-mode afu is in slave mode */
47
48struct cxl_afu_id {
49 __u64 flags; /* One of CXL_AFUID_FLAG_X */
50 __u32 card_id;
51 __u32 afu_offset;
52 __u32 afu_mode; /* one of the CXL_MODE_X */
53 __u32 reserved1;
54 __u64 reserved2;
55 __u64 reserved3;
56 __u64 reserved4;
57 __u64 reserved5;
58 __u64 reserved6;
59};
60
61/* base adapter image header is included in the image */
62#define CXL_AI_NEED_HEADER 0x0000000000000001ULL
63#define CXL_AI_ALL CXL_AI_NEED_HEADER
64
65#define CXL_AI_HEADER_SIZE 128
66#define CXL_AI_BUFFER_SIZE 4096
67#define CXL_AI_MAX_ENTRIES 256
68#define CXL_AI_MAX_CHUNK_SIZE (CXL_AI_BUFFER_SIZE * CXL_AI_MAX_ENTRIES)
69
70struct cxl_adapter_image {
71 __u64 flags;
72 __u64 data;
73 __u64 len_data;
74 __u64 len_image;
75 __u64 reserved1;
76 __u64 reserved2;
77 __u64 reserved3;
78 __u64 reserved4;
79};
80
81/* ioctl numbers */
82#define CXL_MAGIC 0xCA
83/* AFU devices */
84#define CXL_IOCTL_START_WORK _IOW(CXL_MAGIC, 0x00, struct cxl_ioctl_start_work)
85#define CXL_IOCTL_GET_PROCESS_ELEMENT _IOR(CXL_MAGIC, 0x01, __u32)
86#define CXL_IOCTL_GET_AFU_ID _IOR(CXL_MAGIC, 0x02, struct cxl_afu_id)
87/* adapter devices */
88#define CXL_IOCTL_DOWNLOAD_IMAGE _IOW(CXL_MAGIC, 0x0A, struct cxl_adapter_image)
89#define CXL_IOCTL_VALIDATE_IMAGE _IOW(CXL_MAGIC, 0x0B, struct cxl_adapter_image)
90
91#define CXL_READ_MIN_SIZE 0x1000 /* 4K */
92
93/* Events from read() */
94enum cxl_event_type {
95 CXL_EVENT_RESERVED = 0,
96 CXL_EVENT_AFU_INTERRUPT = 1,
97 CXL_EVENT_DATA_STORAGE = 2,
98 CXL_EVENT_AFU_ERROR = 3,
99 CXL_EVENT_AFU_DRIVER = 4,
100};
101
102struct cxl_event_header {
103 __u16 type;
104 __u16 size;
105 __u16 process_element;
106 __u16 reserved1;
107};
108
109struct cxl_event_afu_interrupt {
110 __u16 flags;
111 __u16 irq; /* Raised AFU interrupt number */
112 __u32 reserved1;
113};
114
115struct cxl_event_data_storage {
116 __u16 flags;
117 __u16 reserved1;
118 __u32 reserved2;
119 __u64 addr;
120 __u64 dsisr;
121 __u64 reserved3;
122};
123
124struct cxl_event_afu_error {
125 __u16 flags;
126 __u16 reserved1;
127 __u32 reserved2;
128 __u64 error;
129};
130
131struct cxl_event_afu_driver_reserved {
132 /*
133 * Defines the buffer passed to the cxl driver by the AFU driver.
134 *
135 * This is not ABI since the event header.size passed to the user for
136 * existing events is set in the read call to sizeof(cxl_event_header)
137 * + sizeof(whatever event is being dispatched) and the user is already
138 * required to use a 4K buffer on the read call.
139 *
140 * Of course the contents will be ABI, but that's up the AFU driver.
141 */
142 __u32 data_size;
143 __u8 data[];
144};
145
146struct cxl_event {
147 struct cxl_event_header header;
148 union {
149 struct cxl_event_afu_interrupt irq;
150 struct cxl_event_data_storage fault;
151 struct cxl_event_afu_error afu_error;
152 struct cxl_event_afu_driver_reserved afu_driver_event;
153 };
154};
155
156#endif /* _MISC_CXL_H */
\ No newline at end of file
lib/libc/include/generic-musl/misc/ocxl.h deleted-80
...@@ -1,80 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* Copyright 2017 IBM Corp. */
3#ifndef _MISC_OCXL_H
4#define _MISC_OCXL_H
5
6#include <linux/types.h>
7#include <linux/ioctl.h>
8
9enum ocxl_event_type {
10 OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
11};
12
13#define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001 /* This is the last event pending */
14
15struct ocxl_kernel_event_header {
16 __u16 type;
17 __u16 flags;
18 __u32 reserved;
19};
20
21struct ocxl_kernel_event_xsl_fault_error {
22 __u64 addr;
23 __u64 dsisr;
24 __u64 count;
25 __u64 reserved;
26};
27
28struct ocxl_ioctl_attach {
29 __u64 amr;
30 __u64 reserved1;
31 __u64 reserved2;
32 __u64 reserved3;
33};
34
35struct ocxl_ioctl_metadata {
36 __u16 version; // struct version, always backwards compatible
37
38 // Version 0 fields
39 __u8 afu_version_major;
40 __u8 afu_version_minor;
41 __u32 pasid; // PASID assigned to the current context
42
43 __u64 pp_mmio_size; // Per PASID MMIO size
44 __u64 global_mmio_size;
45
46 // End version 0 fields
47
48 __u64 reserved[13]; // Total of 16*u64
49};
50
51struct ocxl_ioctl_p9_wait {
52 __u16 thread_id; // The thread ID required to wake this thread
53 __u16 reserved1;
54 __u32 reserved2;
55 __u64 reserved3[3];
56};
57
58#define OCXL_IOCTL_FEATURES_FLAGS0_P9_WAIT 0x01
59struct ocxl_ioctl_features {
60 __u64 flags[4];
61};
62
63struct ocxl_ioctl_irq_fd {
64 __u64 irq_offset;
65 __s32 eventfd;
66 __u32 reserved;
67};
68
69/* ioctl numbers */
70#define OCXL_MAGIC 0xCA
71/* AFU devices */
72#define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
73#define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
74#define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
75#define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
76#define OCXL_IOCTL_GET_METADATA _IOR(OCXL_MAGIC, 0x14, struct ocxl_ioctl_metadata)
77#define OCXL_IOCTL_ENABLE_P9_WAIT _IOR(OCXL_MAGIC, 0x15, struct ocxl_ioctl_p9_wait)
78#define OCXL_IOCTL_GET_FEATURES _IOR(OCXL_MAGIC, 0x16, struct ocxl_ioctl_features)
79
80#endif /* _MISC_OCXL_H */
\ No newline at end of file
lib/libc/include/generic-musl/mtd/inftl-user.h deleted-90
...@@ -1,90 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Parts of INFTL headers shared with userspace
4 *
5 */
6
7#ifndef __MTD_INFTL_USER_H__
8#define __MTD_INFTL_USER_H__
9
10#include <linux/types.h>
11
12#define OSAK_VERSION 0x5120
13#define PERCENTUSED 98
14
15#define SECTORSIZE 512
16
17/* Block Control Information */
18
19struct inftl_bci {
20 __u8 ECCsig[6];
21 __u8 Status;
22 __u8 Status1;
23} __attribute__((packed));
24
25struct inftl_unithead1 {
26 __u16 virtualUnitNo;
27 __u16 prevUnitNo;
28 __u8 ANAC;
29 __u8 NACs;
30 __u8 parityPerField;
31 __u8 discarded;
32} __attribute__((packed));
33
34struct inftl_unithead2 {
35 __u8 parityPerField;
36 __u8 ANAC;
37 __u16 prevUnitNo;
38 __u16 virtualUnitNo;
39 __u8 NACs;
40 __u8 discarded;
41} __attribute__((packed));
42
43struct inftl_unittail {
44 __u8 Reserved[4];
45 __u16 EraseMark;
46 __u16 EraseMark1;
47} __attribute__((packed));
48
49union inftl_uci {
50 struct inftl_unithead1 a;
51 struct inftl_unithead2 b;
52 struct inftl_unittail c;
53};
54
55struct inftl_oob {
56 struct inftl_bci b;
57 union inftl_uci u;
58};
59
60
61/* INFTL Media Header */
62
63struct INFTLPartition {
64 __u32 virtualUnits;
65 __u32 firstUnit;
66 __u32 lastUnit;
67 __u32 flags;
68 __u32 spareUnits;
69 __u32 Reserved0;
70 __u32 Reserved1;
71} __attribute__((packed));
72
73struct INFTLMediaHeader {
74 char bootRecordID[8];
75 __u32 NoOfBootImageBlocks;
76 __u32 NoOfBinaryPartitions;
77 __u32 NoOfBDTLPartitions;
78 __u32 BlockMultiplierBits;
79 __u32 FormatFlags;
80 __u32 OsakVersion;
81 __u32 PercentUsed;
82 struct INFTLPartition Partitions[4];
83} __attribute__((packed));
84
85/* Partition flag types */
86#define INFTL_BINARY 0x20000000
87#define INFTL_BDTL 0x40000000
88#define INFTL_LAST 0x80000000
89
90#endif /* __MTD_INFTL_USER_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/mtd/mtd-abi.h deleted-285
...@@ -1,285 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef __MTD_ABI_H__
22#define __MTD_ABI_H__
23
24#include <linux/types.h>
25
26struct erase_info_user {
27 __u32 start;
28 __u32 length;
29};
30
31struct erase_info_user64 {
32 __u64 start;
33 __u64 length;
34};
35
36struct mtd_oob_buf {
37 __u32 start;
38 __u32 length;
39 unsigned char *ptr;
40};
41
42struct mtd_oob_buf64 {
43 __u64 start;
44 __u32 pad;
45 __u32 length;
46 __u64 usr_ptr;
47};
48
49/**
50 * MTD operation modes
51 *
52 * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default)
53 * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas
54 * which are defined by the internal ecclayout
55 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;
56 * this mode implies %MTD_OPS_PLACE_OOB
57 *
58 * These modes can be passed to ioctl(MEMWRITE) and are also used internally.
59 * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.
60 * %MTD_FILE_MODE_RAW.
61 */
62enum {
63 MTD_OPS_PLACE_OOB = 0,
64 MTD_OPS_AUTO_OOB = 1,
65 MTD_OPS_RAW = 2,
66};
67
68/**
69 * struct mtd_write_req - data structure for requesting a write operation
70 *
71 * @start: start address
72 * @len: length of data buffer
73 * @ooblen: length of OOB buffer
74 * @usr_data: user-provided data buffer
75 * @usr_oob: user-provided OOB buffer
76 * @mode: MTD mode (see "MTD operation modes")
77 * @padding: reserved, must be set to 0
78 *
79 * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
80 * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
81 * write data-only, set @usr_oob == NULL. However, setting both @usr_data and
82 * @usr_oob to NULL is not allowed.
83 */
84struct mtd_write_req {
85 __u64 start;
86 __u64 len;
87 __u64 ooblen;
88 __u64 usr_data;
89 __u64 usr_oob;
90 __u8 mode;
91 __u8 padding[7];
92};
93
94#define MTD_ABSENT 0
95#define MTD_RAM 1
96#define MTD_ROM 2
97#define MTD_NORFLASH 3
98#define MTD_NANDFLASH 4 /* SLC NAND */
99#define MTD_DATAFLASH 6
100#define MTD_UBIVOLUME 7
101#define MTD_MLCNANDFLASH 8 /* MLC NAND (including TLC) */
102
103#define MTD_WRITEABLE 0x400 /* Device is writeable */
104#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
105#define MTD_NO_ERASE 0x1000 /* No erase necessary */
106#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */
107
108/* Some common devices / combinations of capabilities */
109#define MTD_CAP_ROM 0
110#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
111#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
112#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
113#define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
114
115/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
116#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
117#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
118#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
119#define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read)
120#define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default
121
122/* OTP mode selection */
123#define MTD_OTP_OFF 0
124#define MTD_OTP_FACTORY 1
125#define MTD_OTP_USER 2
126
127struct mtd_info_user {
128 __u8 type;
129 __u32 flags;
130 __u32 size; /* Total size of the MTD */
131 __u32 erasesize;
132 __u32 writesize;
133 __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */
134 __u64 padding; /* Old obsolete field; do not use */
135};
136
137struct region_info_user {
138 __u32 offset; /* At which this region starts,
139 * from the beginning of the MTD */
140 __u32 erasesize; /* For this region */
141 __u32 numblocks; /* Number of blocks in this region */
142 __u32 regionindex;
143};
144
145struct otp_info {
146 __u32 start;
147 __u32 length;
148 __u32 locked;
149};
150
151/*
152 * Note, the following ioctl existed in the past and was removed:
153 * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
154 * Try to avoid adding a new ioctl with the same ioctl number.
155 */
156
157/* Get basic MTD characteristics info (better to use sysfs) */
158#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
159/* Erase segment of MTD */
160#define MEMERASE _IOW('M', 2, struct erase_info_user)
161/* Write out-of-band data from MTD */
162#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
163/* Read out-of-band data from MTD */
164#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
165/* Lock a chip (for MTD that supports it) */
166#define MEMLOCK _IOW('M', 5, struct erase_info_user)
167/* Unlock a chip (for MTD that supports it) */
168#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
169/* Get the number of different erase regions */
170#define MEMGETREGIONCOUNT _IOR('M', 7, int)
171/* Get information about the erase region for a specific index */
172#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
173/* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
174#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
175/* Check if an eraseblock is bad */
176#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
177/* Mark an eraseblock as bad */
178#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
179/* Set OTP (One-Time Programmable) mode (factory vs. user) */
180#define OTPSELECT _IOR('M', 13, int)
181/* Get number of OTP (One-Time Programmable) regions */
182#define OTPGETREGIONCOUNT _IOW('M', 14, int)
183/* Get all OTP (One-Time Programmable) info about MTD */
184#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
185/* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
186#define OTPLOCK _IOR('M', 16, struct otp_info)
187/* Get ECC layout (deprecated) */
188#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
189/* Get statistics about corrected/uncorrected errors */
190#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
191/* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */
192#define MTDFILEMODE _IO('M', 19)
193/* Erase segment of MTD (supports 64-bit address) */
194#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
195/* Write data to OOB (64-bit version) */
196#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
197/* Read data from OOB (64-bit version) */
198#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
199/* Check if chip is locked (for MTD that supports it) */
200#define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
201/*
202 * Most generic write interface; can write in-band and/or out-of-band in various
203 * modes (see "struct mtd_write_req"). This ioctl is not supported for flashes
204 * without OOB, e.g., NOR flash.
205 */
206#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
207
208/*
209 * Obsolete legacy interface. Keep it in order not to break userspace
210 * interfaces
211 */
212struct nand_oobinfo {
213 __u32 useecc;
214 __u32 eccbytes;
215 __u32 oobfree[8][2];
216 __u32 eccpos[32];
217};
218
219struct nand_oobfree {
220 __u32 offset;
221 __u32 length;
222};
223
224#define MTD_MAX_OOBFREE_ENTRIES 8
225#define MTD_MAX_ECCPOS_ENTRIES 64
226/*
227 * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl
228 * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a
229 * complete set of ECC information. The ioctl truncates the larger internal
230 * structure to retain binary compatibility with the static declaration of the
231 * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of
232 * the user struct, not the MAX size of the internal OOB layout representation.
233 */
234struct nand_ecclayout_user {
235 __u32 eccbytes;
236 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
237 __u32 oobavail;
238 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
239};
240
241/**
242 * struct mtd_ecc_stats - error correction stats
243 *
244 * @corrected: number of corrected bits
245 * @failed: number of uncorrectable errors
246 * @badblocks: number of bad blocks in this partition
247 * @bbtblocks: number of blocks reserved for bad block tables
248 */
249struct mtd_ecc_stats {
250 __u32 corrected;
251 __u32 failed;
252 __u32 badblocks;
253 __u32 bbtblocks;
254};
255
256/*
257 * MTD file modes - for read/write access to MTD
258 *
259 * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled
260 * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode
261 * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode
262 * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled
263 *
264 * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained
265 * separately for each open file descriptor.
266 *
267 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
268 * raw access to the flash, without error correction or autoplacement schemes.
269 * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode
270 * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is
271 * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).
272 */
273enum mtd_file_modes {
274 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
275 MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
276 MTD_FILE_MODE_OTP_USER = MTD_OTP_USER,
277 MTD_FILE_MODE_RAW,
278};
279
280static __inline__ int mtd_type_is_nand_user(const struct mtd_info_user *mtd)
281{
282 return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
283}
284
285#endif /* __MTD_ABI_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/mtd/mtd-user.h deleted-33
...@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef __MTD_USER_H__
22#define __MTD_USER_H__
23
24/* This file is blessed for inclusion by userspace */
25#include <mtd/mtd-abi.h>
26
27typedef struct mtd_info_user mtd_info_t;
28typedef struct erase_info_user erase_info_t;
29typedef struct region_info_user region_info_t;
30typedef struct nand_oobinfo nand_oobinfo_t;
31typedef struct nand_ecclayout_user nand_ecclayout_t;
32
33#endif /* __MTD_USER_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/mtd/nftl-user.h deleted-91
...@@ -1,91 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef __MTD_NFTL_USER_H__
22#define __MTD_NFTL_USER_H__
23
24#include <linux/types.h>
25
26/* Block Control Information */
27
28struct nftl_bci {
29 unsigned char ECCSig[6];
30 __u8 Status;
31 __u8 Status1;
32}__attribute__((packed));
33
34/* Unit Control Information */
35
36struct nftl_uci0 {
37 __u16 VirtUnitNum;
38 __u16 ReplUnitNum;
39 __u16 SpareVirtUnitNum;
40 __u16 SpareReplUnitNum;
41} __attribute__((packed));
42
43struct nftl_uci1 {
44 __u32 WearInfo;
45 __u16 EraseMark;
46 __u16 EraseMark1;
47} __attribute__((packed));
48
49struct nftl_uci2 {
50 __u16 FoldMark;
51 __u16 FoldMark1;
52 __u32 unused;
53} __attribute__((packed));
54
55union nftl_uci {
56 struct nftl_uci0 a;
57 struct nftl_uci1 b;
58 struct nftl_uci2 c;
59};
60
61struct nftl_oob {
62 struct nftl_bci b;
63 union nftl_uci u;
64};
65
66/* NFTL Media Header */
67
68struct NFTLMediaHeader {
69 char DataOrgID[6];
70 __u16 NumEraseUnits;
71 __u16 FirstPhysicalEUN;
72 __u32 FormattedSize;
73 unsigned char UnitSizeFactor;
74} __attribute__((packed));
75
76#define MAX_ERASE_ZONES (8192 - 512)
77
78#define ERASE_MARK 0x3c69
79#define SECTOR_FREE 0xff
80#define SECTOR_USED 0x55
81#define SECTOR_IGNORE 0x11
82#define SECTOR_DELETED 0x00
83
84#define FOLD_MARK_IN_PROGRESS 0x5555
85
86#define ZONE_GOOD 0xff
87#define ZONE_BAD_ORIGINAL 0
88#define ZONE_BAD_MARKED 7
89
90
91#endif /* __MTD_NFTL_USER_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/mtd/ubi-user.h deleted-460
...@@ -1,460 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright © International Business Machines Corp., 2006
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Artem Bityutskiy (Битюцкий Артём)
20 */
21
22#ifndef __UBI_USER_H__
23#define __UBI_USER_H__
24
25#include <linux/types.h>
26
27/*
28 * UBI device creation (the same as MTD device attachment)
29 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 *
31 * MTD devices may be attached using %UBI_IOCATT ioctl command of the UBI
32 * control device. The caller has to properly fill and pass
33 * &struct ubi_attach_req object - UBI will attach the MTD device specified in
34 * the request and return the newly created UBI device number as the ioctl
35 * return value.
36 *
37 * UBI device deletion (the same as MTD device detachment)
38 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 *
40 * An UBI device maybe deleted with %UBI_IOCDET ioctl command of the UBI
41 * control device.
42 *
43 * UBI volume creation
44 * ~~~~~~~~~~~~~~~~~~~
45 *
46 * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character
47 * device. A &struct ubi_mkvol_req object has to be properly filled and a
48 * pointer to it has to be passed to the ioctl.
49 *
50 * UBI volume deletion
51 * ~~~~~~~~~~~~~~~~~~~
52 *
53 * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character
54 * device should be used. A pointer to the 32-bit volume ID hast to be passed
55 * to the ioctl.
56 *
57 * UBI volume re-size
58 * ~~~~~~~~~~~~~~~~~~
59 *
60 * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character
61 * device should be used. A &struct ubi_rsvol_req object has to be properly
62 * filled and a pointer to it has to be passed to the ioctl.
63 *
64 * UBI volumes re-name
65 * ~~~~~~~~~~~~~~~~~~~
66 *
67 * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command
68 * of the UBI character device should be used. A &struct ubi_rnvol_req object
69 * has to be properly filled and a pointer to it has to be passed to the ioctl.
70 *
71 * UBI volume update
72 * ~~~~~~~~~~~~~~~~~
73 *
74 * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the
75 * corresponding UBI volume character device. A pointer to a 64-bit update
76 * size should be passed to the ioctl. After this, UBI expects user to write
77 * this number of bytes to the volume character device. The update is finished
78 * when the claimed number of bytes is passed. So, the volume update sequence
79 * is something like:
80 *
81 * fd = open("/dev/my_volume");
82 * ioctl(fd, UBI_IOCVOLUP, &image_size);
83 * write(fd, buf, image_size);
84 * close(fd);
85 *
86 * Logical eraseblock erase
87 * ~~~~~~~~~~~~~~~~~~~~~~~~
88 *
89 * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the
90 * corresponding UBI volume character device should be used. This command
91 * unmaps the requested logical eraseblock, makes sure the corresponding
92 * physical eraseblock is successfully erased, and returns.
93 *
94 * Atomic logical eraseblock change
95 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96 *
97 * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH
98 * ioctl command of the corresponding UBI volume character device. A pointer to
99 * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the
100 * user is expected to write the requested amount of bytes (similarly to what
101 * should be done in case of the "volume update" ioctl).
102 *
103 * Logical eraseblock map
104 * ~~~~~~~~~~~~~~~~~~~~~
105 *
106 * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP
107 * ioctl command should be used. A pointer to a &struct ubi_map_req object is
108 * expected to be passed. The ioctl maps the requested logical eraseblock to
109 * a physical eraseblock and returns. Only non-mapped logical eraseblocks can
110 * be mapped. If the logical eraseblock specified in the request is already
111 * mapped to a physical eraseblock, the ioctl fails and returns error.
112 *
113 * Logical eraseblock unmap
114 * ~~~~~~~~~~~~~~~~~~~~~~~~
115 *
116 * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP
117 * ioctl command should be used. The ioctl unmaps the logical eraseblocks,
118 * schedules corresponding physical eraseblock for erasure, and returns. Unlike
119 * the "LEB erase" command, it does not wait for the physical eraseblock being
120 * erased. Note, the side effect of this is that if an unclean reboot happens
121 * after the unmap ioctl returns, you may find the LEB mapped again to the same
122 * physical eraseblock after the UBI is run again.
123 *
124 * Check if logical eraseblock is mapped
125 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126 *
127 * To check if a logical eraseblock is mapped to a physical eraseblock, the
128 * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
129 * not mapped, and %1 if it is mapped.
130 *
131 * Set an UBI volume property
132 * ~~~~~~~~~~~~~~~~~~~~~~~~~
133 *
134 * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
135 * used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be
136 * passed. The object describes which property should be set, and to which value
137 * it should be set.
138 *
139 * Block devices on UBI volumes
140 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141 *
142 * To create a R/O block device on top of an UBI volume the %UBI_IOCVOLCRBLK
143 * should be used. A pointer to a &struct ubi_blkcreate_req object is expected
144 * to be passed, which is not used and reserved for future usage.
145 *
146 * Conversely, to remove a block device the %UBI_IOCVOLRMBLK should be used,
147 * which takes no arguments.
148 */
149
150/*
151 * When a new UBI volume or UBI device is created, users may either specify the
152 * volume/device number they want to create or to let UBI automatically assign
153 * the number using these constants.
154 */
155#define UBI_VOL_NUM_AUTO (-1)
156#define UBI_DEV_NUM_AUTO (-1)
157
158/* Maximum volume name length */
159#define UBI_MAX_VOLUME_NAME 127
160
161/* ioctl commands of UBI character devices */
162
163#define UBI_IOC_MAGIC 'o'
164
165/* Create an UBI volume */
166#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
167/* Remove an UBI volume */
168#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
169/* Re-size an UBI volume */
170#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
171/* Re-name volumes */
172#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
173
174/* ioctl commands of the UBI control character device */
175
176#define UBI_CTRL_IOC_MAGIC 'o'
177
178/* Attach an MTD device */
179#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
180/* Detach an MTD device */
181#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
182
183/* ioctl commands of UBI volume character devices */
184
185#define UBI_VOL_IOC_MAGIC 'O'
186
187/* Start UBI volume update
188 * Note: This actually takes a pointer (__s64*), but we can't change
189 * that without breaking the ABI on 32bit systems
190 */
191#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
192/* LEB erasure command, used for debugging, disabled by default */
193#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
194/* Atomic LEB change command */
195#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
196/* Map LEB command */
197#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
198/* Unmap LEB command */
199#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
200/* Check if LEB is mapped command */
201#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
202/* Set an UBI volume property */
203#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
204 struct ubi_set_vol_prop_req)
205/* Create a R/O block device on top of an UBI volume */
206#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
207/* Remove the R/O block device */
208#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
209
210/* Maximum MTD device name length supported by UBI */
211#define MAX_UBI_MTD_NAME_LEN 127
212
213/* Maximum amount of UBI volumes that can be re-named at one go */
214#define UBI_MAX_RNVOL 32
215
216/*
217 * UBI volume type constants.
218 *
219 * @UBI_DYNAMIC_VOLUME: dynamic volume
220 * @UBI_STATIC_VOLUME: static volume
221 */
222enum {
223 UBI_DYNAMIC_VOLUME = 3,
224 UBI_STATIC_VOLUME = 4,
225};
226
227/*
228 * UBI set volume property ioctl constants.
229 *
230 * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0)
231 * user to directly write and erase individual
232 * eraseblocks on dynamic volumes
233 */
234enum {
235 UBI_VOL_PROP_DIRECT_WRITE = 1,
236};
237
238/**
239 * struct ubi_attach_req - attach MTD device request.
240 * @ubi_num: UBI device number to create
241 * @mtd_num: MTD device number to attach
242 * @vid_hdr_offset: VID header offset (use defaults if %0)
243 * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
244 * @padding: reserved for future, not used, has to be zeroed
245 *
246 * This data structure is used to specify MTD device UBI has to attach and the
247 * parameters it has to use. The number which should be assigned to the new UBI
248 * device is passed in @ubi_num. UBI may automatically assign the number if
249 * @UBI_DEV_NUM_AUTO is passed. In this case, the device number is returned in
250 * @ubi_num.
251 *
252 * Most applications should pass %0 in @vid_hdr_offset to make UBI use default
253 * offset of the VID header within physical eraseblocks. The default offset is
254 * the next min. I/O unit after the EC header. For example, it will be offset
255 * 512 in case of a 512 bytes page NAND flash with no sub-page support. Or
256 * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages.
257 *
258 * But in rare cases, if this optimizes things, the VID header may be placed to
259 * a different offset. For example, the boot-loader might do things faster if
260 * the VID header sits at the end of the first 2KiB NAND page with 4 sub-pages.
261 * As the boot-loader would not normally need to read EC headers (unless it
262 * needs UBI in RW mode), it might be faster to calculate ECC. This is weird
263 * example, but it real-life example. So, in this example, @vid_hdr_offer would
264 * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes
265 * aligned, which is OK, as UBI is clever enough to realize this is 4th
266 * sub-page of the first page and add needed padding.
267 *
268 * The @max_beb_per1024 is the maximum amount of bad PEBs UBI expects on the
269 * UBI device per 1024 eraseblocks. This value is often given in an other form
270 * in the NAND datasheet (min NVB i.e. minimal number of valid blocks). The
271 * maximum expected bad eraseblocks per 1024 is then:
272 * 1024 * (1 - MinNVB / MaxNVB)
273 * Which gives 20 for most NAND devices. This limit is used in order to derive
274 * amount of eraseblock UBI reserves for handling new bad blocks. If the device
275 * has more bad eraseblocks than this limit, UBI does not reserve any physical
276 * eraseblocks for new bad eraseblocks, but attempts to use available
277 * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the
278 * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used.
279 */
280struct ubi_attach_req {
281 __s32 ubi_num;
282 __s32 mtd_num;
283 __s32 vid_hdr_offset;
284 __s16 max_beb_per1024;
285 __s8 padding[10];
286};
287
288/*
289 * UBI volume flags.
290 *
291 * @UBI_VOL_SKIP_CRC_CHECK_FLG: skip the CRC check done on a static volume at
292 * open time. Only valid for static volumes and
293 * should only be used if the volume user has a
294 * way to verify data integrity
295 */
296enum {
297 UBI_VOL_SKIP_CRC_CHECK_FLG = 0x1,
298};
299
300#define UBI_VOL_VALID_FLGS (UBI_VOL_SKIP_CRC_CHECK_FLG)
301
302/**
303 * struct ubi_mkvol_req - volume description data structure used in
304 * volume creation requests.
305 * @vol_id: volume number
306 * @alignment: volume alignment
307 * @bytes: volume size in bytes
308 * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME)
309 * @flags: volume flags (%UBI_VOL_SKIP_CRC_CHECK_FLG)
310 * @name_len: volume name length
311 * @padding2: reserved for future, not used, has to be zeroed
312 * @name: volume name
313 *
314 * This structure is used by user-space programs when creating new volumes. The
315 * @used_bytes field is only necessary when creating static volumes.
316 *
317 * The @alignment field specifies the required alignment of the volume logical
318 * eraseblock. This means, that the size of logical eraseblocks will be aligned
319 * to this number, i.e.,
320 * (UBI device logical eraseblock size) mod (@alignment) = 0.
321 *
322 * To put it differently, the logical eraseblock of this volume may be slightly
323 * shortened in order to make it properly aligned. The alignment has to be
324 * multiple of the flash minimal input/output unit, or %1 to utilize the entire
325 * available space of logical eraseblocks.
326 *
327 * The @alignment field may be useful, for example, when one wants to maintain
328 * a block device on top of an UBI volume. In this case, it is desirable to fit
329 * an integer number of blocks in logical eraseblocks of this UBI volume. With
330 * alignment it is possible to update this volume using plane UBI volume image
331 * BLOBs, without caring about how to properly align them.
332 */
333struct ubi_mkvol_req {
334 __s32 vol_id;
335 __s32 alignment;
336 __s64 bytes;
337 __s8 vol_type;
338 __u8 flags;
339 __s16 name_len;
340 __s8 padding2[4];
341 char name[UBI_MAX_VOLUME_NAME + 1];
342} __attribute__((packed));
343
344/**
345 * struct ubi_rsvol_req - a data structure used in volume re-size requests.
346 * @vol_id: ID of the volume to re-size
347 * @bytes: new size of the volume in bytes
348 *
349 * Re-sizing is possible for both dynamic and static volumes. But while dynamic
350 * volumes may be re-sized arbitrarily, static volumes cannot be made to be
351 * smaller than the number of bytes they bear. To arbitrarily shrink a static
352 * volume, it must be wiped out first (by means of volume update operation with
353 * zero number of bytes).
354 */
355struct ubi_rsvol_req {
356 __s64 bytes;
357 __s32 vol_id;
358} __attribute__((packed));
359
360/**
361 * struct ubi_rnvol_req - volumes re-name request.
362 * @count: count of volumes to re-name
363 * @padding1: reserved for future, not used, has to be zeroed
364 * @vol_id: ID of the volume to re-name
365 * @name_len: name length
366 * @padding2: reserved for future, not used, has to be zeroed
367 * @name: new volume name
368 *
369 * UBI allows to re-name up to %32 volumes at one go. The count of volumes to
370 * re-name is specified in the @count field. The ID of the volumes to re-name
371 * and the new names are specified in the @vol_id and @name fields.
372 *
373 * The UBI volume re-name operation is atomic, which means that should power cut
374 * happen, the volumes will have either old name or new name. So the possible
375 * use-cases of this command is atomic upgrade. Indeed, to upgrade, say, volumes
376 * A and B one may create temporary volumes %A1 and %B1 with the new contents,
377 * then atomically re-name A1->A and B1->B, in which case old %A and %B will
378 * be removed.
379 *
380 * If it is not desirable to remove old A and B, the re-name request has to
381 * contain 4 entries: A1->A, A->A1, B1->B, B->B1, in which case old A1 and B1
382 * become A and B, and old A and B will become A1 and B1.
383 *
384 * It is also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1
385 * and B1 become A and B, and old A and B become X and Y.
386 *
387 * In other words, in case of re-naming into an existing volume name, the
388 * existing volume is removed, unless it is re-named as well at the same
389 * re-name request.
390 */
391struct ubi_rnvol_req {
392 __s32 count;
393 __s8 padding1[12];
394 struct {
395 __s32 vol_id;
396 __s16 name_len;
397 __s8 padding2[2];
398 char name[UBI_MAX_VOLUME_NAME + 1];
399 } ents[UBI_MAX_RNVOL];
400} __attribute__((packed));
401
402/**
403 * struct ubi_leb_change_req - a data structure used in atomic LEB change
404 * requests.
405 * @lnum: logical eraseblock number to change
406 * @bytes: how many bytes will be written to the logical eraseblock
407 * @dtype: pass "3" for better compatibility with old kernels
408 * @padding: reserved for future, not used, has to be zeroed
409 *
410 * The @dtype field used to inform UBI about what kind of data will be written
411 * to the LEB: long term (value 1), short term (value 2), unknown (value 3).
412 * UBI tried to pick a PEB with lower erase counter for short term data and a
413 * PEB with higher erase counter for long term data. But this was not really
414 * used because users usually do not know this and could easily mislead UBI. We
415 * removed this feature in May 2012. UBI currently just ignores the @dtype
416 * field. But for better compatibility with older kernels it is recommended to
417 * set @dtype to 3 (unknown).
418 */
419struct ubi_leb_change_req {
420 __s32 lnum;
421 __s32 bytes;
422 __s8 dtype; /* obsolete, do not use! */
423 __s8 padding[7];
424} __attribute__((packed));
425
426/**
427 * struct ubi_map_req - a data structure used in map LEB requests.
428 * @dtype: pass "3" for better compatibility with old kernels
429 * @lnum: logical eraseblock number to unmap
430 * @padding: reserved for future, not used, has to be zeroed
431 */
432struct ubi_map_req {
433 __s32 lnum;
434 __s8 dtype; /* obsolete, do not use! */
435 __s8 padding[3];
436} __attribute__((packed));
437
438
439/**
440 * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume
441 * property.
442 * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
443 * @padding: reserved for future, not used, has to be zeroed
444 * @value: value to set
445 */
446struct ubi_set_vol_prop_req {
447 __u8 property;
448 __u8 padding[7];
449 __u64 value;
450} __attribute__((packed));
451
452/**
453 * struct ubi_blkcreate_req - a data structure used in block creation requests.
454 * @padding: reserved for future, not used, has to be zeroed
455 */
456struct ubi_blkcreate_req {
457 __s8 padding[128];
458} __attribute__((packed));
459
460#endif /* __UBI_USER_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/netinet/in.h+3
...@@ -52,6 +52,7 @@ struct ipv6_mreq {...@@ -52,6 +52,7 @@ struct ipv6_mreq {
52#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)52#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
53#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)53#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
54#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)54#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
55#define INADDR_ALLSNOOPERS_GROUP ((in_addr_t) 0xe000006a)
55#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)56#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
5657
57#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }58#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
...@@ -335,6 +336,8 @@ struct ip6_mtuinfo {...@@ -335,6 +336,8 @@ struct ip6_mtuinfo {
335#define IPV6_V6ONLY 26336#define IPV6_V6ONLY 26
336#define IPV6_JOIN_ANYCAST 27337#define IPV6_JOIN_ANYCAST 27
337#define IPV6_LEAVE_ANYCAST 28338#define IPV6_LEAVE_ANYCAST 28
339#define IPV6_MULTICAST_ALL 29
340#define IPV6_ROUTER_ALERT_ISOLATE 30
338#define IPV6_IPSEC_POLICY 34341#define IPV6_IPSEC_POLICY 34
339#define IPV6_XFRM_POLICY 35342#define IPV6_XFRM_POLICY 35
340#define IPV6_HDRINCL 36343#define IPV6_HDRINCL 36
lib/libc/include/generic-musl/netinet/tcp.h+9
...@@ -72,6 +72,11 @@ enum {...@@ -72,6 +72,11 @@ enum {
72 TCP_NLA_SND_SSTHRESH,72 TCP_NLA_SND_SSTHRESH,
73 TCP_NLA_DELIVERED,73 TCP_NLA_DELIVERED,
74 TCP_NLA_DELIVERED_CE,74 TCP_NLA_DELIVERED_CE,
75 TCP_NLA_BYTES_SENT,
76 TCP_NLA_BYTES_RETRANS,
77 TCP_NLA_DSACK_DUPS,
78 TCP_NLA_REORD_SEEN,
79 TCP_NLA_SRTT,
75};80};
7681
77#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)82#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
...@@ -225,6 +230,10 @@ struct tcp_info {...@@ -225,6 +230,10 @@ struct tcp_info {
225 uint64_t tcpi_sndbuf_limited;230 uint64_t tcpi_sndbuf_limited;
226 uint32_t tcpi_delivered;231 uint32_t tcpi_delivered;
227 uint32_t tcpi_delivered_ce;232 uint32_t tcpi_delivered_ce;
233 uint64_t tcpi_bytes_sent;
234 uint64_t tcpi_bytes_retrans;
235 uint32_t tcpi_dsack_dups;
236 uint32_t tcpi_reord_seen;
228};237};
229238
230#define TCP_MD5SIG_MAXKEYLEN 80239#define TCP_MD5SIG_MAXKEYLEN 80
lib/libc/include/generic-musl/netinet/udp.h+2
...@@ -27,12 +27,14 @@ struct udphdr {...@@ -27,12 +27,14 @@ struct udphdr {
27#define UDP_NO_CHECK6_TX 10127#define UDP_NO_CHECK6_TX 101
28#define UDP_NO_CHECK6_RX 10228#define UDP_NO_CHECK6_RX 102
29#define UDP_SEGMENT 10329#define UDP_SEGMENT 103
30#define UDP_GRO 104
3031
31#define UDP_ENCAP_ESPINUDP_NON_IKE 132#define UDP_ENCAP_ESPINUDP_NON_IKE 1
32#define UDP_ENCAP_ESPINUDP 233#define UDP_ENCAP_ESPINUDP 2
33#define UDP_ENCAP_L2TPINUDP 334#define UDP_ENCAP_L2TPINUDP 3
34#define UDP_ENCAP_GTP0 435#define UDP_ENCAP_GTP0 4
35#define UDP_ENCAP_GTP1U 536#define UDP_ENCAP_GTP1U 5
37#define UDP_ENCAP_RXRPC 6
3638
37#define SOL_UDP 1739#define SOL_UDP 17
3840
lib/libc/include/generic-musl/netpacket/packet.h+1
...@@ -48,6 +48,7 @@ struct packet_mreq {...@@ -48,6 +48,7 @@ struct packet_mreq {
48#define PACKET_QDISC_BYPASS 2048#define PACKET_QDISC_BYPASS 20
49#define PACKET_ROLLOVER_STATS 2149#define PACKET_ROLLOVER_STATS 21
50#define PACKET_FANOUT_DATA 2250#define PACKET_FANOUT_DATA 22
51#define PACKET_IGNORE_OUTGOING 23
5152
52#define PACKET_MR_MULTICAST 053#define PACKET_MR_MULTICAST 0
53#define PACKET_MR_PROMISC 154#define PACKET_MR_PROMISC 1
lib/libc/include/generic-musl/plugin-api.h deleted-483
...@@ -1,483 +0,0 @@
1/* plugin-api.h -- External linker plugin API. */
2
3/* Copyright (C) 2009-2019 Free Software Foundation, Inc.
4 Written by Cary Coutant <ccoutant@google.com>.
5
6 This file is part of binutils.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
22
23/* This file defines the interface for writing a linker plugin, which is
24 described at < http://gcc.gnu.org/wiki/whopr/driver >. */
25
26#ifndef PLUGIN_API_H
27#define PLUGIN_API_H
28
29#ifdef HAVE_STDINT_H
30#include <stdint.h>
31#elif defined(HAVE_INTTYPES_H)
32#include <inttypes.h>
33#endif
34#include <sys/types.h>
35#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) && \
36 !defined(UINT64_MAX) && !defined(uint64_t)
37#error cannot find uint64_t type
38#endif
39
40#ifdef __cplusplus
41extern "C"
42{
43#endif
44
45/* Status code returned by most API routines. */
46
47enum ld_plugin_status
48{
49 LDPS_OK = 0,
50 LDPS_NO_SYMS, /* Attempt to get symbols that haven't been added. */
51 LDPS_BAD_HANDLE, /* No claimed object associated with given handle. */
52 LDPS_ERR
53 /* Additional Error codes TBD. */
54};
55
56/* The version of the API specification. */
57
58enum ld_plugin_api_version
59{
60 LD_PLUGIN_API_VERSION = 1
61};
62
63/* The type of output file being generated by the linker. */
64
65enum ld_plugin_output_file_type
66{
67 LDPO_REL,
68 LDPO_EXEC,
69 LDPO_DYN,
70 LDPO_PIE
71};
72
73/* An input file managed by the plugin library. */
74
75struct ld_plugin_input_file
76{
77 const char *name;
78 int fd;
79 off_t offset;
80 off_t filesize;
81 void *handle;
82};
83
84/* A symbol belonging to an input file managed by the plugin library. */
85
86struct ld_plugin_symbol
87{
88 char *name;
89 char *version;
90 int def;
91 int visibility;
92 uint64_t size;
93 char *comdat_key;
94 int resolution;
95};
96
97/* An object's section. */
98
99struct ld_plugin_section
100{
101 const void* handle;
102 unsigned int shndx;
103};
104
105/* Whether the symbol is a definition, reference, or common, weak or not. */
106
107enum ld_plugin_symbol_kind
108{
109 LDPK_DEF,
110 LDPK_WEAKDEF,
111 LDPK_UNDEF,
112 LDPK_WEAKUNDEF,
113 LDPK_COMMON
114};
115
116/* The visibility of the symbol. */
117
118enum ld_plugin_symbol_visibility
119{
120 LDPV_DEFAULT,
121 LDPV_PROTECTED,
122 LDPV_INTERNAL,
123 LDPV_HIDDEN
124};
125
126/* How a symbol is resolved. */
127
128enum ld_plugin_symbol_resolution
129{
130 LDPR_UNKNOWN = 0,
131
132 /* Symbol is still undefined at this point. */
133 LDPR_UNDEF,
134
135 /* This is the prevailing definition of the symbol, with references from
136 regular object code. */
137 LDPR_PREVAILING_DEF,
138
139 /* This is the prevailing definition of the symbol, with no
140 references from regular objects. It is only referenced from IR
141 code. */
142 LDPR_PREVAILING_DEF_IRONLY,
143
144 /* This definition was pre-empted by a definition in a regular
145 object file. */
146 LDPR_PREEMPTED_REG,
147
148 /* This definition was pre-empted by a definition in another IR file. */
149 LDPR_PREEMPTED_IR,
150
151 /* This symbol was resolved by a definition in another IR file. */
152 LDPR_RESOLVED_IR,
153
154 /* This symbol was resolved by a definition in a regular object
155 linked into the main executable. */
156 LDPR_RESOLVED_EXEC,
157
158 /* This symbol was resolved by a definition in a shared object. */
159 LDPR_RESOLVED_DYN,
160
161 /* This is the prevailing definition of the symbol, with no
162 references from regular objects. It is only referenced from IR
163 code, but the symbol is exported and may be referenced from
164 a dynamic object (not seen at link time). */
165 LDPR_PREVAILING_DEF_IRONLY_EXP
166};
167
168/* The plugin library's "claim file" handler. */
169
170typedef
171enum ld_plugin_status
172(*ld_plugin_claim_file_handler) (
173 const struct ld_plugin_input_file *file, int *claimed);
174
175/* The plugin library's "all symbols read" handler. */
176
177typedef
178enum ld_plugin_status
179(*ld_plugin_all_symbols_read_handler) (void);
180
181/* The plugin library's cleanup handler. */
182
183typedef
184enum ld_plugin_status
185(*ld_plugin_cleanup_handler) (void);
186
187/* The linker's interface for registering the "claim file" handler. */
188
189typedef
190enum ld_plugin_status
191(*ld_plugin_register_claim_file) (ld_plugin_claim_file_handler handler);
192
193/* The linker's interface for registering the "all symbols read" handler. */
194
195typedef
196enum ld_plugin_status
197(*ld_plugin_register_all_symbols_read) (
198 ld_plugin_all_symbols_read_handler handler);
199
200/* The linker's interface for registering the cleanup handler. */
201
202typedef
203enum ld_plugin_status
204(*ld_plugin_register_cleanup) (ld_plugin_cleanup_handler handler);
205
206/* The linker's interface for adding symbols from a claimed input file. */
207
208typedef
209enum ld_plugin_status
210(*ld_plugin_add_symbols) (void *handle, int nsyms,
211 const struct ld_plugin_symbol *syms);
212
213/* The linker's interface for getting the input file information with
214 an open (possibly re-opened) file descriptor. */
215
216typedef
217enum ld_plugin_status
218(*ld_plugin_get_input_file) (const void *handle,
219 struct ld_plugin_input_file *file);
220
221typedef
222enum ld_plugin_status
223(*ld_plugin_get_view) (const void *handle, const void **viewp);
224
225/* The linker's interface for releasing the input file. */
226
227typedef
228enum ld_plugin_status
229(*ld_plugin_release_input_file) (const void *handle);
230
231/* The linker's interface for retrieving symbol resolution information. */
232
233typedef
234enum ld_plugin_status
235(*ld_plugin_get_symbols) (const void *handle, int nsyms,
236 struct ld_plugin_symbol *syms);
237
238/* The linker's interface for adding a compiled input file. */
239
240typedef
241enum ld_plugin_status
242(*ld_plugin_add_input_file) (const char *pathname);
243
244/* The linker's interface for adding a library that should be searched. */
245
246typedef
247enum ld_plugin_status
248(*ld_plugin_add_input_library) (const char *libname);
249
250/* The linker's interface for adding a library path that should be searched. */
251
252typedef
253enum ld_plugin_status
254(*ld_plugin_set_extra_library_path) (const char *path);
255
256/* The linker's interface for issuing a warning or error message. */
257
258typedef
259enum ld_plugin_status
260(*ld_plugin_message) (int level, const char *format, ...);
261
262/* The linker's interface for retrieving the number of sections in an object.
263 The handle is obtained in the claim_file handler. This interface should
264 only be invoked in the claim_file handler. This function sets *COUNT to
265 the number of sections in the object. */
266
267typedef
268enum ld_plugin_status
269(*ld_plugin_get_input_section_count) (const void* handle, unsigned int *count);
270
271/* The linker's interface for retrieving the section type of a specific
272 section in an object. This interface should only be invoked in the
273 claim_file handler. This function sets *TYPE to an ELF SHT_xxx value. */
274
275typedef
276enum ld_plugin_status
277(*ld_plugin_get_input_section_type) (const struct ld_plugin_section section,
278 unsigned int *type);
279
280/* The linker's interface for retrieving the name of a specific section in
281 an object. This interface should only be invoked in the claim_file handler.
282 This function sets *SECTION_NAME_PTR to a null-terminated buffer allocated
283 by malloc. The plugin must free *SECTION_NAME_PTR. */
284
285typedef
286enum ld_plugin_status
287(*ld_plugin_get_input_section_name) (const struct ld_plugin_section section,
288 char **section_name_ptr);
289
290/* The linker's interface for retrieving the contents of a specific section
291 in an object. This interface should only be invoked in the claim_file
292 handler. This function sets *SECTION_CONTENTS to point to a buffer that is
293 valid until clam_file handler returns. It sets *LEN to the size of the
294 buffer. */
295
296typedef
297enum ld_plugin_status
298(*ld_plugin_get_input_section_contents) (const struct ld_plugin_section section,
299 const unsigned char **section_contents,
300 size_t* len);
301
302/* The linker's interface for specifying the desired order of sections.
303 The sections should be specifed using the array SECTION_LIST in the
304 order in which they should appear in the final layout. NUM_SECTIONS
305 specifies the number of entries in each array. This should be invoked
306 in the all_symbols_read handler. */
307
308typedef
309enum ld_plugin_status
310(*ld_plugin_update_section_order) (const struct ld_plugin_section *section_list,
311 unsigned int num_sections);
312
313/* The linker's interface for specifying that reordering of sections is
314 desired so that the linker can prepare for it. This should be invoked
315 before update_section_order, preferably in the claim_file handler. */
316
317typedef
318enum ld_plugin_status
319(*ld_plugin_allow_section_ordering) (void);
320
321/* The linker's interface for specifying that a subset of sections is
322 to be mapped to a unique segment. If the plugin wants to call
323 unique_segment_for_sections, it must call this function from a
324 claim_file_handler or when it is first loaded. */
325
326typedef
327enum ld_plugin_status
328(*ld_plugin_allow_unique_segment_for_sections) (void);
329
330/* The linker's interface for specifying that a specific set of sections
331 must be mapped to a unique segment. ELF segments do not have names
332 and the NAME is used as the name of the newly created output section
333 that is then placed in the unique PT_LOAD segment. FLAGS is used to
334 specify if any additional segment flags need to be set. For instance,
335 a specific segment flag can be set to identify this segment. Unsetting
336 segment flags that would be set by default is not possible. The
337 parameter SEGMENT_ALIGNMENT when non-zero will override the default. */
338
339typedef
340enum ld_plugin_status
341(*ld_plugin_unique_segment_for_sections) (
342 const char* segment_name,
343 uint64_t segment_flags,
344 uint64_t segment_alignment,
345 const struct ld_plugin_section * section_list,
346 unsigned int num_sections);
347
348/* The linker's interface for retrieving the section alignment requirement
349 of a specific section in an object. This interface should only be invoked in the
350 claim_file handler. This function sets *ADDRALIGN to the ELF sh_addralign
351 value of the input section. */
352
353typedef
354enum ld_plugin_status
355(*ld_plugin_get_input_section_alignment) (const struct ld_plugin_section section,
356 unsigned int *addralign);
357
358/* The linker's interface for retrieving the section size of a specific section
359 in an object. This interface should only be invoked in the claim_file handler.
360 This function sets *SECSIZE to the ELF sh_size
361 value of the input section. */
362
363typedef
364enum ld_plugin_status
365(*ld_plugin_get_input_section_size) (const struct ld_plugin_section section,
366 uint64_t *secsize);
367
368typedef
369enum ld_plugin_status
370(*ld_plugin_new_input_handler) (const struct ld_plugin_input_file *file);
371
372/* The linker's interface for registering the "new_input" handler. This handler
373 will be notified when a new input file has been added after the
374 all_symbols_read event, allowing the plugin to, for example, set a unique
375 segment for sections in plugin-generated input files. */
376
377typedef
378enum ld_plugin_status
379(*ld_plugin_register_new_input) (ld_plugin_new_input_handler handler);
380
381/* The linker's interface for getting the list of wrapped symbols using the
382 --wrap option. This sets *NUM_SYMBOLS to number of wrapped symbols and
383 *WRAP_SYMBOL_LIST to the list of wrapped symbols. */
384
385typedef
386enum ld_plugin_status
387(*ld_plugin_get_wrap_symbols) (uint64_t *num_symbols,
388 const char ***wrap_symbol_list);
389
390enum ld_plugin_level
391{
392 LDPL_INFO,
393 LDPL_WARNING,
394 LDPL_ERROR,
395 LDPL_FATAL
396};
397
398/* Values for the tv_tag field of the transfer vector. */
399
400enum ld_plugin_tag
401{
402 LDPT_NULL = 0,
403 LDPT_API_VERSION = 1,
404 LDPT_GOLD_VERSION = 2,
405 LDPT_LINKER_OUTPUT = 3,
406 LDPT_OPTION = 4,
407 LDPT_REGISTER_CLAIM_FILE_HOOK = 5,
408 LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK = 6,
409 LDPT_REGISTER_CLEANUP_HOOK = 7,
410 LDPT_ADD_SYMBOLS = 8,
411 LDPT_GET_SYMBOLS = 9,
412 LDPT_ADD_INPUT_FILE = 10,
413 LDPT_MESSAGE = 11,
414 LDPT_GET_INPUT_FILE = 12,
415 LDPT_RELEASE_INPUT_FILE = 13,
416 LDPT_ADD_INPUT_LIBRARY = 14,
417 LDPT_OUTPUT_NAME = 15,
418 LDPT_SET_EXTRA_LIBRARY_PATH = 16,
419 LDPT_GNU_LD_VERSION = 17,
420 LDPT_GET_VIEW = 18,
421 LDPT_GET_INPUT_SECTION_COUNT = 19,
422 LDPT_GET_INPUT_SECTION_TYPE = 20,
423 LDPT_GET_INPUT_SECTION_NAME = 21,
424 LDPT_GET_INPUT_SECTION_CONTENTS = 22,
425 LDPT_UPDATE_SECTION_ORDER = 23,
426 LDPT_ALLOW_SECTION_ORDERING = 24,
427 LDPT_GET_SYMBOLS_V2 = 25,
428 LDPT_ALLOW_UNIQUE_SEGMENT_FOR_SECTIONS = 26,
429 LDPT_UNIQUE_SEGMENT_FOR_SECTIONS = 27,
430 LDPT_GET_SYMBOLS_V3 = 28,
431 LDPT_GET_INPUT_SECTION_ALIGNMENT = 29,
432 LDPT_GET_INPUT_SECTION_SIZE = 30,
433 LDPT_REGISTER_NEW_INPUT_HOOK = 31,
434 LDPT_GET_WRAP_SYMBOLS = 32
435};
436
437/* The plugin transfer vector. */
438
439struct ld_plugin_tv
440{
441 enum ld_plugin_tag tv_tag;
442 union
443 {
444 int tv_val;
445 const char *tv_string;
446 ld_plugin_register_claim_file tv_register_claim_file;
447 ld_plugin_register_all_symbols_read tv_register_all_symbols_read;
448 ld_plugin_register_cleanup tv_register_cleanup;
449 ld_plugin_add_symbols tv_add_symbols;
450 ld_plugin_get_symbols tv_get_symbols;
451 ld_plugin_add_input_file tv_add_input_file;
452 ld_plugin_message tv_message;
453 ld_plugin_get_input_file tv_get_input_file;
454 ld_plugin_get_view tv_get_view;
455 ld_plugin_release_input_file tv_release_input_file;
456 ld_plugin_add_input_library tv_add_input_library;
457 ld_plugin_set_extra_library_path tv_set_extra_library_path;
458 ld_plugin_get_input_section_count tv_get_input_section_count;
459 ld_plugin_get_input_section_type tv_get_input_section_type;
460 ld_plugin_get_input_section_name tv_get_input_section_name;
461 ld_plugin_get_input_section_contents tv_get_input_section_contents;
462 ld_plugin_update_section_order tv_update_section_order;
463 ld_plugin_allow_section_ordering tv_allow_section_ordering;
464 ld_plugin_allow_unique_segment_for_sections tv_allow_unique_segment_for_sections;
465 ld_plugin_unique_segment_for_sections tv_unique_segment_for_sections;
466 ld_plugin_get_input_section_alignment tv_get_input_section_alignment;
467 ld_plugin_get_input_section_size tv_get_input_section_size;
468 ld_plugin_register_new_input tv_register_new_input;
469 ld_plugin_get_wrap_symbols tv_get_wrap_symbols;
470 } tv_u;
471};
472
473/* The plugin library's "onload" entry point. */
474
475typedef
476enum ld_plugin_status
477(*ld_plugin_onload) (struct ld_plugin_tv *tv);
478
479#ifdef __cplusplus
480}
481#endif
482
483#endif /* !defined(PLUGIN_API_H) */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/bnxt_re-abi.h deleted-106
...@@ -1,106 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 * Broadcom NetXtreme-E RoCE driver.
4 *
5 * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term
6 * Broadcom refers to Broadcom Limited and/or its subsidiaries.
7 *
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * BSD license below:
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 *
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in
22 * the documentation and/or other materials provided with the
23 * distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
34 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
35 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * Description: Uverbs ABI header file
38 */
39
40#ifndef __BNXT_RE_UVERBS_ABI_H__
41#define __BNXT_RE_UVERBS_ABI_H__
42
43#include <linux/types.h>
44
45#define BNXT_RE_ABI_VERSION 1
46
47struct bnxt_re_uctx_resp {
48 __u32 dev_id;
49 __u32 max_qp;
50 __u32 pg_size;
51 __u32 cqe_sz;
52 __u32 max_cqd;
53 __u32 rsvd;
54};
55
56/*
57 * This struct is placed after the ib_uverbs_alloc_pd_resp struct, which is
58 * not 8 byted aligned. To avoid undesired padding in various cases we have to
59 * set this struct to packed.
60 */
61struct bnxt_re_pd_resp {
62 __u32 pdid;
63 __u32 dpi;
64 __u64 dbr;
65} __attribute__((packed, aligned(4)));
66
67struct bnxt_re_cq_req {
68 __aligned_u64 cq_va;
69 __aligned_u64 cq_handle;
70};
71
72struct bnxt_re_cq_resp {
73 __u32 cqid;
74 __u32 tail;
75 __u32 phase;
76 __u32 rsvd;
77};
78
79struct bnxt_re_qp_req {
80 __aligned_u64 qpsva;
81 __aligned_u64 qprva;
82 __aligned_u64 qp_handle;
83};
84
85struct bnxt_re_qp_resp {
86 __u32 qpid;
87 __u32 rsvd;
88};
89
90struct bnxt_re_srq_req {
91 __aligned_u64 srqva;
92 __aligned_u64 srq_handle;
93};
94
95struct bnxt_re_srq_resp {
96 __u32 srqid;
97};
98
99enum bnxt_re_shpg_offt {
100 BNXT_RE_BEG_RESV_OFFT = 0x00,
101 BNXT_RE_AVID_OFFT = 0x10,
102 BNXT_RE_AVID_SIZE = 0x04,
103 BNXT_RE_END_RESV_OFFT = 0xFF0
104};
105
106#endif /* __BNXT_RE_UVERBS_ABI_H__*/
\ No newline at end of file
lib/libc/include/generic-musl/rdma/cxgb3-abi.h deleted-82
...@@ -1,82 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2006 Chelsio, Inc. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33#ifndef CXGB3_ABI_USER_H
34#define CXGB3_ABI_USER_H
35
36#include <linux/types.h>
37
38#define IWCH_UVERBS_ABI_VERSION 1
39
40/*
41 * Make sure that all structs defined in this file remain laid out so
42 * that they pack the same way on 32-bit and 64-bit architectures (to
43 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
44 * In particular do not use pointer types -- pass pointers in __aligned_u64
45 * instead.
46 */
47struct iwch_create_cq_req {
48 __aligned_u64 user_rptr_addr;
49};
50
51struct iwch_create_cq_resp_v0 {
52 __aligned_u64 key;
53 __u32 cqid;
54 __u32 size_log2;
55};
56
57struct iwch_create_cq_resp {
58 __aligned_u64 key;
59 __u32 cqid;
60 __u32 size_log2;
61 __u32 memsize;
62 __u32 reserved;
63};
64
65struct iwch_create_qp_resp {
66 __aligned_u64 key;
67 __aligned_u64 db_key;
68 __u32 qpid;
69 __u32 size_log2;
70 __u32 sq_size_log2;
71 __u32 rq_size_log2;
72};
73
74struct iwch_reg_user_mr_resp {
75 __u32 pbl_addr;
76};
77
78struct iwch_alloc_pd_resp {
79 __u32 pdid;
80};
81
82#endif /* CXGB3_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/cxgb4-abi.h deleted-115
...@@ -1,115 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33#ifndef CXGB4_ABI_USER_H
34#define CXGB4_ABI_USER_H
35
36#include <linux/types.h>
37
38#define C4IW_UVERBS_ABI_VERSION 3
39
40/*
41 * Make sure that all structs defined in this file remain laid out so
42 * that they pack the same way on 32-bit and 64-bit architectures (to
43 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
44 * In particular do not use pointer types -- pass pointers in __aligned_u64
45 * instead.
46 */
47
48enum {
49 C4IW_64B_CQE = (1 << 0)
50};
51
52struct c4iw_create_cq {
53 __u32 flags;
54 __u32 reserved;
55};
56
57struct c4iw_create_cq_resp {
58 __aligned_u64 key;
59 __aligned_u64 gts_key;
60 __aligned_u64 memsize;
61 __u32 cqid;
62 __u32 size;
63 __u32 qid_mask;
64 __u32 flags;
65};
66
67enum {
68 C4IW_QPF_ONCHIP = (1 << 0),
69 C4IW_QPF_WRITE_W_IMM = (1 << 1)
70};
71
72struct c4iw_create_qp_resp {
73 __aligned_u64 ma_sync_key;
74 __aligned_u64 sq_key;
75 __aligned_u64 rq_key;
76 __aligned_u64 sq_db_gts_key;
77 __aligned_u64 rq_db_gts_key;
78 __aligned_u64 sq_memsize;
79 __aligned_u64 rq_memsize;
80 __u32 sqid;
81 __u32 rqid;
82 __u32 sq_size;
83 __u32 rq_size;
84 __u32 qid_mask;
85 __u32 flags;
86};
87
88struct c4iw_create_srq_resp {
89 __aligned_u64 srq_key;
90 __aligned_u64 srq_db_gts_key;
91 __aligned_u64 srq_memsize;
92 __u32 srqid;
93 __u32 srq_size;
94 __u32 rqt_abs_idx;
95 __u32 qid_mask;
96 __u32 flags;
97 __u32 reserved; /* explicit padding */
98};
99
100enum {
101 /* HW supports SRQ_LIMIT_REACHED event */
102 T4_SRQ_LIMIT_SUPPORT = 1 << 0,
103};
104
105struct c4iw_alloc_ucontext_resp {
106 __aligned_u64 status_page_key;
107 __u32 status_page_size;
108 __u32 reserved; /* explicit padding (optional for i386) */
109};
110
111struct c4iw_alloc_pd_resp {
112 __u32 pdid;
113};
114
115#endif /* CXGB4_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/hfi/hfi1_ioctl.h deleted-174
...@@ -1,174 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * Copyright(c) 2015 Intel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * BSD LICENSE
21 *
22 * Copyright(c) 2015 Intel Corporation.
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 *
28 * - Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * - Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in
32 * the documentation and/or other materials provided with the
33 * distribution.
34 * - Neither the name of Intel Corporation nor the names of its
35 * contributors may be used to endorse or promote products derived
36 * from this software without specific prior written permission.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
42 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 *
50 */
51
52#ifndef _LINUX__HFI1_IOCTL_H
53#define _LINUX__HFI1_IOCTL_H
54#include <linux/types.h>
55
56/*
57 * This structure is passed to the driver to tell it where
58 * user code buffers are, sizes, etc. The offsets and sizes of the
59 * fields must remain unchanged, for binary compatibility. It can
60 * be extended, if userversion is changed so user code can tell, if needed
61 */
62struct hfi1_user_info {
63 /*
64 * version of user software, to detect compatibility issues.
65 * Should be set to HFI1_USER_SWVERSION.
66 */
67 __u32 userversion;
68 __u32 pad;
69 /*
70 * If two or more processes wish to share a context, each process
71 * must set the subcontext_cnt and subcontext_id to the same
72 * values. The only restriction on the subcontext_id is that
73 * it be unique for a given node.
74 */
75 __u16 subctxt_cnt;
76 __u16 subctxt_id;
77 /* 128bit UUID passed in by PSM. */
78 __u8 uuid[16];
79};
80
81struct hfi1_ctxt_info {
82 __aligned_u64 runtime_flags; /* chip/drv runtime flags (HFI1_CAP_*) */
83 __u32 rcvegr_size; /* size of each eager buffer */
84 __u16 num_active; /* number of active units */
85 __u16 unit; /* unit (chip) assigned to caller */
86 __u16 ctxt; /* ctxt on unit assigned to caller */
87 __u16 subctxt; /* subctxt on unit assigned to caller */
88 __u16 rcvtids; /* number of Rcv TIDs for this context */
89 __u16 credits; /* number of PIO credits for this context */
90 __u16 numa_node; /* NUMA node of the assigned device */
91 __u16 rec_cpu; /* cpu # for affinity (0xffff if none) */
92 __u16 send_ctxt; /* send context in use by this user context */
93 __u16 egrtids; /* number of RcvArray entries for Eager Rcvs */
94 __u16 rcvhdrq_cnt; /* number of RcvHdrQ entries */
95 __u16 rcvhdrq_entsize; /* size (in bytes) for each RcvHdrQ entry */
96 __u16 sdma_ring_size; /* number of entries in SDMA request ring */
97};
98
99struct hfi1_tid_info {
100 /* virtual address of first page in transfer */
101 __aligned_u64 vaddr;
102 /* pointer to tid array. this array is big enough */
103 __aligned_u64 tidlist;
104 /* number of tids programmed by this request */
105 __u32 tidcnt;
106 /* length of transfer buffer programmed by this request */
107 __u32 length;
108};
109
110/*
111 * This structure is returned by the driver immediately after
112 * open to get implementation-specific info, and info specific to this
113 * instance.
114 *
115 * This struct must have explicit pad fields where type sizes
116 * may result in different alignments between 32 and 64 bit
117 * programs, since the 64 bit * bit kernel requires the user code
118 * to have matching offsets
119 */
120struct hfi1_base_info {
121 /* version of hardware, for feature checking. */
122 __u32 hw_version;
123 /* version of software, for feature checking. */
124 __u32 sw_version;
125 /* Job key */
126 __u16 jkey;
127 __u16 padding1;
128 /*
129 * The special QP (queue pair) value that identifies PSM
130 * protocol packet from standard IB packets.
131 */
132 __u32 bthqp;
133 /* PIO credit return address, */
134 __aligned_u64 sc_credits_addr;
135 /*
136 * Base address of write-only pio buffers for this process.
137 * Each buffer has sendpio_credits*64 bytes.
138 */
139 __aligned_u64 pio_bufbase_sop;
140 /*
141 * Base address of write-only pio buffers for this process.
142 * Each buffer has sendpio_credits*64 bytes.
143 */
144 __aligned_u64 pio_bufbase;
145 /* address where receive buffer queue is mapped into */
146 __aligned_u64 rcvhdr_bufbase;
147 /* base address of Eager receive buffers. */
148 __aligned_u64 rcvegr_bufbase;
149 /* base address of SDMA completion ring */
150 __aligned_u64 sdma_comp_bufbase;
151 /*
152 * User register base for init code, not to be used directly by
153 * protocol or applications. Always maps real chip register space.
154 * the register addresses are:
155 * ur_rcvhdrhead, ur_rcvhdrtail, ur_rcvegrhead, ur_rcvegrtail,
156 * ur_rcvtidflow
157 */
158 __aligned_u64 user_regbase;
159 /* notification events */
160 __aligned_u64 events_bufbase;
161 /* status page */
162 __aligned_u64 status_bufbase;
163 /* rcvhdrtail update */
164 __aligned_u64 rcvhdrtail_base;
165 /*
166 * shared memory pages for subctxts if ctxt is shared; these cover
167 * all the processes in the group sharing a single context.
168 * all have enough space for the num_subcontexts value on this job.
169 */
170 __aligned_u64 subctxt_uregbase;
171 __aligned_u64 subctxt_rcvegrbuf;
172 __aligned_u64 subctxt_rcvhdrbuf;
173};
174#endif /* _LINIUX__HFI1_IOCTL_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/hfi/hfi1_user.h deleted-267
...@@ -1,267 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * Copyright(c) 2015 Intel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * BSD LICENSE
21 *
22 * Copyright(c) 2015 Intel Corporation.
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 *
28 * - Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * - Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in
32 * the documentation and/or other materials provided with the
33 * distribution.
34 * - Neither the name of Intel Corporation nor the names of its
35 * contributors may be used to endorse or promote products derived
36 * from this software without specific prior written permission.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
42 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 *
50 */
51
52/*
53 * This file contains defines, structures, etc. that are used
54 * to communicate between kernel and user code.
55 */
56
57#ifndef _LINUX__HFI1_USER_H
58#define _LINUX__HFI1_USER_H
59
60#include <linux/types.h>
61#include <rdma/rdma_user_ioctl.h>
62
63/*
64 * This version number is given to the driver by the user code during
65 * initialization in the spu_userversion field of hfi1_user_info, so
66 * the driver can check for compatibility with user code.
67 *
68 * The major version changes when data structures change in an incompatible
69 * way. The driver must be the same for initialization to succeed.
70 */
71#define HFI1_USER_SWMAJOR 6
72
73/*
74 * Minor version differences are always compatible
75 * a within a major version, however if user software is larger
76 * than driver software, some new features and/or structure fields
77 * may not be implemented; the user code must deal with this if it
78 * cares, or it must abort after initialization reports the difference.
79 */
80#define HFI1_USER_SWMINOR 3
81
82/*
83 * We will encode the major/minor inside a single 32bit version number.
84 */
85#define HFI1_SWMAJOR_SHIFT 16
86
87/*
88 * Set of HW and driver capability/feature bits.
89 * These bit values are used to configure enabled/disabled HW and
90 * driver features. The same set of bits are communicated to user
91 * space.
92 */
93#define HFI1_CAP_DMA_RTAIL (1UL << 0) /* Use DMA'ed RTail value */
94#define HFI1_CAP_SDMA (1UL << 1) /* Enable SDMA support */
95#define HFI1_CAP_SDMA_AHG (1UL << 2) /* Enable SDMA AHG support */
96#define HFI1_CAP_EXTENDED_PSN (1UL << 3) /* Enable Extended PSN support */
97#define HFI1_CAP_HDRSUPP (1UL << 4) /* Enable Header Suppression */
98/* 1UL << 5 unused */
99#define HFI1_CAP_USE_SDMA_HEAD (1UL << 6) /* DMA Hdr Q tail vs. use CSR */
100#define HFI1_CAP_MULTI_PKT_EGR (1UL << 7) /* Enable multi-packet Egr buffs*/
101#define HFI1_CAP_NODROP_RHQ_FULL (1UL << 8) /* Don't drop on Hdr Q full */
102#define HFI1_CAP_NODROP_EGR_FULL (1UL << 9) /* Don't drop on EGR buffs full */
103#define HFI1_CAP_TID_UNMAP (1UL << 10) /* Disable Expected TID caching */
104#define HFI1_CAP_PRINT_UNIMPL (1UL << 11) /* Show for unimplemented feats */
105#define HFI1_CAP_ALLOW_PERM_JKEY (1UL << 12) /* Allow use of permissive JKEY */
106#define HFI1_CAP_NO_INTEGRITY (1UL << 13) /* Enable ctxt integrity checks */
107#define HFI1_CAP_PKEY_CHECK (1UL << 14) /* Enable ctxt PKey checking */
108#define HFI1_CAP_STATIC_RATE_CTRL (1UL << 15) /* Allow PBC.StaticRateControl */
109/* 1UL << 16 unused */
110#define HFI1_CAP_SDMA_HEAD_CHECK (1UL << 17) /* SDMA head checking */
111#define HFI1_CAP_EARLY_CREDIT_RETURN (1UL << 18) /* early credit return */
112
113#define HFI1_RCVHDR_ENTSIZE_2 (1UL << 0)
114#define HFI1_RCVHDR_ENTSIZE_16 (1UL << 1)
115#define HFI1_RCVDHR_ENTSIZE_32 (1UL << 2)
116
117#define _HFI1_EVENT_FROZEN_BIT 0
118#define _HFI1_EVENT_LINKDOWN_BIT 1
119#define _HFI1_EVENT_LID_CHANGE_BIT 2
120#define _HFI1_EVENT_LMC_CHANGE_BIT 3
121#define _HFI1_EVENT_SL2VL_CHANGE_BIT 4
122#define _HFI1_EVENT_TID_MMU_NOTIFY_BIT 5
123#define _HFI1_MAX_EVENT_BIT _HFI1_EVENT_TID_MMU_NOTIFY_BIT
124
125#define HFI1_EVENT_FROZEN (1UL << _HFI1_EVENT_FROZEN_BIT)
126#define HFI1_EVENT_LINKDOWN (1UL << _HFI1_EVENT_LINKDOWN_BIT)
127#define HFI1_EVENT_LID_CHANGE (1UL << _HFI1_EVENT_LID_CHANGE_BIT)
128#define HFI1_EVENT_LMC_CHANGE (1UL << _HFI1_EVENT_LMC_CHANGE_BIT)
129#define HFI1_EVENT_SL2VL_CHANGE (1UL << _HFI1_EVENT_SL2VL_CHANGE_BIT)
130#define HFI1_EVENT_TID_MMU_NOTIFY (1UL << _HFI1_EVENT_TID_MMU_NOTIFY_BIT)
131
132/*
133 * These are the status bits readable (in ASCII form, 64bit value)
134 * from the "status" sysfs file. For binary compatibility, values
135 * must remain as is; removed states can be reused for different
136 * purposes.
137 */
138#define HFI1_STATUS_INITTED 0x1 /* basic initialization done */
139/* Chip has been found and initialized */
140#define HFI1_STATUS_CHIP_PRESENT 0x20
141/* IB link is at ACTIVE, usable for data traffic */
142#define HFI1_STATUS_IB_READY 0x40
143/* link is configured, LID, MTU, etc. have been set */
144#define HFI1_STATUS_IB_CONF 0x80
145/* A Fatal hardware error has occurred. */
146#define HFI1_STATUS_HWERROR 0x200
147
148/*
149 * Number of supported shared contexts.
150 * This is the maximum number of software contexts that can share
151 * a hardware send/receive context.
152 */
153#define HFI1_MAX_SHARED_CTXTS 8
154
155/*
156 * Poll types
157 */
158#define HFI1_POLL_TYPE_ANYRCV 0x0
159#define HFI1_POLL_TYPE_URGENT 0x1
160
161enum hfi1_sdma_comp_state {
162 FREE = 0,
163 QUEUED,
164 COMPLETE,
165 ERROR
166};
167
168/*
169 * SDMA completion ring entry
170 */
171struct hfi1_sdma_comp_entry {
172 __u32 status;
173 __u32 errcode;
174};
175
176/*
177 * Device status and notifications from driver to user-space.
178 */
179struct hfi1_status {
180 __aligned_u64 dev; /* device/hw status bits */
181 __aligned_u64 port; /* port state and status bits */
182 char freezemsg[0];
183};
184
185enum sdma_req_opcode {
186 EXPECTED = 0,
187 EAGER
188};
189
190#define HFI1_SDMA_REQ_VERSION_MASK 0xF
191#define HFI1_SDMA_REQ_VERSION_SHIFT 0x0
192#define HFI1_SDMA_REQ_OPCODE_MASK 0xF
193#define HFI1_SDMA_REQ_OPCODE_SHIFT 0x4
194#define HFI1_SDMA_REQ_IOVCNT_MASK 0xFF
195#define HFI1_SDMA_REQ_IOVCNT_SHIFT 0x8
196
197struct sdma_req_info {
198 /*
199 * bits 0-3 - version (currently unused)
200 * bits 4-7 - opcode (enum sdma_req_opcode)
201 * bits 8-15 - io vector count
202 */
203 __u16 ctrl;
204 /*
205 * Number of fragments contained in this request.
206 * User-space has already computed how many
207 * fragment-sized packet the user buffer will be
208 * split into.
209 */
210 __u16 npkts;
211 /*
212 * Size of each fragment the user buffer will be
213 * split into.
214 */
215 __u16 fragsize;
216 /*
217 * Index of the slot in the SDMA completion ring
218 * this request should be using. User-space is
219 * in charge of managing its own ring.
220 */
221 __u16 comp_idx;
222} __attribute__((__packed__));
223
224/*
225 * SW KDETH header.
226 * swdata is SW defined portion.
227 */
228struct hfi1_kdeth_header {
229 __le32 ver_tid_offset;
230 __le16 jkey;
231 __le16 hcrc;
232 __le32 swdata[7];
233} __attribute__((__packed__));
234
235/*
236 * Structure describing the headers that User space uses. The
237 * structure above is a subset of this one.
238 */
239struct hfi1_pkt_header {
240 __le16 pbc[4];
241 __be16 lrh[4];
242 __be32 bth[3];
243 struct hfi1_kdeth_header kdeth;
244} __attribute__((__packed__));
245
246
247/*
248 * The list of usermode accessible registers.
249 */
250enum hfi1_ureg {
251 /* (RO) DMA RcvHdr to be used next. */
252 ur_rcvhdrtail = 0,
253 /* (RW) RcvHdr entry to be processed next by host. */
254 ur_rcvhdrhead = 1,
255 /* (RO) Index of next Eager index to use. */
256 ur_rcvegrindextail = 2,
257 /* (RW) Eager TID to be processed next */
258 ur_rcvegrindexhead = 3,
259 /* (RO) Receive Eager Offset Tail */
260 ur_rcvegroffsettail = 4,
261 /* For internal use only; max register number. */
262 ur_maxreg,
263 /* (RW) Receive TID flow table */
264 ur_rcvtidflowtable = 256
265};
266
267#endif /* _LINIUX__HFI1_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/hns-abi.h deleted-72
...@@ -1,72 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2016 Hisilicon Limited.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef HNS_ABI_USER_H
35#define HNS_ABI_USER_H
36
37#include <linux/types.h>
38
39struct hns_roce_ib_create_cq {
40 __aligned_u64 buf_addr;
41 __aligned_u64 db_addr;
42};
43
44struct hns_roce_ib_create_cq_resp {
45 __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */
46 __aligned_u64 cap_flags;
47};
48
49struct hns_roce_ib_create_qp {
50 __aligned_u64 buf_addr;
51 __aligned_u64 db_addr;
52 __u8 log_sq_bb_count;
53 __u8 log_sq_stride;
54 __u8 sq_no_prefetch;
55 __u8 reserved[5];
56 __aligned_u64 sdb_addr;
57};
58
59struct hns_roce_ib_create_qp_resp {
60 __aligned_u64 cap_flags;
61};
62
63struct hns_roce_ib_alloc_ucontext_resp {
64 __u32 qp_tab_size;
65 __u32 reserved;
66};
67
68struct hns_roce_ib_alloc_pd_resp {
69 __u32 pdn;
70};
71
72#endif /* HNS_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/i40iw-abi.h deleted-107
...@@ -1,107 +0,0 @@
1/*
2 * Copyright (c) 2006 - 2016 Intel Corporation. All rights reserved.
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005 Cisco Systems. All rights reserved.
5 * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
6 *
7 * This software is available to you under a choice of one of two
8 * licenses. You may choose to be licensed under the terms of the GNU
9 * General Public License (GPL) Version 2, available from the file
10 * COPYING in the main directory of this source tree, or the
11 * OpenIB.org BSD license below:
12 *
13 * Redistribution and use in source and binary forms, with or
14 * without modification, are permitted provided that the following
15 * conditions are met:
16 *
17 * - Redistributions of source code must retain the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer.
20 *
21 * - Redistributions in binary form must reproduce the above
22 * copyright notice, this list of conditions and the following
23 * disclaimer in the documentation and/or other materials
24 * provided with the distribution.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 * SOFTWARE.
34 *
35 */
36
37#ifndef I40IW_ABI_H
38#define I40IW_ABI_H
39
40#include <linux/types.h>
41
42#define I40IW_ABI_VER 5
43
44struct i40iw_alloc_ucontext_req {
45 __u32 reserved32;
46 __u8 userspace_ver;
47 __u8 reserved8[3];
48};
49
50struct i40iw_alloc_ucontext_resp {
51 __u32 max_pds; /* maximum pds allowed for this user process */
52 __u32 max_qps; /* maximum qps allowed for this user process */
53 __u32 wq_size; /* size of the WQs (sq+rq) allocated to the mmaped area */
54 __u8 kernel_ver;
55 __u8 reserved[3];
56};
57
58struct i40iw_alloc_pd_resp {
59 __u32 pd_id;
60 __u8 reserved[4];
61};
62
63struct i40iw_create_cq_req {
64 __aligned_u64 user_cq_buffer;
65 __aligned_u64 user_shadow_area;
66};
67
68struct i40iw_create_qp_req {
69 __aligned_u64 user_wqe_buffers;
70 __aligned_u64 user_compl_ctx;
71
72 /* UDA QP PHB */
73 __aligned_u64 user_sq_phb; /* place for VA of the sq phb buff */
74 __aligned_u64 user_rq_phb; /* place for VA of the rq phb buff */
75};
76
77enum i40iw_memreg_type {
78 IW_MEMREG_TYPE_MEM = 0x0000,
79 IW_MEMREG_TYPE_QP = 0x0001,
80 IW_MEMREG_TYPE_CQ = 0x0002,
81};
82
83struct i40iw_mem_reg_req {
84 __u16 reg_type; /* Memory, QP or CQ */
85 __u16 cq_pages;
86 __u16 rq_pages;
87 __u16 sq_pages;
88};
89
90struct i40iw_create_cq_resp {
91 __u32 cq_id;
92 __u32 cq_size;
93 __u32 mmap_db_index;
94 __u32 reserved;
95};
96
97struct i40iw_create_qp_resp {
98 __u32 qp_id;
99 __u32 actual_sq_size;
100 __u32 actual_rq_size;
101 __u32 i40iw_drv_opt;
102 __u16 push_idx;
103 __u8 lsmm;
104 __u8 rsvd2;
105};
106
107#endif
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ib_user_cm.h deleted-326
...@@ -1,326 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005 Intel Corporation. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef IB_USER_CM_H
36#define IB_USER_CM_H
37
38#include <linux/types.h>
39#include <rdma/ib_user_sa.h>
40
41#define IB_USER_CM_ABI_VERSION 5
42
43enum {
44 IB_USER_CM_CMD_CREATE_ID,
45 IB_USER_CM_CMD_DESTROY_ID,
46 IB_USER_CM_CMD_ATTR_ID,
47
48 IB_USER_CM_CMD_LISTEN,
49 IB_USER_CM_CMD_NOTIFY,
50
51 IB_USER_CM_CMD_SEND_REQ,
52 IB_USER_CM_CMD_SEND_REP,
53 IB_USER_CM_CMD_SEND_RTU,
54 IB_USER_CM_CMD_SEND_DREQ,
55 IB_USER_CM_CMD_SEND_DREP,
56 IB_USER_CM_CMD_SEND_REJ,
57 IB_USER_CM_CMD_SEND_MRA,
58 IB_USER_CM_CMD_SEND_LAP,
59 IB_USER_CM_CMD_SEND_APR,
60 IB_USER_CM_CMD_SEND_SIDR_REQ,
61 IB_USER_CM_CMD_SEND_SIDR_REP,
62
63 IB_USER_CM_CMD_EVENT,
64 IB_USER_CM_CMD_INIT_QP_ATTR,
65};
66/*
67 * command ABI structures.
68 */
69struct ib_ucm_cmd_hdr {
70 __u32 cmd;
71 __u16 in;
72 __u16 out;
73};
74
75struct ib_ucm_create_id {
76 __aligned_u64 uid;
77 __aligned_u64 response;
78};
79
80struct ib_ucm_create_id_resp {
81 __u32 id;
82};
83
84struct ib_ucm_destroy_id {
85 __aligned_u64 response;
86 __u32 id;
87 __u32 reserved;
88};
89
90struct ib_ucm_destroy_id_resp {
91 __u32 events_reported;
92};
93
94struct ib_ucm_attr_id {
95 __aligned_u64 response;
96 __u32 id;
97 __u32 reserved;
98};
99
100struct ib_ucm_attr_id_resp {
101 __be64 service_id;
102 __be64 service_mask;
103 __be32 local_id;
104 __be32 remote_id;
105};
106
107struct ib_ucm_init_qp_attr {
108 __aligned_u64 response;
109 __u32 id;
110 __u32 qp_state;
111};
112
113struct ib_ucm_listen {
114 __be64 service_id;
115 __be64 service_mask;
116 __u32 id;
117 __u32 reserved;
118};
119
120struct ib_ucm_notify {
121 __u32 id;
122 __u32 event;
123};
124
125struct ib_ucm_private_data {
126 __aligned_u64 data;
127 __u32 id;
128 __u8 len;
129 __u8 reserved[3];
130};
131
132struct ib_ucm_req {
133 __u32 id;
134 __u32 qpn;
135 __u32 qp_type;
136 __u32 psn;
137 __be64 sid;
138 __aligned_u64 data;
139 __aligned_u64 primary_path;
140 __aligned_u64 alternate_path;
141 __u8 len;
142 __u8 peer_to_peer;
143 __u8 responder_resources;
144 __u8 initiator_depth;
145 __u8 remote_cm_response_timeout;
146 __u8 flow_control;
147 __u8 local_cm_response_timeout;
148 __u8 retry_count;
149 __u8 rnr_retry_count;
150 __u8 max_cm_retries;
151 __u8 srq;
152 __u8 reserved[5];
153};
154
155struct ib_ucm_rep {
156 __aligned_u64 uid;
157 __aligned_u64 data;
158 __u32 id;
159 __u32 qpn;
160 __u32 psn;
161 __u8 len;
162 __u8 responder_resources;
163 __u8 initiator_depth;
164 __u8 target_ack_delay;
165 __u8 failover_accepted;
166 __u8 flow_control;
167 __u8 rnr_retry_count;
168 __u8 srq;
169 __u8 reserved[4];
170};
171
172struct ib_ucm_info {
173 __u32 id;
174 __u32 status;
175 __aligned_u64 info;
176 __aligned_u64 data;
177 __u8 info_len;
178 __u8 data_len;
179 __u8 reserved[6];
180};
181
182struct ib_ucm_mra {
183 __aligned_u64 data;
184 __u32 id;
185 __u8 len;
186 __u8 timeout;
187 __u8 reserved[2];
188};
189
190struct ib_ucm_lap {
191 __aligned_u64 path;
192 __aligned_u64 data;
193 __u32 id;
194 __u8 len;
195 __u8 reserved[3];
196};
197
198struct ib_ucm_sidr_req {
199 __u32 id;
200 __u32 timeout;
201 __be64 sid;
202 __aligned_u64 data;
203 __aligned_u64 path;
204 __u16 reserved_pkey;
205 __u8 len;
206 __u8 max_cm_retries;
207 __u8 reserved[4];
208};
209
210struct ib_ucm_sidr_rep {
211 __u32 id;
212 __u32 qpn;
213 __u32 qkey;
214 __u32 status;
215 __aligned_u64 info;
216 __aligned_u64 data;
217 __u8 info_len;
218 __u8 data_len;
219 __u8 reserved[6];
220};
221/*
222 * event notification ABI structures.
223 */
224struct ib_ucm_event_get {
225 __aligned_u64 response;
226 __aligned_u64 data;
227 __aligned_u64 info;
228 __u8 data_len;
229 __u8 info_len;
230 __u8 reserved[6];
231};
232
233struct ib_ucm_req_event_resp {
234 struct ib_user_path_rec primary_path;
235 struct ib_user_path_rec alternate_path;
236 __be64 remote_ca_guid;
237 __u32 remote_qkey;
238 __u32 remote_qpn;
239 __u32 qp_type;
240 __u32 starting_psn;
241 __u8 responder_resources;
242 __u8 initiator_depth;
243 __u8 local_cm_response_timeout;
244 __u8 flow_control;
245 __u8 remote_cm_response_timeout;
246 __u8 retry_count;
247 __u8 rnr_retry_count;
248 __u8 srq;
249 __u8 port;
250 __u8 reserved[7];
251};
252
253struct ib_ucm_rep_event_resp {
254 __be64 remote_ca_guid;
255 __u32 remote_qkey;
256 __u32 remote_qpn;
257 __u32 starting_psn;
258 __u8 responder_resources;
259 __u8 initiator_depth;
260 __u8 target_ack_delay;
261 __u8 failover_accepted;
262 __u8 flow_control;
263 __u8 rnr_retry_count;
264 __u8 srq;
265 __u8 reserved[5];
266};
267
268struct ib_ucm_rej_event_resp {
269 __u32 reason;
270 /* ari in ib_ucm_event_get info field. */
271};
272
273struct ib_ucm_mra_event_resp {
274 __u8 timeout;
275 __u8 reserved[3];
276};
277
278struct ib_ucm_lap_event_resp {
279 struct ib_user_path_rec path;
280};
281
282struct ib_ucm_apr_event_resp {
283 __u32 status;
284 /* apr info in ib_ucm_event_get info field. */
285};
286
287struct ib_ucm_sidr_req_event_resp {
288 __u16 pkey;
289 __u8 port;
290 __u8 reserved;
291};
292
293struct ib_ucm_sidr_rep_event_resp {
294 __u32 status;
295 __u32 qkey;
296 __u32 qpn;
297 /* info in ib_ucm_event_get info field. */
298};
299
300#define IB_UCM_PRES_DATA 0x01
301#define IB_UCM_PRES_INFO 0x02
302#define IB_UCM_PRES_PRIMARY 0x04
303#define IB_UCM_PRES_ALTERNATE 0x08
304
305struct ib_ucm_event_resp {
306 __aligned_u64 uid;
307 __u32 id;
308 __u32 event;
309 __u32 present;
310 __u32 reserved;
311 union {
312 struct ib_ucm_req_event_resp req_resp;
313 struct ib_ucm_rep_event_resp rep_resp;
314 struct ib_ucm_rej_event_resp rej_resp;
315 struct ib_ucm_mra_event_resp mra_resp;
316 struct ib_ucm_lap_event_resp lap_resp;
317 struct ib_ucm_apr_event_resp apr_resp;
318
319 struct ib_ucm_sidr_req_event_resp sidr_req_resp;
320 struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
321
322 __u32 send_status;
323 } u;
324};
325
326#endif /* IB_USER_CM_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ib_user_ioctl_cmds.h deleted-160
...@@ -1,160 +0,0 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef IB_USER_IOCTL_CMDS_H
34#define IB_USER_IOCTL_CMDS_H
35
36#define UVERBS_ID_NS_MASK 0xF000
37#define UVERBS_ID_NS_SHIFT 12
38
39#define UVERBS_UDATA_DRIVER_DATA_NS 1
40#define UVERBS_UDATA_DRIVER_DATA_FLAG (1UL << UVERBS_ID_NS_SHIFT)
41
42enum uverbs_default_objects {
43 UVERBS_OBJECT_DEVICE, /* No instances of DEVICE are allowed */
44 UVERBS_OBJECT_PD,
45 UVERBS_OBJECT_COMP_CHANNEL,
46 UVERBS_OBJECT_CQ,
47 UVERBS_OBJECT_QP,
48 UVERBS_OBJECT_SRQ,
49 UVERBS_OBJECT_AH,
50 UVERBS_OBJECT_MR,
51 UVERBS_OBJECT_MW,
52 UVERBS_OBJECT_FLOW,
53 UVERBS_OBJECT_XRCD,
54 UVERBS_OBJECT_RWQ_IND_TBL,
55 UVERBS_OBJECT_WQ,
56 UVERBS_OBJECT_FLOW_ACTION,
57 UVERBS_OBJECT_DM,
58 UVERBS_OBJECT_COUNTERS,
59};
60
61enum {
62 UVERBS_ATTR_UHW_IN = UVERBS_UDATA_DRIVER_DATA_FLAG,
63 UVERBS_ATTR_UHW_OUT,
64};
65
66enum uverbs_attrs_create_cq_cmd_attr_ids {
67 UVERBS_ATTR_CREATE_CQ_HANDLE,
68 UVERBS_ATTR_CREATE_CQ_CQE,
69 UVERBS_ATTR_CREATE_CQ_USER_HANDLE,
70 UVERBS_ATTR_CREATE_CQ_COMP_CHANNEL,
71 UVERBS_ATTR_CREATE_CQ_COMP_VECTOR,
72 UVERBS_ATTR_CREATE_CQ_FLAGS,
73 UVERBS_ATTR_CREATE_CQ_RESP_CQE,
74};
75
76enum uverbs_attrs_destroy_cq_cmd_attr_ids {
77 UVERBS_ATTR_DESTROY_CQ_HANDLE,
78 UVERBS_ATTR_DESTROY_CQ_RESP,
79};
80
81enum uverbs_attrs_create_flow_action_esp {
82 UVERBS_ATTR_CREATE_FLOW_ACTION_ESP_HANDLE,
83 UVERBS_ATTR_FLOW_ACTION_ESP_ATTRS,
84 UVERBS_ATTR_FLOW_ACTION_ESP_ESN,
85 UVERBS_ATTR_FLOW_ACTION_ESP_KEYMAT,
86 UVERBS_ATTR_FLOW_ACTION_ESP_REPLAY,
87 UVERBS_ATTR_FLOW_ACTION_ESP_ENCAP,
88};
89
90enum uverbs_attrs_modify_flow_action_esp {
91 UVERBS_ATTR_MODIFY_FLOW_ACTION_ESP_HANDLE =
92 UVERBS_ATTR_CREATE_FLOW_ACTION_ESP_HANDLE,
93};
94
95enum uverbs_attrs_destroy_flow_action_esp {
96 UVERBS_ATTR_DESTROY_FLOW_ACTION_HANDLE,
97};
98
99enum uverbs_methods_cq {
100 UVERBS_METHOD_CQ_CREATE,
101 UVERBS_METHOD_CQ_DESTROY,
102};
103
104enum uverbs_methods_actions_flow_action_ops {
105 UVERBS_METHOD_FLOW_ACTION_ESP_CREATE,
106 UVERBS_METHOD_FLOW_ACTION_DESTROY,
107 UVERBS_METHOD_FLOW_ACTION_ESP_MODIFY,
108};
109
110enum uverbs_attrs_alloc_dm_cmd_attr_ids {
111 UVERBS_ATTR_ALLOC_DM_HANDLE,
112 UVERBS_ATTR_ALLOC_DM_LENGTH,
113 UVERBS_ATTR_ALLOC_DM_ALIGNMENT,
114};
115
116enum uverbs_attrs_free_dm_cmd_attr_ids {
117 UVERBS_ATTR_FREE_DM_HANDLE,
118};
119
120enum uverbs_methods_dm {
121 UVERBS_METHOD_DM_ALLOC,
122 UVERBS_METHOD_DM_FREE,
123};
124
125enum uverbs_attrs_reg_dm_mr_cmd_attr_ids {
126 UVERBS_ATTR_REG_DM_MR_HANDLE,
127 UVERBS_ATTR_REG_DM_MR_OFFSET,
128 UVERBS_ATTR_REG_DM_MR_LENGTH,
129 UVERBS_ATTR_REG_DM_MR_PD_HANDLE,
130 UVERBS_ATTR_REG_DM_MR_ACCESS_FLAGS,
131 UVERBS_ATTR_REG_DM_MR_DM_HANDLE,
132 UVERBS_ATTR_REG_DM_MR_RESP_LKEY,
133 UVERBS_ATTR_REG_DM_MR_RESP_RKEY,
134};
135
136enum uverbs_methods_mr {
137 UVERBS_METHOD_DM_MR_REG,
138};
139
140enum uverbs_attrs_create_counters_cmd_attr_ids {
141 UVERBS_ATTR_CREATE_COUNTERS_HANDLE,
142};
143
144enum uverbs_attrs_destroy_counters_cmd_attr_ids {
145 UVERBS_ATTR_DESTROY_COUNTERS_HANDLE,
146};
147
148enum uverbs_attrs_read_counters_cmd_attr_ids {
149 UVERBS_ATTR_READ_COUNTERS_HANDLE,
150 UVERBS_ATTR_READ_COUNTERS_BUFF,
151 UVERBS_ATTR_READ_COUNTERS_FLAGS,
152};
153
154enum uverbs_methods_actions_counters_ops {
155 UVERBS_METHOD_COUNTERS_CREATE,
156 UVERBS_METHOD_COUNTERS_DESTROY,
157 UVERBS_METHOD_COUNTERS_READ,
158};
159
160#endif
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ib_user_ioctl_verbs.h deleted-160
...@@ -1,160 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2017-2018, Mellanox Technologies inc. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef IB_USER_IOCTL_VERBS_H
35#define IB_USER_IOCTL_VERBS_H
36
37#include <linux/types.h>
38
39#ifndef RDMA_UAPI_PTR
40#define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name
41#endif
42
43enum ib_uverbs_access_flags {
44 IB_UVERBS_ACCESS_LOCAL_WRITE = 1 << 0,
45 IB_UVERBS_ACCESS_REMOTE_WRITE = 1 << 1,
46 IB_UVERBS_ACCESS_REMOTE_READ = 1 << 2,
47 IB_UVERBS_ACCESS_REMOTE_ATOMIC = 1 << 3,
48 IB_UVERBS_ACCESS_MW_BIND = 1 << 4,
49 IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,
50 IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,
51 IB_UVERBS_ACCESS_HUGETLB = 1 << 7,
52};
53
54enum ib_uverbs_query_port_cap_flags {
55 IB_UVERBS_PCF_SM = 1 << 1,
56 IB_UVERBS_PCF_NOTICE_SUP = 1 << 2,
57 IB_UVERBS_PCF_TRAP_SUP = 1 << 3,
58 IB_UVERBS_PCF_OPT_IPD_SUP = 1 << 4,
59 IB_UVERBS_PCF_AUTO_MIGR_SUP = 1 << 5,
60 IB_UVERBS_PCF_SL_MAP_SUP = 1 << 6,
61 IB_UVERBS_PCF_MKEY_NVRAM = 1 << 7,
62 IB_UVERBS_PCF_PKEY_NVRAM = 1 << 8,
63 IB_UVERBS_PCF_LED_INFO_SUP = 1 << 9,
64 IB_UVERBS_PCF_SM_DISABLED = 1 << 10,
65 IB_UVERBS_PCF_SYS_IMAGE_GUID_SUP = 1 << 11,
66 IB_UVERBS_PCF_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
67 IB_UVERBS_PCF_EXTENDED_SPEEDS_SUP = 1 << 14,
68 IB_UVERBS_PCF_CM_SUP = 1 << 16,
69 IB_UVERBS_PCF_SNMP_TUNNEL_SUP = 1 << 17,
70 IB_UVERBS_PCF_REINIT_SUP = 1 << 18,
71 IB_UVERBS_PCF_DEVICE_MGMT_SUP = 1 << 19,
72 IB_UVERBS_PCF_VENDOR_CLASS_SUP = 1 << 20,
73 IB_UVERBS_PCF_DR_NOTICE_SUP = 1 << 21,
74 IB_UVERBS_PCF_CAP_MASK_NOTICE_SUP = 1 << 22,
75 IB_UVERBS_PCF_BOOT_MGMT_SUP = 1 << 23,
76 IB_UVERBS_PCF_LINK_LATENCY_SUP = 1 << 24,
77 IB_UVERBS_PCF_CLIENT_REG_SUP = 1 << 25,
78 /*
79 * IsOtherLocalChangesNoticeSupported is aliased by IP_BASED_GIDS and
80 * is inaccessible
81 */
82 IB_UVERBS_PCF_LINK_SPEED_WIDTH_TABLE_SUP = 1 << 27,
83 IB_UVERBS_PCF_VENDOR_SPECIFIC_MADS_TABLE_SUP = 1 << 28,
84 IB_UVERBS_PCF_MCAST_PKEY_TRAP_SUPPRESSION_SUP = 1 << 29,
85 IB_UVERBS_PCF_MCAST_FDB_TOP_SUP = 1 << 30,
86 IB_UVERBS_PCF_HIERARCHY_INFO_SUP = 1ULL << 31,
87
88 /* NOTE this is an internal flag, not an IBA flag */
89 IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,
90};
91
92enum ib_uverbs_query_port_flags {
93 IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,
94};
95
96enum ib_uverbs_flow_action_esp_keymat {
97 IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,
98};
99
100enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {
101 IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,
102};
103
104struct ib_uverbs_flow_action_esp_keymat_aes_gcm {
105 __aligned_u64 iv;
106 __u32 iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */
107
108 __u32 salt;
109 __u32 icv_len;
110
111 __u32 key_len;
112 __u32 aes_key[256 / 32];
113};
114
115enum ib_uverbs_flow_action_esp_replay {
116 IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,
117 IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,
118};
119
120struct ib_uverbs_flow_action_esp_replay_bmp {
121 __u32 size;
122};
123
124enum ib_uverbs_flow_action_esp_flags {
125 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO = 0UL << 0, /* Default */
126 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD = 1UL << 0,
127
128 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL = 0UL << 1, /* Default */
129 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT = 1UL << 1,
130
131 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT = 0UL << 2, /* Default */
132 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT = 1UL << 2,
133
134 IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW = 1UL << 3,
135};
136
137struct ib_uverbs_flow_action_esp_encap {
138 /* This struct represents a list of pointers to flow_xxxx_filter that
139 * encapsulates the payload in ESP tunnel mode.
140 */
141 RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */
142 RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);
143 __u16 len; /* Len of the filter struct val_ptr points to */
144 __u16 type; /* Use flow_spec_type enum */
145};
146
147struct ib_uverbs_flow_action_esp {
148 __u32 spi;
149 __u32 seq;
150 __u32 tfc_pad;
151 __u32 flags;
152 __aligned_u64 hard_limit_pkts;
153};
154
155enum ib_uverbs_read_counters_flags {
156 /* prefer read values from driver cache */
157 IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,
158};
159
160#endif
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ib_user_mad.h deleted-234
...@@ -1,234 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2004 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef IB_USER_MAD_H
36#define IB_USER_MAD_H
37
38#include <linux/types.h>
39#include <rdma/rdma_user_ioctl.h>
40
41/*
42 * Increment this value if any changes that break userspace ABI
43 * compatibility are made.
44 */
45#define IB_USER_MAD_ABI_VERSION 5
46
47/*
48 * Make sure that all structs defined in this file remain laid out so
49 * that they pack the same way on 32-bit and 64-bit architectures (to
50 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
51 */
52
53/**
54 * ib_user_mad_hdr_old - Old version of MAD packet header without pkey_index
55 * @id - ID of agent MAD received with/to be sent with
56 * @status - 0 on successful receive, ETIMEDOUT if no response
57 * received (transaction ID in data[] will be set to TID of original
58 * request) (ignored on send)
59 * @timeout_ms - Milliseconds to wait for response (unset on receive)
60 * @retries - Number of automatic retries to attempt
61 * @qpn - Remote QP number received from/to be sent to
62 * @qkey - Remote Q_Key to be sent with (unset on receive)
63 * @lid - Remote lid received from/to be sent to
64 * @sl - Service level received with/to be sent with
65 * @path_bits - Local path bits received with/to be sent with
66 * @grh_present - If set, GRH was received/should be sent
67 * @gid_index - Local GID index to send with (unset on receive)
68 * @hop_limit - Hop limit in GRH
69 * @traffic_class - Traffic class in GRH
70 * @gid - Remote GID in GRH
71 * @flow_label - Flow label in GRH
72 */
73struct ib_user_mad_hdr_old {
74 __u32 id;
75 __u32 status;
76 __u32 timeout_ms;
77 __u32 retries;
78 __u32 length;
79 __be32 qpn;
80 __be32 qkey;
81 __be16 lid;
82 __u8 sl;
83 __u8 path_bits;
84 __u8 grh_present;
85 __u8 gid_index;
86 __u8 hop_limit;
87 __u8 traffic_class;
88 __u8 gid[16];
89 __be32 flow_label;
90};
91
92/**
93 * ib_user_mad_hdr - MAD packet header
94 * This layout allows specifying/receiving the P_Key index. To use
95 * this capability, an application must call the
96 * IB_USER_MAD_ENABLE_PKEY ioctl on the user MAD file handle before
97 * any other actions with the file handle.
98 * @id - ID of agent MAD received with/to be sent with
99 * @status - 0 on successful receive, ETIMEDOUT if no response
100 * received (transaction ID in data[] will be set to TID of original
101 * request) (ignored on send)
102 * @timeout_ms - Milliseconds to wait for response (unset on receive)
103 * @retries - Number of automatic retries to attempt
104 * @qpn - Remote QP number received from/to be sent to
105 * @qkey - Remote Q_Key to be sent with (unset on receive)
106 * @lid - Remote lid received from/to be sent to
107 * @sl - Service level received with/to be sent with
108 * @path_bits - Local path bits received with/to be sent with
109 * @grh_present - If set, GRH was received/should be sent
110 * @gid_index - Local GID index to send with (unset on receive)
111 * @hop_limit - Hop limit in GRH
112 * @traffic_class - Traffic class in GRH
113 * @gid - Remote GID in GRH
114 * @flow_label - Flow label in GRH
115 * @pkey_index - P_Key index
116 */
117struct ib_user_mad_hdr {
118 __u32 id;
119 __u32 status;
120 __u32 timeout_ms;
121 __u32 retries;
122 __u32 length;
123 __be32 qpn;
124 __be32 qkey;
125 __be16 lid;
126 __u8 sl;
127 __u8 path_bits;
128 __u8 grh_present;
129 __u8 gid_index;
130 __u8 hop_limit;
131 __u8 traffic_class;
132 __u8 gid[16];
133 __be32 flow_label;
134 __u16 pkey_index;
135 __u8 reserved[6];
136};
137
138/**
139 * ib_user_mad - MAD packet
140 * @hdr - MAD packet header
141 * @data - Contents of MAD
142 *
143 */
144struct ib_user_mad {
145 struct ib_user_mad_hdr hdr;
146 __aligned_u64 data[0];
147};
148
149/*
150 * Earlier versions of this interface definition declared the
151 * method_mask[] member as an array of __u32 but treated it as a
152 * bitmap made up of longs in the kernel. This ambiguity meant that
153 * 32-bit big-endian applications that can run on both 32-bit and
154 * 64-bit kernels had no consistent ABI to rely on, and 64-bit
155 * big-endian applications that treated method_mask as being made up
156 * of 32-bit words would have their bitmap misinterpreted.
157 *
158 * To clear up this confusion, we change the declaration of
159 * method_mask[] to use unsigned long and handle the conversion from
160 * 32-bit userspace to 64-bit kernel for big-endian systems in the
161 * compat_ioctl method. Unfortunately, to keep the structure layout
162 * the same, we need the method_mask[] array to be aligned only to 4
163 * bytes even when long is 64 bits, which forces us into this ugly
164 * typedef.
165 */
166typedef unsigned long __attribute__((aligned(4))) packed_ulong;
167#define IB_USER_MAD_LONGS_PER_METHOD_MASK (128 / (8 * sizeof (long)))
168
169/**
170 * ib_user_mad_reg_req - MAD registration request
171 * @id - Set by the kernel; used to identify agent in future requests.
172 * @qpn - Queue pair number; must be 0 or 1.
173 * @method_mask - The caller will receive unsolicited MADs for any method
174 * where @method_mask = 1.
175 * @mgmt_class - Indicates which management class of MADs should be receive
176 * by the caller. This field is only required if the user wishes to
177 * receive unsolicited MADs, otherwise it should be 0.
178 * @mgmt_class_version - Indicates which version of MADs for the given
179 * management class to receive.
180 * @oui: Indicates IEEE OUI when mgmt_class is a vendor class
181 * in the range from 0x30 to 0x4f. Otherwise not used.
182 * @rmpp_version: If set, indicates the RMPP version used.
183 *
184 */
185struct ib_user_mad_reg_req {
186 __u32 id;
187 packed_ulong method_mask[IB_USER_MAD_LONGS_PER_METHOD_MASK];
188 __u8 qpn;
189 __u8 mgmt_class;
190 __u8 mgmt_class_version;
191 __u8 oui[3];
192 __u8 rmpp_version;
193};
194
195/**
196 * ib_user_mad_reg_req2 - MAD registration request
197 *
198 * @id - Set by the _kernel_; used by userspace to identify the
199 * registered agent in future requests.
200 * @qpn - Queue pair number; must be 0 or 1.
201 * @mgmt_class - Indicates which management class of MADs should be
202 * receive by the caller. This field is only required if
203 * the user wishes to receive unsolicited MADs, otherwise
204 * it should be 0.
205 * @mgmt_class_version - Indicates which version of MADs for the given
206 * management class to receive.
207 * @res - Ignored.
208 * @flags - additional registration flags; Must be in the set of
209 * flags defined in IB_USER_MAD_REG_FLAGS_CAP
210 * @method_mask - The caller wishes to receive unsolicited MADs for the
211 * methods whose bit(s) is(are) set.
212 * @oui - Indicates IEEE OUI to use when mgmt_class is a vendor
213 * class in the range from 0x30 to 0x4f. Otherwise not
214 * used.
215 * @rmpp_version - If set, indicates the RMPP version to use.
216 */
217enum {
218 IB_USER_MAD_USER_RMPP = (1 << 0),
219};
220#define IB_USER_MAD_REG_FLAGS_CAP (IB_USER_MAD_USER_RMPP)
221struct ib_user_mad_reg_req2 {
222 __u32 id;
223 __u32 qpn;
224 __u8 mgmt_class;
225 __u8 mgmt_class_version;
226 __u16 res;
227 __u32 flags;
228 __aligned_u64 method_mask[2];
229 __u32 oui;
230 __u8 rmpp_version;
231 __u8 reserved[3];
232};
233
234#endif /* IB_USER_MAD_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ib_user_sa.h deleted-77
...@@ -1,77 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef IB_USER_SA_H
35#define IB_USER_SA_H
36
37#include <linux/types.h>
38
39enum {
40 IB_PATH_GMP = 1,
41 IB_PATH_PRIMARY = (1<<1),
42 IB_PATH_ALTERNATE = (1<<2),
43 IB_PATH_OUTBOUND = (1<<3),
44 IB_PATH_INBOUND = (1<<4),
45 IB_PATH_INBOUND_REVERSE = (1<<5),
46 IB_PATH_BIDIRECTIONAL = IB_PATH_OUTBOUND | IB_PATH_INBOUND_REVERSE
47};
48
49struct ib_path_rec_data {
50 __u32 flags;
51 __u32 reserved;
52 __u32 path_rec[16];
53};
54
55struct ib_user_path_rec {
56 __u8 dgid[16];
57 __u8 sgid[16];
58 __be16 dlid;
59 __be16 slid;
60 __u32 raw_traffic;
61 __be32 flow_label;
62 __u32 reversible;
63 __u32 mtu;
64 __be16 pkey;
65 __u8 hop_limit;
66 __u8 traffic_class;
67 __u8 numb_path;
68 __u8 sl;
69 __u8 mtu_selector;
70 __u8 rate_selector;
71 __u8 rate;
72 __u8 packet_life_time_selector;
73 __u8 packet_life_time;
74 __u8 preference;
75};
76
77#endif /* IB_USER_SA_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ib_user_verbs.h deleted-1292
...@@ -1,1292 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
5 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
6 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
7 *
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * OpenIB.org BSD license below:
13 *
14 * Redistribution and use in source and binary forms, with or
15 * without modification, are permitted provided that the following
16 * conditions are met:
17 *
18 * - Redistributions of source code must retain the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer.
21 *
22 * - Redistributions in binary form must reproduce the above
23 * copyright notice, this list of conditions and the following
24 * disclaimer in the documentation and/or other materials
25 * provided with the distribution.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
31 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
32 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
33 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 * SOFTWARE.
35 */
36
37#ifndef IB_USER_VERBS_H
38#define IB_USER_VERBS_H
39
40#include <linux/types.h>
41
42/*
43 * Increment this value if any changes that break userspace ABI
44 * compatibility are made.
45 */
46#define IB_USER_VERBS_ABI_VERSION 6
47#define IB_USER_VERBS_CMD_THRESHOLD 50
48
49enum {
50 IB_USER_VERBS_CMD_GET_CONTEXT,
51 IB_USER_VERBS_CMD_QUERY_DEVICE,
52 IB_USER_VERBS_CMD_QUERY_PORT,
53 IB_USER_VERBS_CMD_ALLOC_PD,
54 IB_USER_VERBS_CMD_DEALLOC_PD,
55 IB_USER_VERBS_CMD_CREATE_AH,
56 IB_USER_VERBS_CMD_MODIFY_AH,
57 IB_USER_VERBS_CMD_QUERY_AH,
58 IB_USER_VERBS_CMD_DESTROY_AH,
59 IB_USER_VERBS_CMD_REG_MR,
60 IB_USER_VERBS_CMD_REG_SMR,
61 IB_USER_VERBS_CMD_REREG_MR,
62 IB_USER_VERBS_CMD_QUERY_MR,
63 IB_USER_VERBS_CMD_DEREG_MR,
64 IB_USER_VERBS_CMD_ALLOC_MW,
65 IB_USER_VERBS_CMD_BIND_MW,
66 IB_USER_VERBS_CMD_DEALLOC_MW,
67 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
68 IB_USER_VERBS_CMD_CREATE_CQ,
69 IB_USER_VERBS_CMD_RESIZE_CQ,
70 IB_USER_VERBS_CMD_DESTROY_CQ,
71 IB_USER_VERBS_CMD_POLL_CQ,
72 IB_USER_VERBS_CMD_PEEK_CQ,
73 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
74 IB_USER_VERBS_CMD_CREATE_QP,
75 IB_USER_VERBS_CMD_QUERY_QP,
76 IB_USER_VERBS_CMD_MODIFY_QP,
77 IB_USER_VERBS_CMD_DESTROY_QP,
78 IB_USER_VERBS_CMD_POST_SEND,
79 IB_USER_VERBS_CMD_POST_RECV,
80 IB_USER_VERBS_CMD_ATTACH_MCAST,
81 IB_USER_VERBS_CMD_DETACH_MCAST,
82 IB_USER_VERBS_CMD_CREATE_SRQ,
83 IB_USER_VERBS_CMD_MODIFY_SRQ,
84 IB_USER_VERBS_CMD_QUERY_SRQ,
85 IB_USER_VERBS_CMD_DESTROY_SRQ,
86 IB_USER_VERBS_CMD_POST_SRQ_RECV,
87 IB_USER_VERBS_CMD_OPEN_XRCD,
88 IB_USER_VERBS_CMD_CLOSE_XRCD,
89 IB_USER_VERBS_CMD_CREATE_XSRQ,
90 IB_USER_VERBS_CMD_OPEN_QP,
91};
92
93enum {
94 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
95 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
96 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
97 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
98 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
99 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
100 IB_USER_VERBS_EX_CMD_CREATE_WQ,
101 IB_USER_VERBS_EX_CMD_MODIFY_WQ,
102 IB_USER_VERBS_EX_CMD_DESTROY_WQ,
103 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
104 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
106};
107
108/*
109 * Make sure that all structs defined in this file remain laid out so
110 * that they pack the same way on 32-bit and 64-bit architectures (to
111 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
112 * Specifically:
113 * - Do not use pointer types -- pass pointers in __u64 instead.
114 * - Make sure that any structure larger than 4 bytes is padded to a
115 * multiple of 8 bytes. Otherwise the structure size will be
116 * different between 32-bit and 64-bit architectures.
117 */
118
119struct ib_uverbs_async_event_desc {
120 __aligned_u64 element;
121 __u32 event_type; /* enum ib_event_type */
122 __u32 reserved;
123};
124
125struct ib_uverbs_comp_event_desc {
126 __aligned_u64 cq_handle;
127};
128
129struct ib_uverbs_cq_moderation_caps {
130 __u16 max_cq_moderation_count;
131 __u16 max_cq_moderation_period;
132 __u32 reserved;
133};
134
135/*
136 * All commands from userspace should start with a __u32 command field
137 * followed by __u16 in_words and out_words fields (which give the
138 * length of the command block and response buffer if any in 32-bit
139 * words). The kernel driver will read these fields first and read
140 * the rest of the command struct based on these value.
141 */
142
143#define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
144#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
145
146struct ib_uverbs_cmd_hdr {
147 __u32 command;
148 __u16 in_words;
149 __u16 out_words;
150};
151
152struct ib_uverbs_ex_cmd_hdr {
153 __aligned_u64 response;
154 __u16 provider_in_words;
155 __u16 provider_out_words;
156 __u32 cmd_hdr_reserved;
157};
158
159struct ib_uverbs_get_context {
160 __aligned_u64 response;
161 __aligned_u64 driver_data[0];
162};
163
164struct ib_uverbs_get_context_resp {
165 __u32 async_fd;
166 __u32 num_comp_vectors;
167};
168
169struct ib_uverbs_query_device {
170 __aligned_u64 response;
171 __aligned_u64 driver_data[0];
172};
173
174struct ib_uverbs_query_device_resp {
175 __aligned_u64 fw_ver;
176 __be64 node_guid;
177 __be64 sys_image_guid;
178 __aligned_u64 max_mr_size;
179 __aligned_u64 page_size_cap;
180 __u32 vendor_id;
181 __u32 vendor_part_id;
182 __u32 hw_ver;
183 __u32 max_qp;
184 __u32 max_qp_wr;
185 __u32 device_cap_flags;
186 __u32 max_sge;
187 __u32 max_sge_rd;
188 __u32 max_cq;
189 __u32 max_cqe;
190 __u32 max_mr;
191 __u32 max_pd;
192 __u32 max_qp_rd_atom;
193 __u32 max_ee_rd_atom;
194 __u32 max_res_rd_atom;
195 __u32 max_qp_init_rd_atom;
196 __u32 max_ee_init_rd_atom;
197 __u32 atomic_cap;
198 __u32 max_ee;
199 __u32 max_rdd;
200 __u32 max_mw;
201 __u32 max_raw_ipv6_qp;
202 __u32 max_raw_ethy_qp;
203 __u32 max_mcast_grp;
204 __u32 max_mcast_qp_attach;
205 __u32 max_total_mcast_qp_attach;
206 __u32 max_ah;
207 __u32 max_fmr;
208 __u32 max_map_per_fmr;
209 __u32 max_srq;
210 __u32 max_srq_wr;
211 __u32 max_srq_sge;
212 __u16 max_pkeys;
213 __u8 local_ca_ack_delay;
214 __u8 phys_port_cnt;
215 __u8 reserved[4];
216};
217
218struct ib_uverbs_ex_query_device {
219 __u32 comp_mask;
220 __u32 reserved;
221};
222
223struct ib_uverbs_odp_caps {
224 __aligned_u64 general_caps;
225 struct {
226 __u32 rc_odp_caps;
227 __u32 uc_odp_caps;
228 __u32 ud_odp_caps;
229 } per_transport_caps;
230 __u32 reserved;
231};
232
233struct ib_uverbs_rss_caps {
234 /* Corresponding bit will be set if qp type from
235 * 'enum ib_qp_type' is supported, e.g.
236 * supported_qpts |= 1 << IB_QPT_UD
237 */
238 __u32 supported_qpts;
239 __u32 max_rwq_indirection_tables;
240 __u32 max_rwq_indirection_table_size;
241 __u32 reserved;
242};
243
244struct ib_uverbs_tm_caps {
245 /* Max size of rendezvous request message */
246 __u32 max_rndv_hdr_size;
247 /* Max number of entries in tag matching list */
248 __u32 max_num_tags;
249 /* TM flags */
250 __u32 flags;
251 /* Max number of outstanding list operations */
252 __u32 max_ops;
253 /* Max number of SGE in tag matching entry */
254 __u32 max_sge;
255 __u32 reserved;
256};
257
258struct ib_uverbs_ex_query_device_resp {
259 struct ib_uverbs_query_device_resp base;
260 __u32 comp_mask;
261 __u32 response_length;
262 struct ib_uverbs_odp_caps odp_caps;
263 __aligned_u64 timestamp_mask;
264 __aligned_u64 hca_core_clock; /* in KHZ */
265 __aligned_u64 device_cap_flags_ex;
266 struct ib_uverbs_rss_caps rss_caps;
267 __u32 max_wq_type_rq;
268 __u32 raw_packet_caps;
269 struct ib_uverbs_tm_caps tm_caps;
270 struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
271 __aligned_u64 max_dm_size;
272};
273
274struct ib_uverbs_query_port {
275 __aligned_u64 response;
276 __u8 port_num;
277 __u8 reserved[7];
278 __aligned_u64 driver_data[0];
279};
280
281struct ib_uverbs_query_port_resp {
282 __u32 port_cap_flags; /* see ib_uverbs_query_port_cap_flags */
283 __u32 max_msg_sz;
284 __u32 bad_pkey_cntr;
285 __u32 qkey_viol_cntr;
286 __u32 gid_tbl_len;
287 __u16 pkey_tbl_len;
288 __u16 lid;
289 __u16 sm_lid;
290 __u8 state;
291 __u8 max_mtu;
292 __u8 active_mtu;
293 __u8 lmc;
294 __u8 max_vl_num;
295 __u8 sm_sl;
296 __u8 subnet_timeout;
297 __u8 init_type_reply;
298 __u8 active_width;
299 __u8 active_speed;
300 __u8 phys_state;
301 __u8 link_layer;
302 __u8 flags; /* see ib_uverbs_query_port_flags */
303 __u8 reserved;
304};
305
306struct ib_uverbs_alloc_pd {
307 __aligned_u64 response;
308 __aligned_u64 driver_data[0];
309};
310
311struct ib_uverbs_alloc_pd_resp {
312 __u32 pd_handle;
313};
314
315struct ib_uverbs_dealloc_pd {
316 __u32 pd_handle;
317};
318
319struct ib_uverbs_open_xrcd {
320 __aligned_u64 response;
321 __u32 fd;
322 __u32 oflags;
323 __aligned_u64 driver_data[0];
324};
325
326struct ib_uverbs_open_xrcd_resp {
327 __u32 xrcd_handle;
328};
329
330struct ib_uverbs_close_xrcd {
331 __u32 xrcd_handle;
332};
333
334struct ib_uverbs_reg_mr {
335 __aligned_u64 response;
336 __aligned_u64 start;
337 __aligned_u64 length;
338 __aligned_u64 hca_va;
339 __u32 pd_handle;
340 __u32 access_flags;
341 __aligned_u64 driver_data[0];
342};
343
344struct ib_uverbs_reg_mr_resp {
345 __u32 mr_handle;
346 __u32 lkey;
347 __u32 rkey;
348};
349
350struct ib_uverbs_rereg_mr {
351 __aligned_u64 response;
352 __u32 mr_handle;
353 __u32 flags;
354 __aligned_u64 start;
355 __aligned_u64 length;
356 __aligned_u64 hca_va;
357 __u32 pd_handle;
358 __u32 access_flags;
359};
360
361struct ib_uverbs_rereg_mr_resp {
362 __u32 lkey;
363 __u32 rkey;
364};
365
366struct ib_uverbs_dereg_mr {
367 __u32 mr_handle;
368};
369
370struct ib_uverbs_alloc_mw {
371 __aligned_u64 response;
372 __u32 pd_handle;
373 __u8 mw_type;
374 __u8 reserved[3];
375};
376
377struct ib_uverbs_alloc_mw_resp {
378 __u32 mw_handle;
379 __u32 rkey;
380};
381
382struct ib_uverbs_dealloc_mw {
383 __u32 mw_handle;
384};
385
386struct ib_uverbs_create_comp_channel {
387 __aligned_u64 response;
388};
389
390struct ib_uverbs_create_comp_channel_resp {
391 __u32 fd;
392};
393
394struct ib_uverbs_create_cq {
395 __aligned_u64 response;
396 __aligned_u64 user_handle;
397 __u32 cqe;
398 __u32 comp_vector;
399 __s32 comp_channel;
400 __u32 reserved;
401 __aligned_u64 driver_data[0];
402};
403
404enum ib_uverbs_ex_create_cq_flags {
405 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
406 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
407};
408
409struct ib_uverbs_ex_create_cq {
410 __aligned_u64 user_handle;
411 __u32 cqe;
412 __u32 comp_vector;
413 __s32 comp_channel;
414 __u32 comp_mask;
415 __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
416 __u32 reserved;
417};
418
419struct ib_uverbs_create_cq_resp {
420 __u32 cq_handle;
421 __u32 cqe;
422};
423
424struct ib_uverbs_ex_create_cq_resp {
425 struct ib_uverbs_create_cq_resp base;
426 __u32 comp_mask;
427 __u32 response_length;
428};
429
430struct ib_uverbs_resize_cq {
431 __aligned_u64 response;
432 __u32 cq_handle;
433 __u32 cqe;
434 __aligned_u64 driver_data[0];
435};
436
437struct ib_uverbs_resize_cq_resp {
438 __u32 cqe;
439 __u32 reserved;
440 __aligned_u64 driver_data[0];
441};
442
443struct ib_uverbs_poll_cq {
444 __aligned_u64 response;
445 __u32 cq_handle;
446 __u32 ne;
447};
448
449struct ib_uverbs_wc {
450 __aligned_u64 wr_id;
451 __u32 status;
452 __u32 opcode;
453 __u32 vendor_err;
454 __u32 byte_len;
455 union {
456 __be32 imm_data;
457 __u32 invalidate_rkey;
458 } ex;
459 __u32 qp_num;
460 __u32 src_qp;
461 __u32 wc_flags;
462 __u16 pkey_index;
463 __u16 slid;
464 __u8 sl;
465 __u8 dlid_path_bits;
466 __u8 port_num;
467 __u8 reserved;
468};
469
470struct ib_uverbs_poll_cq_resp {
471 __u32 count;
472 __u32 reserved;
473 struct ib_uverbs_wc wc[0];
474};
475
476struct ib_uverbs_req_notify_cq {
477 __u32 cq_handle;
478 __u32 solicited_only;
479};
480
481struct ib_uverbs_destroy_cq {
482 __aligned_u64 response;
483 __u32 cq_handle;
484 __u32 reserved;
485};
486
487struct ib_uverbs_destroy_cq_resp {
488 __u32 comp_events_reported;
489 __u32 async_events_reported;
490};
491
492struct ib_uverbs_global_route {
493 __u8 dgid[16];
494 __u32 flow_label;
495 __u8 sgid_index;
496 __u8 hop_limit;
497 __u8 traffic_class;
498 __u8 reserved;
499};
500
501struct ib_uverbs_ah_attr {
502 struct ib_uverbs_global_route grh;
503 __u16 dlid;
504 __u8 sl;
505 __u8 src_path_bits;
506 __u8 static_rate;
507 __u8 is_global;
508 __u8 port_num;
509 __u8 reserved;
510};
511
512struct ib_uverbs_qp_attr {
513 __u32 qp_attr_mask;
514 __u32 qp_state;
515 __u32 cur_qp_state;
516 __u32 path_mtu;
517 __u32 path_mig_state;
518 __u32 qkey;
519 __u32 rq_psn;
520 __u32 sq_psn;
521 __u32 dest_qp_num;
522 __u32 qp_access_flags;
523
524 struct ib_uverbs_ah_attr ah_attr;
525 struct ib_uverbs_ah_attr alt_ah_attr;
526
527 /* ib_qp_cap */
528 __u32 max_send_wr;
529 __u32 max_recv_wr;
530 __u32 max_send_sge;
531 __u32 max_recv_sge;
532 __u32 max_inline_data;
533
534 __u16 pkey_index;
535 __u16 alt_pkey_index;
536 __u8 en_sqd_async_notify;
537 __u8 sq_draining;
538 __u8 max_rd_atomic;
539 __u8 max_dest_rd_atomic;
540 __u8 min_rnr_timer;
541 __u8 port_num;
542 __u8 timeout;
543 __u8 retry_cnt;
544 __u8 rnr_retry;
545 __u8 alt_port_num;
546 __u8 alt_timeout;
547 __u8 reserved[5];
548};
549
550struct ib_uverbs_create_qp {
551 __aligned_u64 response;
552 __aligned_u64 user_handle;
553 __u32 pd_handle;
554 __u32 send_cq_handle;
555 __u32 recv_cq_handle;
556 __u32 srq_handle;
557 __u32 max_send_wr;
558 __u32 max_recv_wr;
559 __u32 max_send_sge;
560 __u32 max_recv_sge;
561 __u32 max_inline_data;
562 __u8 sq_sig_all;
563 __u8 qp_type;
564 __u8 is_srq;
565 __u8 reserved;
566 __aligned_u64 driver_data[0];
567};
568
569enum ib_uverbs_create_qp_mask {
570 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
571};
572
573enum {
574 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
575};
576
577enum {
578 /*
579 * This value is equal to IB_QP_DEST_QPN.
580 */
581 IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
582};
583
584enum {
585 /*
586 * This value is equal to IB_QP_RATE_LIMIT.
587 */
588 IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
589};
590
591struct ib_uverbs_ex_create_qp {
592 __aligned_u64 user_handle;
593 __u32 pd_handle;
594 __u32 send_cq_handle;
595 __u32 recv_cq_handle;
596 __u32 srq_handle;
597 __u32 max_send_wr;
598 __u32 max_recv_wr;
599 __u32 max_send_sge;
600 __u32 max_recv_sge;
601 __u32 max_inline_data;
602 __u8 sq_sig_all;
603 __u8 qp_type;
604 __u8 is_srq;
605 __u8 reserved;
606 __u32 comp_mask;
607 __u32 create_flags;
608 __u32 rwq_ind_tbl_handle;
609 __u32 source_qpn;
610};
611
612struct ib_uverbs_open_qp {
613 __aligned_u64 response;
614 __aligned_u64 user_handle;
615 __u32 pd_handle;
616 __u32 qpn;
617 __u8 qp_type;
618 __u8 reserved[7];
619 __aligned_u64 driver_data[0];
620};
621
622/* also used for open response */
623struct ib_uverbs_create_qp_resp {
624 __u32 qp_handle;
625 __u32 qpn;
626 __u32 max_send_wr;
627 __u32 max_recv_wr;
628 __u32 max_send_sge;
629 __u32 max_recv_sge;
630 __u32 max_inline_data;
631 __u32 reserved;
632};
633
634struct ib_uverbs_ex_create_qp_resp {
635 struct ib_uverbs_create_qp_resp base;
636 __u32 comp_mask;
637 __u32 response_length;
638};
639
640/*
641 * This struct needs to remain a multiple of 8 bytes to keep the
642 * alignment of the modify QP parameters.
643 */
644struct ib_uverbs_qp_dest {
645 __u8 dgid[16];
646 __u32 flow_label;
647 __u16 dlid;
648 __u16 reserved;
649 __u8 sgid_index;
650 __u8 hop_limit;
651 __u8 traffic_class;
652 __u8 sl;
653 __u8 src_path_bits;
654 __u8 static_rate;
655 __u8 is_global;
656 __u8 port_num;
657};
658
659struct ib_uverbs_query_qp {
660 __aligned_u64 response;
661 __u32 qp_handle;
662 __u32 attr_mask;
663 __aligned_u64 driver_data[0];
664};
665
666struct ib_uverbs_query_qp_resp {
667 struct ib_uverbs_qp_dest dest;
668 struct ib_uverbs_qp_dest alt_dest;
669 __u32 max_send_wr;
670 __u32 max_recv_wr;
671 __u32 max_send_sge;
672 __u32 max_recv_sge;
673 __u32 max_inline_data;
674 __u32 qkey;
675 __u32 rq_psn;
676 __u32 sq_psn;
677 __u32 dest_qp_num;
678 __u32 qp_access_flags;
679 __u16 pkey_index;
680 __u16 alt_pkey_index;
681 __u8 qp_state;
682 __u8 cur_qp_state;
683 __u8 path_mtu;
684 __u8 path_mig_state;
685 __u8 sq_draining;
686 __u8 max_rd_atomic;
687 __u8 max_dest_rd_atomic;
688 __u8 min_rnr_timer;
689 __u8 port_num;
690 __u8 timeout;
691 __u8 retry_cnt;
692 __u8 rnr_retry;
693 __u8 alt_port_num;
694 __u8 alt_timeout;
695 __u8 sq_sig_all;
696 __u8 reserved[5];
697 __aligned_u64 driver_data[0];
698};
699
700struct ib_uverbs_modify_qp {
701 struct ib_uverbs_qp_dest dest;
702 struct ib_uverbs_qp_dest alt_dest;
703 __u32 qp_handle;
704 __u32 attr_mask;
705 __u32 qkey;
706 __u32 rq_psn;
707 __u32 sq_psn;
708 __u32 dest_qp_num;
709 __u32 qp_access_flags;
710 __u16 pkey_index;
711 __u16 alt_pkey_index;
712 __u8 qp_state;
713 __u8 cur_qp_state;
714 __u8 path_mtu;
715 __u8 path_mig_state;
716 __u8 en_sqd_async_notify;
717 __u8 max_rd_atomic;
718 __u8 max_dest_rd_atomic;
719 __u8 min_rnr_timer;
720 __u8 port_num;
721 __u8 timeout;
722 __u8 retry_cnt;
723 __u8 rnr_retry;
724 __u8 alt_port_num;
725 __u8 alt_timeout;
726 __u8 reserved[2];
727 __aligned_u64 driver_data[0];
728};
729
730struct ib_uverbs_ex_modify_qp {
731 struct ib_uverbs_modify_qp base;
732 __u32 rate_limit;
733 __u32 reserved;
734};
735
736struct ib_uverbs_modify_qp_resp {
737};
738
739struct ib_uverbs_ex_modify_qp_resp {
740 __u32 comp_mask;
741 __u32 response_length;
742};
743
744struct ib_uverbs_destroy_qp {
745 __aligned_u64 response;
746 __u32 qp_handle;
747 __u32 reserved;
748};
749
750struct ib_uverbs_destroy_qp_resp {
751 __u32 events_reported;
752};
753
754/*
755 * The ib_uverbs_sge structure isn't used anywhere, since we assume
756 * the ib_sge structure is packed the same way on 32-bit and 64-bit
757 * architectures in both kernel and user space. It's just here to
758 * document the ABI.
759 */
760struct ib_uverbs_sge {
761 __aligned_u64 addr;
762 __u32 length;
763 __u32 lkey;
764};
765
766enum ib_uverbs_wr_opcode {
767 IB_UVERBS_WR_RDMA_WRITE = 0,
768 IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
769 IB_UVERBS_WR_SEND = 2,
770 IB_UVERBS_WR_SEND_WITH_IMM = 3,
771 IB_UVERBS_WR_RDMA_READ = 4,
772 IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
773 IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
774 IB_UVERBS_WR_LOCAL_INV = 7,
775 IB_UVERBS_WR_BIND_MW = 8,
776 IB_UVERBS_WR_SEND_WITH_INV = 9,
777 IB_UVERBS_WR_TSO = 10,
778 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
779 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
780 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
781 /* Review enum ib_wr_opcode before modifying this */
782};
783
784struct ib_uverbs_send_wr {
785 __aligned_u64 wr_id;
786 __u32 num_sge;
787 __u32 opcode; /* see enum ib_uverbs_wr_opcode */
788 __u32 send_flags;
789 union {
790 __be32 imm_data;
791 __u32 invalidate_rkey;
792 } ex;
793 union {
794 struct {
795 __aligned_u64 remote_addr;
796 __u32 rkey;
797 __u32 reserved;
798 } rdma;
799 struct {
800 __aligned_u64 remote_addr;
801 __aligned_u64 compare_add;
802 __aligned_u64 swap;
803 __u32 rkey;
804 __u32 reserved;
805 } atomic;
806 struct {
807 __u32 ah;
808 __u32 remote_qpn;
809 __u32 remote_qkey;
810 __u32 reserved;
811 } ud;
812 } wr;
813};
814
815struct ib_uverbs_post_send {
816 __aligned_u64 response;
817 __u32 qp_handle;
818 __u32 wr_count;
819 __u32 sge_count;
820 __u32 wqe_size;
821 struct ib_uverbs_send_wr send_wr[0];
822};
823
824struct ib_uverbs_post_send_resp {
825 __u32 bad_wr;
826};
827
828struct ib_uverbs_recv_wr {
829 __aligned_u64 wr_id;
830 __u32 num_sge;
831 __u32 reserved;
832};
833
834struct ib_uverbs_post_recv {
835 __aligned_u64 response;
836 __u32 qp_handle;
837 __u32 wr_count;
838 __u32 sge_count;
839 __u32 wqe_size;
840 struct ib_uverbs_recv_wr recv_wr[0];
841};
842
843struct ib_uverbs_post_recv_resp {
844 __u32 bad_wr;
845};
846
847struct ib_uverbs_post_srq_recv {
848 __aligned_u64 response;
849 __u32 srq_handle;
850 __u32 wr_count;
851 __u32 sge_count;
852 __u32 wqe_size;
853 struct ib_uverbs_recv_wr recv[0];
854};
855
856struct ib_uverbs_post_srq_recv_resp {
857 __u32 bad_wr;
858};
859
860struct ib_uverbs_create_ah {
861 __aligned_u64 response;
862 __aligned_u64 user_handle;
863 __u32 pd_handle;
864 __u32 reserved;
865 struct ib_uverbs_ah_attr attr;
866};
867
868struct ib_uverbs_create_ah_resp {
869 __u32 ah_handle;
870};
871
872struct ib_uverbs_destroy_ah {
873 __u32 ah_handle;
874};
875
876struct ib_uverbs_attach_mcast {
877 __u8 gid[16];
878 __u32 qp_handle;
879 __u16 mlid;
880 __u16 reserved;
881 __aligned_u64 driver_data[0];
882};
883
884struct ib_uverbs_detach_mcast {
885 __u8 gid[16];
886 __u32 qp_handle;
887 __u16 mlid;
888 __u16 reserved;
889 __aligned_u64 driver_data[0];
890};
891
892struct ib_uverbs_flow_spec_hdr {
893 __u32 type;
894 __u16 size;
895 __u16 reserved;
896 /* followed by flow_spec */
897 __aligned_u64 flow_spec_data[0];
898};
899
900struct ib_uverbs_flow_eth_filter {
901 __u8 dst_mac[6];
902 __u8 src_mac[6];
903 __be16 ether_type;
904 __be16 vlan_tag;
905};
906
907struct ib_uverbs_flow_spec_eth {
908 union {
909 struct ib_uverbs_flow_spec_hdr hdr;
910 struct {
911 __u32 type;
912 __u16 size;
913 __u16 reserved;
914 };
915 };
916 struct ib_uverbs_flow_eth_filter val;
917 struct ib_uverbs_flow_eth_filter mask;
918};
919
920struct ib_uverbs_flow_ipv4_filter {
921 __be32 src_ip;
922 __be32 dst_ip;
923 __u8 proto;
924 __u8 tos;
925 __u8 ttl;
926 __u8 flags;
927};
928
929struct ib_uverbs_flow_spec_ipv4 {
930 union {
931 struct ib_uverbs_flow_spec_hdr hdr;
932 struct {
933 __u32 type;
934 __u16 size;
935 __u16 reserved;
936 };
937 };
938 struct ib_uverbs_flow_ipv4_filter val;
939 struct ib_uverbs_flow_ipv4_filter mask;
940};
941
942struct ib_uverbs_flow_tcp_udp_filter {
943 __be16 dst_port;
944 __be16 src_port;
945};
946
947struct ib_uverbs_flow_spec_tcp_udp {
948 union {
949 struct ib_uverbs_flow_spec_hdr hdr;
950 struct {
951 __u32 type;
952 __u16 size;
953 __u16 reserved;
954 };
955 };
956 struct ib_uverbs_flow_tcp_udp_filter val;
957 struct ib_uverbs_flow_tcp_udp_filter mask;
958};
959
960struct ib_uverbs_flow_ipv6_filter {
961 __u8 src_ip[16];
962 __u8 dst_ip[16];
963 __be32 flow_label;
964 __u8 next_hdr;
965 __u8 traffic_class;
966 __u8 hop_limit;
967 __u8 reserved;
968};
969
970struct ib_uverbs_flow_spec_ipv6 {
971 union {
972 struct ib_uverbs_flow_spec_hdr hdr;
973 struct {
974 __u32 type;
975 __u16 size;
976 __u16 reserved;
977 };
978 };
979 struct ib_uverbs_flow_ipv6_filter val;
980 struct ib_uverbs_flow_ipv6_filter mask;
981};
982
983struct ib_uverbs_flow_spec_action_tag {
984 union {
985 struct ib_uverbs_flow_spec_hdr hdr;
986 struct {
987 __u32 type;
988 __u16 size;
989 __u16 reserved;
990 };
991 };
992 __u32 tag_id;
993 __u32 reserved1;
994};
995
996struct ib_uverbs_flow_spec_action_drop {
997 union {
998 struct ib_uverbs_flow_spec_hdr hdr;
999 struct {
1000 __u32 type;
1001 __u16 size;
1002 __u16 reserved;
1003 };
1004 };
1005};
1006
1007struct ib_uverbs_flow_spec_action_handle {
1008 union {
1009 struct ib_uverbs_flow_spec_hdr hdr;
1010 struct {
1011 __u32 type;
1012 __u16 size;
1013 __u16 reserved;
1014 };
1015 };
1016 __u32 handle;
1017 __u32 reserved1;
1018};
1019
1020struct ib_uverbs_flow_spec_action_count {
1021 union {
1022 struct ib_uverbs_flow_spec_hdr hdr;
1023 struct {
1024 __u32 type;
1025 __u16 size;
1026 __u16 reserved;
1027 };
1028 };
1029 __u32 handle;
1030 __u32 reserved1;
1031};
1032
1033struct ib_uverbs_flow_tunnel_filter {
1034 __be32 tunnel_id;
1035};
1036
1037struct ib_uverbs_flow_spec_tunnel {
1038 union {
1039 struct ib_uverbs_flow_spec_hdr hdr;
1040 struct {
1041 __u32 type;
1042 __u16 size;
1043 __u16 reserved;
1044 };
1045 };
1046 struct ib_uverbs_flow_tunnel_filter val;
1047 struct ib_uverbs_flow_tunnel_filter mask;
1048};
1049
1050struct ib_uverbs_flow_spec_esp_filter {
1051 __u32 spi;
1052 __u32 seq;
1053};
1054
1055struct ib_uverbs_flow_spec_esp {
1056 union {
1057 struct ib_uverbs_flow_spec_hdr hdr;
1058 struct {
1059 __u32 type;
1060 __u16 size;
1061 __u16 reserved;
1062 };
1063 };
1064 struct ib_uverbs_flow_spec_esp_filter val;
1065 struct ib_uverbs_flow_spec_esp_filter mask;
1066};
1067
1068struct ib_uverbs_flow_gre_filter {
1069 /* c_ks_res0_ver field is bits 0-15 in offset 0 of a standard GRE header:
1070 * bit 0 - C - checksum bit.
1071 * bit 1 - reserved. set to 0.
1072 * bit 2 - key bit.
1073 * bit 3 - sequence number bit.
1074 * bits 4:12 - reserved. set to 0.
1075 * bits 13:15 - GRE version.
1076 */
1077 __be16 c_ks_res0_ver;
1078 __be16 protocol;
1079 __be32 key;
1080};
1081
1082struct ib_uverbs_flow_spec_gre {
1083 union {
1084 struct ib_uverbs_flow_spec_hdr hdr;
1085 struct {
1086 __u32 type;
1087 __u16 size;
1088 __u16 reserved;
1089 };
1090 };
1091 struct ib_uverbs_flow_gre_filter val;
1092 struct ib_uverbs_flow_gre_filter mask;
1093};
1094
1095struct ib_uverbs_flow_mpls_filter {
1096 /* The field includes the entire MPLS label:
1097 * bits 0:19 - label field.
1098 * bits 20:22 - traffic class field.
1099 * bits 23 - bottom of stack bit.
1100 * bits 24:31 - ttl field.
1101 */
1102 __be32 label;
1103};
1104
1105struct ib_uverbs_flow_spec_mpls {
1106 union {
1107 struct ib_uverbs_flow_spec_hdr hdr;
1108 struct {
1109 __u32 type;
1110 __u16 size;
1111 __u16 reserved;
1112 };
1113 };
1114 struct ib_uverbs_flow_mpls_filter val;
1115 struct ib_uverbs_flow_mpls_filter mask;
1116};
1117
1118struct ib_uverbs_flow_attr {
1119 __u32 type;
1120 __u16 size;
1121 __u16 priority;
1122 __u8 num_of_specs;
1123 __u8 reserved[2];
1124 __u8 port;
1125 __u32 flags;
1126 /* Following are the optional layers according to user request
1127 * struct ib_flow_spec_xxx
1128 * struct ib_flow_spec_yyy
1129 */
1130 struct ib_uverbs_flow_spec_hdr flow_specs[0];
1131};
1132
1133struct ib_uverbs_create_flow {
1134 __u32 comp_mask;
1135 __u32 qp_handle;
1136 struct ib_uverbs_flow_attr flow_attr;
1137};
1138
1139struct ib_uverbs_create_flow_resp {
1140 __u32 comp_mask;
1141 __u32 flow_handle;
1142};
1143
1144struct ib_uverbs_destroy_flow {
1145 __u32 comp_mask;
1146 __u32 flow_handle;
1147};
1148
1149struct ib_uverbs_create_srq {
1150 __aligned_u64 response;
1151 __aligned_u64 user_handle;
1152 __u32 pd_handle;
1153 __u32 max_wr;
1154 __u32 max_sge;
1155 __u32 srq_limit;
1156 __aligned_u64 driver_data[0];
1157};
1158
1159struct ib_uverbs_create_xsrq {
1160 __aligned_u64 response;
1161 __aligned_u64 user_handle;
1162 __u32 srq_type;
1163 __u32 pd_handle;
1164 __u32 max_wr;
1165 __u32 max_sge;
1166 __u32 srq_limit;
1167 __u32 max_num_tags;
1168 __u32 xrcd_handle;
1169 __u32 cq_handle;
1170 __aligned_u64 driver_data[0];
1171};
1172
1173struct ib_uverbs_create_srq_resp {
1174 __u32 srq_handle;
1175 __u32 max_wr;
1176 __u32 max_sge;
1177 __u32 srqn;
1178};
1179
1180struct ib_uverbs_modify_srq {
1181 __u32 srq_handle;
1182 __u32 attr_mask;
1183 __u32 max_wr;
1184 __u32 srq_limit;
1185 __aligned_u64 driver_data[0];
1186};
1187
1188struct ib_uverbs_query_srq {
1189 __aligned_u64 response;
1190 __u32 srq_handle;
1191 __u32 reserved;
1192 __aligned_u64 driver_data[0];
1193};
1194
1195struct ib_uverbs_query_srq_resp {
1196 __u32 max_wr;
1197 __u32 max_sge;
1198 __u32 srq_limit;
1199 __u32 reserved;
1200};
1201
1202struct ib_uverbs_destroy_srq {
1203 __aligned_u64 response;
1204 __u32 srq_handle;
1205 __u32 reserved;
1206};
1207
1208struct ib_uverbs_destroy_srq_resp {
1209 __u32 events_reported;
1210};
1211
1212struct ib_uverbs_ex_create_wq {
1213 __u32 comp_mask;
1214 __u32 wq_type;
1215 __aligned_u64 user_handle;
1216 __u32 pd_handle;
1217 __u32 cq_handle;
1218 __u32 max_wr;
1219 __u32 max_sge;
1220 __u32 create_flags; /* Use enum ib_wq_flags */
1221 __u32 reserved;
1222};
1223
1224struct ib_uverbs_ex_create_wq_resp {
1225 __u32 comp_mask;
1226 __u32 response_length;
1227 __u32 wq_handle;
1228 __u32 max_wr;
1229 __u32 max_sge;
1230 __u32 wqn;
1231};
1232
1233struct ib_uverbs_ex_destroy_wq {
1234 __u32 comp_mask;
1235 __u32 wq_handle;
1236};
1237
1238struct ib_uverbs_ex_destroy_wq_resp {
1239 __u32 comp_mask;
1240 __u32 response_length;
1241 __u32 events_reported;
1242 __u32 reserved;
1243};
1244
1245struct ib_uverbs_ex_modify_wq {
1246 __u32 attr_mask;
1247 __u32 wq_handle;
1248 __u32 wq_state;
1249 __u32 curr_wq_state;
1250 __u32 flags; /* Use enum ib_wq_flags */
1251 __u32 flags_mask; /* Use enum ib_wq_flags */
1252};
1253
1254/* Prevent memory allocation rather than max expected size */
1255#define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1256struct ib_uverbs_ex_create_rwq_ind_table {
1257 __u32 comp_mask;
1258 __u32 log_ind_tbl_size;
1259 /* Following are the wq handles according to log_ind_tbl_size
1260 * wq_handle1
1261 * wq_handle2
1262 */
1263 __u32 wq_handles[0];
1264};
1265
1266struct ib_uverbs_ex_create_rwq_ind_table_resp {
1267 __u32 comp_mask;
1268 __u32 response_length;
1269 __u32 ind_tbl_handle;
1270 __u32 ind_tbl_num;
1271};
1272
1273struct ib_uverbs_ex_destroy_rwq_ind_table {
1274 __u32 comp_mask;
1275 __u32 ind_tbl_handle;
1276};
1277
1278struct ib_uverbs_cq_moderation {
1279 __u16 cq_count;
1280 __u16 cq_period;
1281};
1282
1283struct ib_uverbs_ex_modify_cq {
1284 __u32 cq_handle;
1285 __u32 attr_mask;
1286 struct ib_uverbs_cq_moderation attr;
1287 __u32 reserved;
1288};
1289
1290#define IB_DEVICE_NAME_MAX 64
1291
1292#endif /* IB_USER_VERBS_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/mlx4-abi.h deleted-191
...@@ -1,191 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
4 * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef MLX4_ABI_USER_H
36#define MLX4_ABI_USER_H
37
38#include <linux/types.h>
39
40/*
41 * Increment this value if any changes that break userspace ABI
42 * compatibility are made.
43 */
44
45#define MLX4_IB_UVERBS_NO_DEV_CAPS_ABI_VERSION 3
46#define MLX4_IB_UVERBS_ABI_VERSION 4
47
48/*
49 * Make sure that all structs defined in this file remain laid out so
50 * that they pack the same way on 32-bit and 64-bit architectures (to
51 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
52 * In particular do not use pointer types -- pass pointers in __u64
53 * instead.
54 */
55
56struct mlx4_ib_alloc_ucontext_resp_v3 {
57 __u32 qp_tab_size;
58 __u16 bf_reg_size;
59 __u16 bf_regs_per_page;
60};
61
62enum {
63 MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0,
64};
65
66struct mlx4_ib_alloc_ucontext_resp {
67 __u32 dev_caps;
68 __u32 qp_tab_size;
69 __u16 bf_reg_size;
70 __u16 bf_regs_per_page;
71 __u32 cqe_size;
72};
73
74struct mlx4_ib_alloc_pd_resp {
75 __u32 pdn;
76 __u32 reserved;
77};
78
79struct mlx4_ib_create_cq {
80 __aligned_u64 buf_addr;
81 __aligned_u64 db_addr;
82};
83
84struct mlx4_ib_create_cq_resp {
85 __u32 cqn;
86 __u32 reserved;
87};
88
89struct mlx4_ib_resize_cq {
90 __aligned_u64 buf_addr;
91};
92
93struct mlx4_ib_create_srq {
94 __aligned_u64 buf_addr;
95 __aligned_u64 db_addr;
96};
97
98struct mlx4_ib_create_srq_resp {
99 __u32 srqn;
100 __u32 reserved;
101};
102
103struct mlx4_ib_create_qp_rss {
104 __aligned_u64 rx_hash_fields_mask; /* Use enum mlx4_ib_rx_hash_fields */
105 __u8 rx_hash_function; /* Use enum mlx4_ib_rx_hash_function_flags */
106 __u8 reserved[7];
107 __u8 rx_hash_key[40];
108 __u32 comp_mask;
109 __u32 reserved1;
110};
111
112struct mlx4_ib_create_qp {
113 __aligned_u64 buf_addr;
114 __aligned_u64 db_addr;
115 __u8 log_sq_bb_count;
116 __u8 log_sq_stride;
117 __u8 sq_no_prefetch;
118 __u8 reserved;
119 __u32 inl_recv_sz;
120};
121
122struct mlx4_ib_create_wq {
123 __aligned_u64 buf_addr;
124 __aligned_u64 db_addr;
125 __u8 log_range_size;
126 __u8 reserved[3];
127 __u32 comp_mask;
128};
129
130struct mlx4_ib_modify_wq {
131 __u32 comp_mask;
132 __u32 reserved;
133};
134
135struct mlx4_ib_create_rwq_ind_tbl_resp {
136 __u32 response_length;
137 __u32 reserved;
138};
139
140/* RX Hash function flags */
141enum mlx4_ib_rx_hash_function_flags {
142 MLX4_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
143};
144
145/*
146 * RX Hash flags, these flags allows to set which incoming packet's field should
147 * participates in RX Hash. Each flag represent certain packet's field,
148 * when the flag is set the field that is represented by the flag will
149 * participate in RX Hash calculation.
150 */
151enum mlx4_ib_rx_hash_fields {
152 MLX4_IB_RX_HASH_SRC_IPV4 = 1 << 0,
153 MLX4_IB_RX_HASH_DST_IPV4 = 1 << 1,
154 MLX4_IB_RX_HASH_SRC_IPV6 = 1 << 2,
155 MLX4_IB_RX_HASH_DST_IPV6 = 1 << 3,
156 MLX4_IB_RX_HASH_SRC_PORT_TCP = 1 << 4,
157 MLX4_IB_RX_HASH_DST_PORT_TCP = 1 << 5,
158 MLX4_IB_RX_HASH_SRC_PORT_UDP = 1 << 6,
159 MLX4_IB_RX_HASH_DST_PORT_UDP = 1 << 7,
160 MLX4_IB_RX_HASH_INNER = 1ULL << 31,
161};
162
163struct mlx4_ib_rss_caps {
164 __aligned_u64 rx_hash_fields_mask; /* enum mlx4_ib_rx_hash_fields */
165 __u8 rx_hash_function; /* enum mlx4_ib_rx_hash_function_flags */
166 __u8 reserved[7];
167};
168
169enum query_device_resp_mask {
170 MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
171};
172
173struct mlx4_ib_tso_caps {
174 __u32 max_tso; /* Maximum tso payload size in bytes */
175 /* Corresponding bit will be set if qp type from
176 * 'enum ib_qp_type' is supported.
177 */
178 __u32 supported_qpts;
179};
180
181struct mlx4_uverbs_ex_query_device_resp {
182 __u32 comp_mask;
183 __u32 response_length;
184 __aligned_u64 hca_core_clock_offset;
185 __u32 max_inl_recv_sz;
186 __u32 reserved;
187 struct mlx4_ib_rss_caps rss_caps;
188 struct mlx4_ib_tso_caps tso_caps;
189};
190
191#endif /* MLX4_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/mlx5-abi.h deleted-474
...@@ -1,474 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef MLX5_ABI_USER_H
35#define MLX5_ABI_USER_H
36
37#include <linux/types.h>
38#include <linux/if_ether.h> /* For ETH_ALEN. */
39#include <rdma/ib_user_ioctl_verbs.h>
40
41enum {
42 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
43 MLX5_QP_FLAG_SCATTER_CQE = 1 << 1,
44 MLX5_QP_FLAG_TUNNEL_OFFLOADS = 1 << 2,
45 MLX5_QP_FLAG_BFREG_INDEX = 1 << 3,
46 MLX5_QP_FLAG_TYPE_DCT = 1 << 4,
47 MLX5_QP_FLAG_TYPE_DCI = 1 << 5,
48};
49
50enum {
51 MLX5_SRQ_FLAG_SIGNATURE = 1 << 0,
52};
53
54enum {
55 MLX5_WQ_FLAG_SIGNATURE = 1 << 0,
56};
57
58/* Increment this value if any changes that break userspace ABI
59 * compatibility are made.
60 */
61#define MLX5_IB_UVERBS_ABI_VERSION 1
62
63/* Make sure that all structs defined in this file remain laid out so
64 * that they pack the same way on 32-bit and 64-bit architectures (to
65 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
66 * In particular do not use pointer types -- pass pointers in __u64
67 * instead.
68 */
69
70struct mlx5_ib_alloc_ucontext_req {
71 __u32 total_num_bfregs;
72 __u32 num_low_latency_bfregs;
73};
74
75enum mlx5_lib_caps {
76 MLX5_LIB_CAP_4K_UAR = (__u64)1 << 0,
77};
78
79enum mlx5_ib_alloc_uctx_v2_flags {
80 MLX5_IB_ALLOC_UCTX_DEVX = 1 << 0,
81};
82struct mlx5_ib_alloc_ucontext_req_v2 {
83 __u32 total_num_bfregs;
84 __u32 num_low_latency_bfregs;
85 __u32 flags;
86 __u32 comp_mask;
87 __u8 max_cqe_version;
88 __u8 reserved0;
89 __u16 reserved1;
90 __u32 reserved2;
91 __aligned_u64 lib_caps;
92};
93
94enum mlx5_ib_alloc_ucontext_resp_mask {
95 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
96 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY = 1UL << 1,
97};
98
99enum mlx5_user_cmds_supp_uhw {
100 MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE = 1 << 0,
101 MLX5_USER_CMDS_SUPP_UHW_CREATE_AH = 1 << 1,
102};
103
104/* The eth_min_inline response value is set to off-by-one vs the FW
105 * returned value to allow user-space to deal with older kernels.
106 */
107enum mlx5_user_inline_mode {
108 MLX5_USER_INLINE_MODE_NA,
109 MLX5_USER_INLINE_MODE_NONE,
110 MLX5_USER_INLINE_MODE_L2,
111 MLX5_USER_INLINE_MODE_IP,
112 MLX5_USER_INLINE_MODE_TCP_UDP,
113};
114
115enum {
116 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM = 1 << 0,
117 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_REQ_METADATA = 1 << 1,
118 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_SPI_STEERING = 1 << 2,
119 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_FULL_OFFLOAD = 1 << 3,
120 MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_TX_IV_IS_ESN = 1 << 4,
121};
122
123struct mlx5_ib_alloc_ucontext_resp {
124 __u32 qp_tab_size;
125 __u32 bf_reg_size;
126 __u32 tot_bfregs;
127 __u32 cache_line_size;
128 __u16 max_sq_desc_sz;
129 __u16 max_rq_desc_sz;
130 __u32 max_send_wqebb;
131 __u32 max_recv_wr;
132 __u32 max_srq_recv_wr;
133 __u16 num_ports;
134 __u16 flow_action_flags;
135 __u32 comp_mask;
136 __u32 response_length;
137 __u8 cqe_version;
138 __u8 cmds_supp_uhw;
139 __u8 eth_min_inline;
140 __u8 clock_info_versions;
141 __aligned_u64 hca_core_clock_offset;
142 __u32 log_uar_size;
143 __u32 num_uars_per_page;
144 __u32 num_dyn_bfregs;
145 __u32 dump_fill_mkey;
146};
147
148struct mlx5_ib_alloc_pd_resp {
149 __u32 pdn;
150};
151
152struct mlx5_ib_tso_caps {
153 __u32 max_tso; /* Maximum tso payload size in bytes */
154
155 /* Corresponding bit will be set if qp type from
156 * 'enum ib_qp_type' is supported, e.g.
157 * supported_qpts |= 1 << IB_QPT_UD
158 */
159 __u32 supported_qpts;
160};
161
162struct mlx5_ib_rss_caps {
163 __aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
164 __u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
165 __u8 reserved[7];
166};
167
168enum mlx5_ib_cqe_comp_res_format {
169 MLX5_IB_CQE_RES_FORMAT_HASH = 1 << 0,
170 MLX5_IB_CQE_RES_FORMAT_CSUM = 1 << 1,
171 MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2,
172};
173
174struct mlx5_ib_cqe_comp_caps {
175 __u32 max_num;
176 __u32 supported_format; /* enum mlx5_ib_cqe_comp_res_format */
177};
178
179enum mlx5_ib_packet_pacing_cap_flags {
180 MLX5_IB_PP_SUPPORT_BURST = 1 << 0,
181};
182
183struct mlx5_packet_pacing_caps {
184 __u32 qp_rate_limit_min;
185 __u32 qp_rate_limit_max; /* In kpbs */
186
187 /* Corresponding bit will be set if qp type from
188 * 'enum ib_qp_type' is supported, e.g.
189 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
190 */
191 __u32 supported_qpts;
192 __u8 cap_flags; /* enum mlx5_ib_packet_pacing_cap_flags */
193 __u8 reserved[3];
194};
195
196enum mlx5_ib_mpw_caps {
197 MPW_RESERVED = 1 << 0,
198 MLX5_IB_ALLOW_MPW = 1 << 1,
199 MLX5_IB_SUPPORT_EMPW = 1 << 2,
200};
201
202enum mlx5_ib_sw_parsing_offloads {
203 MLX5_IB_SW_PARSING = 1 << 0,
204 MLX5_IB_SW_PARSING_CSUM = 1 << 1,
205 MLX5_IB_SW_PARSING_LSO = 1 << 2,
206};
207
208struct mlx5_ib_sw_parsing_caps {
209 __u32 sw_parsing_offloads; /* enum mlx5_ib_sw_parsing_offloads */
210
211 /* Corresponding bit will be set if qp type from
212 * 'enum ib_qp_type' is supported, e.g.
213 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
214 */
215 __u32 supported_qpts;
216};
217
218struct mlx5_ib_striding_rq_caps {
219 __u32 min_single_stride_log_num_of_bytes;
220 __u32 max_single_stride_log_num_of_bytes;
221 __u32 min_single_wqe_log_num_of_strides;
222 __u32 max_single_wqe_log_num_of_strides;
223
224 /* Corresponding bit will be set if qp type from
225 * 'enum ib_qp_type' is supported, e.g.
226 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
227 */
228 __u32 supported_qpts;
229 __u32 reserved;
230};
231
232enum mlx5_ib_query_dev_resp_flags {
233 /* Support 128B CQE compression */
234 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
235 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1,
236};
237
238enum mlx5_ib_tunnel_offloads {
239 MLX5_IB_TUNNELED_OFFLOADS_VXLAN = 1 << 0,
240 MLX5_IB_TUNNELED_OFFLOADS_GRE = 1 << 1,
241 MLX5_IB_TUNNELED_OFFLOADS_GENEVE = 1 << 2,
242 MLX5_IB_TUNNELED_OFFLOADS_MPLS_GRE = 1 << 3,
243 MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP = 1 << 4,
244};
245
246struct mlx5_ib_query_device_resp {
247 __u32 comp_mask;
248 __u32 response_length;
249 struct mlx5_ib_tso_caps tso_caps;
250 struct mlx5_ib_rss_caps rss_caps;
251 struct mlx5_ib_cqe_comp_caps cqe_comp_caps;
252 struct mlx5_packet_pacing_caps packet_pacing_caps;
253 __u32 mlx5_ib_support_multi_pkt_send_wqes;
254 __u32 flags; /* Use enum mlx5_ib_query_dev_resp_flags */
255 struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
256 struct mlx5_ib_striding_rq_caps striding_rq_caps;
257 __u32 tunnel_offloads_caps; /* enum mlx5_ib_tunnel_offloads */
258 __u32 reserved;
259};
260
261enum mlx5_ib_create_cq_flags {
262 MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD = 1 << 0,
263};
264
265struct mlx5_ib_create_cq {
266 __aligned_u64 buf_addr;
267 __aligned_u64 db_addr;
268 __u32 cqe_size;
269 __u8 cqe_comp_en;
270 __u8 cqe_comp_res_format;
271 __u16 flags;
272};
273
274struct mlx5_ib_create_cq_resp {
275 __u32 cqn;
276 __u32 reserved;
277};
278
279struct mlx5_ib_resize_cq {
280 __aligned_u64 buf_addr;
281 __u16 cqe_size;
282 __u16 reserved0;
283 __u32 reserved1;
284};
285
286struct mlx5_ib_create_srq {
287 __aligned_u64 buf_addr;
288 __aligned_u64 db_addr;
289 __u32 flags;
290 __u32 reserved0; /* explicit padding (optional on i386) */
291 __u32 uidx;
292 __u32 reserved1;
293};
294
295struct mlx5_ib_create_srq_resp {
296 __u32 srqn;
297 __u32 reserved;
298};
299
300struct mlx5_ib_create_qp {
301 __aligned_u64 buf_addr;
302 __aligned_u64 db_addr;
303 __u32 sq_wqe_count;
304 __u32 rq_wqe_count;
305 __u32 rq_wqe_shift;
306 __u32 flags;
307 __u32 uidx;
308 __u32 bfreg_index;
309 union {
310 __aligned_u64 sq_buf_addr;
311 __aligned_u64 access_key;
312 };
313};
314
315/* RX Hash function flags */
316enum mlx5_rx_hash_function_flags {
317 MLX5_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
318};
319
320/*
321 * RX Hash flags, these flags allows to set which incoming packet's field should
322 * participates in RX Hash. Each flag represent certain packet's field,
323 * when the flag is set the field that is represented by the flag will
324 * participate in RX Hash calculation.
325 * Note: *IPV4 and *IPV6 flags can't be enabled together on the same QP
326 * and *TCP and *UDP flags can't be enabled together on the same QP.
327*/
328enum mlx5_rx_hash_fields {
329 MLX5_RX_HASH_SRC_IPV4 = 1 << 0,
330 MLX5_RX_HASH_DST_IPV4 = 1 << 1,
331 MLX5_RX_HASH_SRC_IPV6 = 1 << 2,
332 MLX5_RX_HASH_DST_IPV6 = 1 << 3,
333 MLX5_RX_HASH_SRC_PORT_TCP = 1 << 4,
334 MLX5_RX_HASH_DST_PORT_TCP = 1 << 5,
335 MLX5_RX_HASH_SRC_PORT_UDP = 1 << 6,
336 MLX5_RX_HASH_DST_PORT_UDP = 1 << 7,
337 MLX5_RX_HASH_IPSEC_SPI = 1 << 8,
338 /* Save bits for future fields */
339 MLX5_RX_HASH_INNER = (1UL << 31),
340};
341
342struct mlx5_ib_create_qp_rss {
343 __aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
344 __u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
345 __u8 rx_key_len; /* valid only for Toeplitz */
346 __u8 reserved[6];
347 __u8 rx_hash_key[128]; /* valid only for Toeplitz */
348 __u32 comp_mask;
349 __u32 flags;
350};
351
352struct mlx5_ib_create_qp_resp {
353 __u32 bfreg_index;
354 __u32 reserved;
355};
356
357struct mlx5_ib_alloc_mw {
358 __u32 comp_mask;
359 __u8 num_klms;
360 __u8 reserved1;
361 __u16 reserved2;
362};
363
364enum mlx5_ib_create_wq_mask {
365 MLX5_IB_CREATE_WQ_STRIDING_RQ = (1 << 0),
366};
367
368struct mlx5_ib_create_wq {
369 __aligned_u64 buf_addr;
370 __aligned_u64 db_addr;
371 __u32 rq_wqe_count;
372 __u32 rq_wqe_shift;
373 __u32 user_index;
374 __u32 flags;
375 __u32 comp_mask;
376 __u32 single_stride_log_num_of_bytes;
377 __u32 single_wqe_log_num_of_strides;
378 __u32 two_byte_shift_en;
379};
380
381struct mlx5_ib_create_ah_resp {
382 __u32 response_length;
383 __u8 dmac[ETH_ALEN];
384 __u8 reserved[6];
385};
386
387struct mlx5_ib_burst_info {
388 __u32 max_burst_sz;
389 __u16 typical_pkt_sz;
390 __u16 reserved;
391};
392
393struct mlx5_ib_modify_qp {
394 __u32 comp_mask;
395 struct mlx5_ib_burst_info burst_info;
396 __u32 reserved;
397};
398
399struct mlx5_ib_modify_qp_resp {
400 __u32 response_length;
401 __u32 dctn;
402};
403
404struct mlx5_ib_create_wq_resp {
405 __u32 response_length;
406 __u32 reserved;
407};
408
409struct mlx5_ib_create_rwq_ind_tbl_resp {
410 __u32 response_length;
411 __u32 reserved;
412};
413
414struct mlx5_ib_modify_wq {
415 __u32 comp_mask;
416 __u32 reserved;
417};
418
419struct mlx5_ib_clock_info {
420 __u32 sign;
421 __u32 resv;
422 __aligned_u64 nsec;
423 __aligned_u64 cycles;
424 __aligned_u64 frac;
425 __u32 mult;
426 __u32 shift;
427 __aligned_u64 mask;
428 __aligned_u64 overflow_period;
429};
430
431enum mlx5_ib_mmap_cmd {
432 MLX5_IB_MMAP_REGULAR_PAGE = 0,
433 MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES = 1,
434 MLX5_IB_MMAP_WC_PAGE = 2,
435 MLX5_IB_MMAP_NC_PAGE = 3,
436 /* 5 is chosen in order to be compatible with old versions of libmlx5 */
437 MLX5_IB_MMAP_CORE_CLOCK = 5,
438 MLX5_IB_MMAP_ALLOC_WC = 6,
439 MLX5_IB_MMAP_CLOCK_INFO = 7,
440 MLX5_IB_MMAP_DEVICE_MEM = 8,
441};
442
443enum {
444 MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1,
445};
446
447/* Bit indexes for the mlx5_alloc_ucontext_resp.clock_info_versions bitmap */
448enum {
449 MLX5_IB_CLOCK_INFO_V1 = 0,
450};
451
452struct mlx5_ib_flow_counters_desc {
453 __u32 description;
454 __u32 index;
455};
456
457struct mlx5_ib_flow_counters_data {
458 RDMA_UAPI_PTR(struct mlx5_ib_flow_counters_desc *, counters_data);
459 __u32 ncounters;
460 __u32 reserved;
461};
462
463struct mlx5_ib_create_flow {
464 __u32 ncounters_data;
465 __u32 reserved;
466 /*
467 * Following are counters data based on ncounters_data, each
468 * entry in the data[] should match a corresponding counter object
469 * that was pointed by a counters spec upon the flow creation
470 */
471 struct mlx5_ib_flow_counters_data data[];
472};
473
474#endif /* MLX5_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/mlx5_user_ioctl_cmds.h deleted-169
...@@ -1,169 +0,0 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef MLX5_USER_IOCTL_CMDS_H
34#define MLX5_USER_IOCTL_CMDS_H
35
36#include <linux/types.h>
37#include <rdma/ib_user_ioctl_cmds.h>
38
39enum mlx5_ib_create_flow_action_attrs {
40 /* This attribute belong to the driver namespace */
41 MLX5_IB_ATTR_CREATE_FLOW_ACTION_FLAGS = (1U << UVERBS_ID_NS_SHIFT),
42};
43
44enum mlx5_ib_alloc_dm_attrs {
45 MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET = (1U << UVERBS_ID_NS_SHIFT),
46 MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,
47};
48
49enum mlx5_ib_devx_methods {
50 MLX5_IB_METHOD_DEVX_OTHER = (1U << UVERBS_ID_NS_SHIFT),
51 MLX5_IB_METHOD_DEVX_QUERY_UAR,
52 MLX5_IB_METHOD_DEVX_QUERY_EQN,
53};
54
55enum mlx5_ib_devx_other_attrs {
56 MLX5_IB_ATTR_DEVX_OTHER_CMD_IN = (1U << UVERBS_ID_NS_SHIFT),
57 MLX5_IB_ATTR_DEVX_OTHER_CMD_OUT,
58};
59
60enum mlx5_ib_devx_obj_create_attrs {
61 MLX5_IB_ATTR_DEVX_OBJ_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
62 MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_IN,
63 MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_OUT,
64};
65
66enum mlx5_ib_devx_query_uar_attrs {
67 MLX5_IB_ATTR_DEVX_QUERY_UAR_USER_IDX = (1U << UVERBS_ID_NS_SHIFT),
68 MLX5_IB_ATTR_DEVX_QUERY_UAR_DEV_IDX,
69};
70
71enum mlx5_ib_devx_obj_destroy_attrs {
72 MLX5_IB_ATTR_DEVX_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
73};
74
75enum mlx5_ib_devx_obj_modify_attrs {
76 MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
77 MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
78 MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_OUT,
79};
80
81enum mlx5_ib_devx_obj_query_attrs {
82 MLX5_IB_ATTR_DEVX_OBJ_QUERY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
83 MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_IN,
84 MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_OUT,
85};
86
87enum mlx5_ib_devx_query_eqn_attrs {
88 MLX5_IB_ATTR_DEVX_QUERY_EQN_USER_VEC = (1U << UVERBS_ID_NS_SHIFT),
89 MLX5_IB_ATTR_DEVX_QUERY_EQN_DEV_EQN,
90};
91
92enum mlx5_ib_devx_obj_methods {
93 MLX5_IB_METHOD_DEVX_OBJ_CREATE = (1U << UVERBS_ID_NS_SHIFT),
94 MLX5_IB_METHOD_DEVX_OBJ_DESTROY,
95 MLX5_IB_METHOD_DEVX_OBJ_MODIFY,
96 MLX5_IB_METHOD_DEVX_OBJ_QUERY,
97};
98
99enum mlx5_ib_devx_umem_reg_attrs {
100 MLX5_IB_ATTR_DEVX_UMEM_REG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
101 MLX5_IB_ATTR_DEVX_UMEM_REG_ADDR,
102 MLX5_IB_ATTR_DEVX_UMEM_REG_LEN,
103 MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
104 MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,
105};
106
107enum mlx5_ib_devx_umem_dereg_attrs {
108 MLX5_IB_ATTR_DEVX_UMEM_DEREG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
109};
110
111enum mlx5_ib_devx_umem_methods {
112 MLX5_IB_METHOD_DEVX_UMEM_REG = (1U << UVERBS_ID_NS_SHIFT),
113 MLX5_IB_METHOD_DEVX_UMEM_DEREG,
114};
115
116enum mlx5_ib_objects {
117 MLX5_IB_OBJECT_DEVX = (1U << UVERBS_ID_NS_SHIFT),
118 MLX5_IB_OBJECT_DEVX_OBJ,
119 MLX5_IB_OBJECT_DEVX_UMEM,
120 MLX5_IB_OBJECT_FLOW_MATCHER,
121};
122
123enum mlx5_ib_flow_matcher_create_attrs {
124 MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
125 MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK,
126 MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
127 MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
128};
129
130enum mlx5_ib_flow_matcher_destroy_attrs {
131 MLX5_IB_ATTR_FLOW_MATCHER_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
132};
133
134enum mlx5_ib_flow_matcher_methods {
135 MLX5_IB_METHOD_FLOW_MATCHER_CREATE = (1U << UVERBS_ID_NS_SHIFT),
136 MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
137};
138
139#define MLX5_IB_DW_MATCH_PARAM 0x80
140
141struct mlx5_ib_match_params {
142 __u32 match_params[MLX5_IB_DW_MATCH_PARAM];
143};
144
145enum mlx5_ib_flow_type {
146 MLX5_IB_FLOW_TYPE_NORMAL,
147 MLX5_IB_FLOW_TYPE_SNIFFER,
148 MLX5_IB_FLOW_TYPE_ALL_DEFAULT,
149 MLX5_IB_FLOW_TYPE_MC_DEFAULT,
150};
151
152enum mlx5_ib_create_flow_attrs {
153 MLX5_IB_ATTR_CREATE_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
154 MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE,
155 MLX5_IB_ATTR_CREATE_FLOW_DEST_QP,
156 MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX,
157 MLX5_IB_ATTR_CREATE_FLOW_MATCHER,
158};
159
160enum mlx5_ib_destoy_flow_attrs {
161 MLX5_IB_ATTR_DESTROY_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
162};
163
164enum mlx5_ib_flow_methods {
165 MLX5_IB_METHOD_CREATE_FLOW = (1U << UVERBS_ID_NS_SHIFT),
166 MLX5_IB_METHOD_DESTROY_FLOW,
167};
168
169#endif
\ No newline at end of file
lib/libc/include/generic-musl/rdma/mlx5_user_ioctl_verbs.h deleted-42
...@@ -1,42 +0,0 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef MLX5_USER_IOCTL_VERBS_H
34#define MLX5_USER_IOCTL_VERBS_H
35
36#include <linux/types.h>
37
38enum mlx5_ib_uapi_flow_action_flags {
39 MLX5_IB_UAPI_FLOW_ACTION_FLAGS_REQUIRE_METADATA = 1 << 0,
40};
41
42#endif
\ No newline at end of file
lib/libc/include/generic-musl/rdma/mthca-abi.h deleted-112
...@@ -1,112 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef MTHCA_ABI_USER_H
36#define MTHCA_ABI_USER_H
37
38#include <linux/types.h>
39
40/*
41 * Increment this value if any changes that break userspace ABI
42 * compatibility are made.
43 */
44#define MTHCA_UVERBS_ABI_VERSION 1
45
46/*
47 * Make sure that all structs defined in this file remain laid out so
48 * that they pack the same way on 32-bit and 64-bit architectures (to
49 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
50 * In particular do not use pointer types -- pass pointers in __u64
51 * instead.
52 */
53struct mthca_alloc_ucontext_resp {
54 __u32 qp_tab_size;
55 __u32 uarc_size;
56};
57
58struct mthca_alloc_pd_resp {
59 __u32 pdn;
60 __u32 reserved;
61};
62
63/*
64 * Mark the memory region with a DMA attribute that causes
65 * in-flight DMA to be flushed when the region is written to:
66 */
67#define MTHCA_MR_DMASYNC 0x1
68
69struct mthca_reg_mr {
70 __u32 mr_attrs;
71 __u32 reserved;
72};
73
74struct mthca_create_cq {
75 __u32 lkey;
76 __u32 pdn;
77 __aligned_u64 arm_db_page;
78 __aligned_u64 set_db_page;
79 __u32 arm_db_index;
80 __u32 set_db_index;
81};
82
83struct mthca_create_cq_resp {
84 __u32 cqn;
85 __u32 reserved;
86};
87
88struct mthca_resize_cq {
89 __u32 lkey;
90 __u32 reserved;
91};
92
93struct mthca_create_srq {
94 __u32 lkey;
95 __u32 db_index;
96 __aligned_u64 db_page;
97};
98
99struct mthca_create_srq_resp {
100 __u32 srqn;
101 __u32 reserved;
102};
103
104struct mthca_create_qp {
105 __u32 lkey;
106 __u32 reserved;
107 __aligned_u64 sq_db_page;
108 __aligned_u64 rq_db_page;
109 __u32 sq_db_index;
110 __u32 rq_db_index;
111};
112#endif /* MTHCA_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/nes-abi.h deleted-115
...@@ -1,115 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
4 * Copyright (c) 2005 Topspin Communications. All rights reserved.
5 * Copyright (c) 2005 Cisco Systems. All rights reserved.
6 * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
7 *
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * OpenIB.org BSD license below:
13 *
14 * Redistribution and use in source and binary forms, with or
15 * without modification, are permitted provided that the following
16 * conditions are met:
17 *
18 * - Redistributions of source code must retain the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer.
21 *
22 * - Redistributions in binary form must reproduce the above
23 * copyright notice, this list of conditions and the following
24 * disclaimer in the documentation and/or other materials
25 * provided with the distribution.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
31 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
32 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
33 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 * SOFTWARE.
35 *
36 */
37
38#ifndef NES_ABI_USER_H
39#define NES_ABI_USER_H
40
41#include <linux/types.h>
42
43#define NES_ABI_USERSPACE_VER 2
44#define NES_ABI_KERNEL_VER 2
45
46/*
47 * Make sure that all structs defined in this file remain laid out so
48 * that they pack the same way on 32-bit and 64-bit architectures (to
49 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
50 * In particular do not use pointer types -- pass pointers in __u64
51 * instead.
52 */
53
54struct nes_alloc_ucontext_req {
55 __u32 reserved32;
56 __u8 userspace_ver;
57 __u8 reserved8[3];
58};
59
60struct nes_alloc_ucontext_resp {
61 __u32 max_pds; /* maximum pds allowed for this user process */
62 __u32 max_qps; /* maximum qps allowed for this user process */
63 __u32 wq_size; /* size of the WQs (sq+rq) allocated to the mmaped area */
64 __u8 virtwq; /* flag to indicate if virtual WQ are to be used or not */
65 __u8 kernel_ver;
66 __u8 reserved[2];
67};
68
69struct nes_alloc_pd_resp {
70 __u32 pd_id;
71 __u32 mmap_db_index;
72};
73
74struct nes_create_cq_req {
75 __aligned_u64 user_cq_buffer;
76 __u32 mcrqf;
77 __u8 reserved[4];
78};
79
80struct nes_create_qp_req {
81 __aligned_u64 user_wqe_buffers;
82 __aligned_u64 user_qp_buffer;
83};
84
85enum iwnes_memreg_type {
86 IWNES_MEMREG_TYPE_MEM = 0x0000,
87 IWNES_MEMREG_TYPE_QP = 0x0001,
88 IWNES_MEMREG_TYPE_CQ = 0x0002,
89 IWNES_MEMREG_TYPE_MW = 0x0003,
90 IWNES_MEMREG_TYPE_FMR = 0x0004,
91 IWNES_MEMREG_TYPE_FMEM = 0x0005,
92};
93
94struct nes_mem_reg_req {
95 __u32 reg_type; /* indicates if id is memory, QP or CQ */
96 __u32 reserved;
97};
98
99struct nes_create_cq_resp {
100 __u32 cq_id;
101 __u32 cq_size;
102 __u32 mmap_db_index;
103 __u32 reserved;
104};
105
106struct nes_create_qp_resp {
107 __u32 qp_id;
108 __u32 actual_sq_size;
109 __u32 actual_rq_size;
110 __u32 mmap_sq_db_index;
111 __u32 mmap_rq_db_index;
112 __u32 nes_drv_opt;
113};
114
115#endif /* NES_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/ocrdma-abi.h deleted-152
...@@ -1,152 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/* This file is part of the Emulex RoCE Device Driver for
3 * RoCE (RDMA over Converged Ethernet) adapters.
4 * Copyright (C) 2012-2015 Emulex. All rights reserved.
5 * EMULEX and SLI are trademarks of Emulex.
6 * www.emulex.com
7 *
8 * This software is available to you under a choice of one of two licenses.
9 * You may choose to be licensed under the terms of the GNU General Public
10 * License (GPL) Version 2, available from the file COPYING in the main
11 * directory of this source tree, or the BSD license below:
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 *
17 * - Redistributions of source code must retain the above copyright notice,
18 * this list of conditions and the following disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in
22 * the documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *
36 * Contact Information:
37 * linux-drivers@emulex.com
38 *
39 * Emulex
40 * 3333 Susan Street
41 * Costa Mesa, CA 92626
42 */
43
44#ifndef OCRDMA_ABI_USER_H
45#define OCRDMA_ABI_USER_H
46
47#include <linux/types.h>
48
49#define OCRDMA_ABI_VERSION 2
50#define OCRDMA_BE_ROCE_ABI_VERSION 1
51/* user kernel communication data structures. */
52
53struct ocrdma_alloc_ucontext_resp {
54 __u32 dev_id;
55 __u32 wqe_size;
56 __u32 max_inline_data;
57 __u32 dpp_wqe_size;
58 __aligned_u64 ah_tbl_page;
59 __u32 ah_tbl_len;
60 __u32 rqe_size;
61 __u8 fw_ver[32];
62 /* for future use/new features in progress */
63 __aligned_u64 rsvd1;
64 __aligned_u64 rsvd2;
65};
66
67struct ocrdma_alloc_pd_ureq {
68 __u32 rsvd[2];
69};
70
71struct ocrdma_alloc_pd_uresp {
72 __u32 id;
73 __u32 dpp_enabled;
74 __u32 dpp_page_addr_hi;
75 __u32 dpp_page_addr_lo;
76 __u32 rsvd[2];
77};
78
79struct ocrdma_create_cq_ureq {
80 __u32 dpp_cq;
81 __u32 rsvd; /* pad */
82};
83
84#define MAX_CQ_PAGES 8
85struct ocrdma_create_cq_uresp {
86 __u32 cq_id;
87 __u32 page_size;
88 __u32 num_pages;
89 __u32 max_hw_cqe;
90 __aligned_u64 page_addr[MAX_CQ_PAGES];
91 __aligned_u64 db_page_addr;
92 __u32 db_page_size;
93 __u32 phase_change;
94 /* for future use/new features in progress */
95 __aligned_u64 rsvd1;
96 __aligned_u64 rsvd2;
97};
98
99#define MAX_QP_PAGES 8
100#define MAX_UD_AV_PAGES 8
101
102struct ocrdma_create_qp_ureq {
103 __u8 enable_dpp_cq;
104 __u8 rsvd;
105 __u16 dpp_cq_id;
106 __u32 rsvd1; /* pad */
107};
108
109struct ocrdma_create_qp_uresp {
110 __u16 qp_id;
111 __u16 sq_dbid;
112 __u16 rq_dbid;
113 __u16 resv0; /* pad */
114 __u32 sq_page_size;
115 __u32 rq_page_size;
116 __u32 num_sq_pages;
117 __u32 num_rq_pages;
118 __aligned_u64 sq_page_addr[MAX_QP_PAGES];
119 __aligned_u64 rq_page_addr[MAX_QP_PAGES];
120 __aligned_u64 db_page_addr;
121 __u32 db_page_size;
122 __u32 dpp_credit;
123 __u32 dpp_offset;
124 __u32 num_wqe_allocated;
125 __u32 num_rqe_allocated;
126 __u32 db_sq_offset;
127 __u32 db_rq_offset;
128 __u32 db_shift;
129 __aligned_u64 rsvd[11];
130};
131
132struct ocrdma_create_srq_uresp {
133 __u16 rq_dbid;
134 __u16 resv0; /* pad */
135 __u32 resv1;
136
137 __u32 rq_page_size;
138 __u32 num_rq_pages;
139
140 __aligned_u64 rq_page_addr[MAX_QP_PAGES];
141 __aligned_u64 db_page_addr;
142
143 __u32 db_page_size;
144 __u32 num_rqe_allocated;
145 __u32 db_rq_offset;
146 __u32 db_shift;
147
148 __aligned_u64 rsvd2;
149 __aligned_u64 rsvd3;
150};
151
152#endif /* OCRDMA_ABI_USER_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/qedr-abi.h deleted-131
...@@ -1,131 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/* QLogic qedr NIC Driver
3 * Copyright (c) 2015-2016 QLogic Corporation
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and /or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33#ifndef __QEDR_USER_H__
34#define __QEDR_USER_H__
35
36#include <linux/types.h>
37
38#define QEDR_ABI_VERSION (8)
39
40/* user kernel communication data structures. */
41
42struct qedr_alloc_ucontext_resp {
43 __aligned_u64 db_pa;
44 __u32 db_size;
45
46 __u32 max_send_wr;
47 __u32 max_recv_wr;
48 __u32 max_srq_wr;
49 __u32 sges_per_send_wr;
50 __u32 sges_per_recv_wr;
51 __u32 sges_per_srq_wr;
52 __u32 max_cqes;
53 __u8 dpm_enabled;
54 __u8 wids_enabled;
55 __u16 wid_count;
56 __u32 reserved;
57};
58
59struct qedr_alloc_pd_ureq {
60 __aligned_u64 rsvd1;
61};
62
63struct qedr_alloc_pd_uresp {
64 __u32 pd_id;
65 __u32 reserved;
66};
67
68struct qedr_create_cq_ureq {
69 __aligned_u64 addr;
70 __aligned_u64 len;
71};
72
73struct qedr_create_cq_uresp {
74 __u32 db_offset;
75 __u16 icid;
76 __u16 reserved;
77};
78
79struct qedr_create_qp_ureq {
80 __u32 qp_handle_hi;
81 __u32 qp_handle_lo;
82
83 /* SQ */
84 /* user space virtual address of SQ buffer */
85 __aligned_u64 sq_addr;
86
87 /* length of SQ buffer */
88 __aligned_u64 sq_len;
89
90 /* RQ */
91 /* user space virtual address of RQ buffer */
92 __aligned_u64 rq_addr;
93
94 /* length of RQ buffer */
95 __aligned_u64 rq_len;
96};
97
98struct qedr_create_qp_uresp {
99 __u32 qp_id;
100 __u32 atomic_supported;
101
102 /* SQ */
103 __u32 sq_db_offset;
104 __u16 sq_icid;
105
106 /* RQ */
107 __u32 rq_db_offset;
108 __u16 rq_icid;
109
110 __u32 rq_db2_offset;
111 __u32 reserved;
112};
113
114struct qedr_create_srq_ureq {
115 /* user space virtual address of producer pair */
116 __aligned_u64 prod_pair_addr;
117
118 /* user space virtual address of SRQ buffer */
119 __aligned_u64 srq_addr;
120
121 /* length of SRQ buffer */
122 __aligned_u64 srq_len;
123};
124
125struct qedr_create_srq_uresp {
126 __u16 srq_id;
127 __u16 reserved0;
128 __u32 reserved1;
129};
130
131#endif /* __QEDR_USER_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/rdma_netlink.h deleted-434
...@@ -1,434 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _RDMA_NETLINK_H
3#define _RDMA_NETLINK_H
4
5#include <linux/types.h>
6
7enum {
8 RDMA_NL_RDMA_CM = 1,
9 RDMA_NL_IWCM,
10 RDMA_NL_RSVD,
11 RDMA_NL_LS, /* RDMA Local Services */
12 RDMA_NL_NLDEV, /* RDMA device interface */
13 RDMA_NL_NUM_CLIENTS
14};
15
16enum {
17 RDMA_NL_GROUP_CM = 1,
18 RDMA_NL_GROUP_IWPM,
19 RDMA_NL_GROUP_LS,
20 RDMA_NL_NUM_GROUPS
21};
22
23#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
24#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
25#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
26
27enum {
28 RDMA_NL_RDMA_CM_ID_STATS = 0,
29 RDMA_NL_RDMA_CM_NUM_OPS
30};
31
32enum {
33 RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
34 RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
35 RDMA_NL_RDMA_CM_NUM_ATTR,
36};
37
38/* iwarp port mapper op-codes */
39enum {
40 RDMA_NL_IWPM_REG_PID = 0,
41 RDMA_NL_IWPM_ADD_MAPPING,
42 RDMA_NL_IWPM_QUERY_MAPPING,
43 RDMA_NL_IWPM_REMOVE_MAPPING,
44 RDMA_NL_IWPM_REMOTE_INFO,
45 RDMA_NL_IWPM_HANDLE_ERR,
46 RDMA_NL_IWPM_MAPINFO,
47 RDMA_NL_IWPM_MAPINFO_NUM,
48 RDMA_NL_IWPM_NUM_OPS
49};
50
51struct rdma_cm_id_stats {
52 __u32 qp_num;
53 __u32 bound_dev_if;
54 __u32 port_space;
55 __s32 pid;
56 __u8 cm_state;
57 __u8 node_type;
58 __u8 port_num;
59 __u8 qp_type;
60};
61
62enum {
63 IWPM_NLA_REG_PID_UNSPEC = 0,
64 IWPM_NLA_REG_PID_SEQ,
65 IWPM_NLA_REG_IF_NAME,
66 IWPM_NLA_REG_IBDEV_NAME,
67 IWPM_NLA_REG_ULIB_NAME,
68 IWPM_NLA_REG_PID_MAX
69};
70
71enum {
72 IWPM_NLA_RREG_PID_UNSPEC = 0,
73 IWPM_NLA_RREG_PID_SEQ,
74 IWPM_NLA_RREG_IBDEV_NAME,
75 IWPM_NLA_RREG_ULIB_NAME,
76 IWPM_NLA_RREG_ULIB_VER,
77 IWPM_NLA_RREG_PID_ERR,
78 IWPM_NLA_RREG_PID_MAX
79
80};
81
82enum {
83 IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
84 IWPM_NLA_MANAGE_MAPPING_SEQ,
85 IWPM_NLA_MANAGE_ADDR,
86 IWPM_NLA_MANAGE_MAPPED_LOC_ADDR,
87 IWPM_NLA_RMANAGE_MAPPING_ERR,
88 IWPM_NLA_RMANAGE_MAPPING_MAX
89};
90
91#define IWPM_NLA_MANAGE_MAPPING_MAX 3
92#define IWPM_NLA_QUERY_MAPPING_MAX 4
93#define IWPM_NLA_MAPINFO_SEND_MAX 3
94
95enum {
96 IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
97 IWPM_NLA_QUERY_MAPPING_SEQ,
98 IWPM_NLA_QUERY_LOCAL_ADDR,
99 IWPM_NLA_QUERY_REMOTE_ADDR,
100 IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
101 IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
102 IWPM_NLA_RQUERY_MAPPING_ERR,
103 IWPM_NLA_RQUERY_MAPPING_MAX
104};
105
106enum {
107 IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
108 IWPM_NLA_MAPINFO_ULIB_NAME,
109 IWPM_NLA_MAPINFO_ULIB_VER,
110 IWPM_NLA_MAPINFO_REQ_MAX
111};
112
113enum {
114 IWPM_NLA_MAPINFO_UNSPEC = 0,
115 IWPM_NLA_MAPINFO_LOCAL_ADDR,
116 IWPM_NLA_MAPINFO_MAPPED_ADDR,
117 IWPM_NLA_MAPINFO_MAX
118};
119
120enum {
121 IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
122 IWPM_NLA_MAPINFO_SEQ,
123 IWPM_NLA_MAPINFO_SEND_NUM,
124 IWPM_NLA_MAPINFO_ACK_NUM,
125 IWPM_NLA_MAPINFO_NUM_MAX
126};
127
128enum {
129 IWPM_NLA_ERR_UNSPEC = 0,
130 IWPM_NLA_ERR_SEQ,
131 IWPM_NLA_ERR_CODE,
132 IWPM_NLA_ERR_MAX
133};
134
135/*
136 * Local service operations:
137 * RESOLVE - The client requests the local service to resolve a path.
138 * SET_TIMEOUT - The local service requests the client to set the timeout.
139 * IP_RESOLVE - The client requests the local service to resolve an IP to GID.
140 */
141enum {
142 RDMA_NL_LS_OP_RESOLVE = 0,
143 RDMA_NL_LS_OP_SET_TIMEOUT,
144 RDMA_NL_LS_OP_IP_RESOLVE,
145 RDMA_NL_LS_NUM_OPS
146};
147
148/* Local service netlink message flags */
149#define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */
150
151/*
152 * Local service resolve operation family header.
153 * The layout for the resolve operation:
154 * nlmsg header
155 * family header
156 * attributes
157 */
158
159/*
160 * Local service path use:
161 * Specify how the path(s) will be used.
162 * ALL - For connected CM operation (6 pathrecords)
163 * UNIDIRECTIONAL - For unidirectional UD (1 pathrecord)
164 * GMP - For miscellaneous GMP like operation (at least 1 reversible
165 * pathrecord)
166 */
167enum {
168 LS_RESOLVE_PATH_USE_ALL = 0,
169 LS_RESOLVE_PATH_USE_UNIDIRECTIONAL,
170 LS_RESOLVE_PATH_USE_GMP,
171 LS_RESOLVE_PATH_USE_MAX
172};
173
174#define LS_DEVICE_NAME_MAX 64
175
176struct rdma_ls_resolve_header {
177 __u8 device_name[LS_DEVICE_NAME_MAX];
178 __u8 port_num;
179 __u8 path_use;
180};
181
182struct rdma_ls_ip_resolve_header {
183 __u32 ifindex;
184};
185
186/* Local service attribute type */
187#define RDMA_NLA_F_MANDATORY (1 << 13)
188#define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
189 RDMA_NLA_F_MANDATORY))
190
191/*
192 * Local service attributes:
193 * Attr Name Size Byte order
194 * -----------------------------------------------------
195 * PATH_RECORD struct ib_path_rec_data
196 * TIMEOUT u32 cpu
197 * SERVICE_ID u64 cpu
198 * DGID u8[16] BE
199 * SGID u8[16] BE
200 * TCLASS u8
201 * PKEY u16 cpu
202 * QOS_CLASS u16 cpu
203 * IPV4 u32 BE
204 * IPV6 u8[16] BE
205 */
206enum {
207 LS_NLA_TYPE_UNSPEC = 0,
208 LS_NLA_TYPE_PATH_RECORD,
209 LS_NLA_TYPE_TIMEOUT,
210 LS_NLA_TYPE_SERVICE_ID,
211 LS_NLA_TYPE_DGID,
212 LS_NLA_TYPE_SGID,
213 LS_NLA_TYPE_TCLASS,
214 LS_NLA_TYPE_PKEY,
215 LS_NLA_TYPE_QOS_CLASS,
216 LS_NLA_TYPE_IPV4,
217 LS_NLA_TYPE_IPV6,
218 LS_NLA_TYPE_MAX
219};
220
221/* Local service DGID/SGID attribute: big endian */
222struct rdma_nla_ls_gid {
223 __u8 gid[16];
224};
225
226enum rdma_nldev_command {
227 RDMA_NLDEV_CMD_UNSPEC,
228
229 RDMA_NLDEV_CMD_GET, /* can dump */
230
231 /* 2 - 4 are free to use */
232
233 RDMA_NLDEV_CMD_PORT_GET = 5, /* can dump */
234
235 /* 6 - 8 are free to use */
236
237 RDMA_NLDEV_CMD_RES_GET = 9, /* can dump */
238
239 RDMA_NLDEV_CMD_RES_QP_GET, /* can dump */
240
241 RDMA_NLDEV_CMD_RES_CM_ID_GET, /* can dump */
242
243 RDMA_NLDEV_CMD_RES_CQ_GET, /* can dump */
244
245 RDMA_NLDEV_CMD_RES_MR_GET, /* can dump */
246
247 RDMA_NLDEV_CMD_RES_PD_GET, /* can dump */
248
249 RDMA_NLDEV_NUM_OPS
250};
251
252enum {
253 RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
254};
255
256enum rdma_nldev_print_type {
257 RDMA_NLDEV_PRINT_TYPE_UNSPEC,
258 RDMA_NLDEV_PRINT_TYPE_HEX,
259};
260
261enum rdma_nldev_attr {
262 /* don't change the order or add anything between, this is ABI! */
263 RDMA_NLDEV_ATTR_UNSPEC,
264
265 /* Pad attribute for 64b alignment */
266 RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
267
268 /* Identifier for ib_device */
269 RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
270
271 RDMA_NLDEV_ATTR_DEV_NAME, /* string */
272 /*
273 * Device index together with port index are identifiers
274 * for port/link properties.
275 *
276 * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
277 * of available ports in ib_device, while for port specific operations,
278 * it will be real port index as it appears in sysfs. Port index follows
279 * sysfs notation and starts from 1 for the first port.
280 */
281 RDMA_NLDEV_ATTR_PORT_INDEX, /* u32 */
282
283 /*
284 * Device and port capabilities
285 */
286 RDMA_NLDEV_ATTR_CAP_FLAGS, /* u64 */
287
288 /*
289 * FW version
290 */
291 RDMA_NLDEV_ATTR_FW_VERSION, /* string */
292
293 /*
294 * Node GUID (in host byte order) associated with the RDMA device.
295 */
296 RDMA_NLDEV_ATTR_NODE_GUID, /* u64 */
297
298 /*
299 * System image GUID (in host byte order) associated with
300 * this RDMA device and other devices which are part of a
301 * single system.
302 */
303 RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */
304
305 /*
306 * Subnet prefix (in host byte order)
307 */
308 RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
309
310 /*
311 * Local Identifier (LID),
312 * According to IB specification, It is 16-bit address assigned
313 * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
314 */
315 RDMA_NLDEV_ATTR_LID, /* u32 */
316 RDMA_NLDEV_ATTR_SM_LID, /* u32 */
317
318 /*
319 * LID mask control (LMC)
320 */
321 RDMA_NLDEV_ATTR_LMC, /* u8 */
322
323 RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
324 RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
325
326 RDMA_NLDEV_ATTR_DEV_NODE_TYPE, /* u8 */
327
328 RDMA_NLDEV_ATTR_RES_SUMMARY, /* nested table */
329 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY, /* nested table */
330 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME, /* string */
331 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR, /* u64 */
332
333 RDMA_NLDEV_ATTR_RES_QP, /* nested table */
334 RDMA_NLDEV_ATTR_RES_QP_ENTRY, /* nested table */
335 /*
336 * Local QPN
337 */
338 RDMA_NLDEV_ATTR_RES_LQPN, /* u32 */
339 /*
340 * Remote QPN,
341 * Applicable for RC and UC only IBTA 11.2.5.3 QUERY QUEUE PAIR
342 */
343 RDMA_NLDEV_ATTR_RES_RQPN, /* u32 */
344 /*
345 * Receive Queue PSN,
346 * Applicable for RC and UC only 11.2.5.3 QUERY QUEUE PAIR
347 */
348 RDMA_NLDEV_ATTR_RES_RQ_PSN, /* u32 */
349 /*
350 * Send Queue PSN
351 */
352 RDMA_NLDEV_ATTR_RES_SQ_PSN, /* u32 */
353 RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE, /* u8 */
354 /*
355 * QP types as visible to RDMA/core, the reserved QPT
356 * are not exported through this interface.
357 */
358 RDMA_NLDEV_ATTR_RES_TYPE, /* u8 */
359 RDMA_NLDEV_ATTR_RES_STATE, /* u8 */
360 /*
361 * Process ID which created object,
362 * in case of kernel origin, PID won't exist.
363 */
364 RDMA_NLDEV_ATTR_RES_PID, /* u32 */
365 /*
366 * The name of process created following resource.
367 * It will exist only for kernel objects.
368 * For user created objects, the user is supposed
369 * to read /proc/PID/comm file.
370 */
371 RDMA_NLDEV_ATTR_RES_KERN_NAME, /* string */
372
373 RDMA_NLDEV_ATTR_RES_CM_ID, /* nested table */
374 RDMA_NLDEV_ATTR_RES_CM_ID_ENTRY, /* nested table */
375 /*
376 * rdma_cm_id port space.
377 */
378 RDMA_NLDEV_ATTR_RES_PS, /* u32 */
379 /*
380 * Source and destination socket addresses
381 */
382 RDMA_NLDEV_ATTR_RES_SRC_ADDR, /* __kernel_sockaddr_storage */
383 RDMA_NLDEV_ATTR_RES_DST_ADDR, /* __kernel_sockaddr_storage */
384
385 RDMA_NLDEV_ATTR_RES_CQ, /* nested table */
386 RDMA_NLDEV_ATTR_RES_CQ_ENTRY, /* nested table */
387 RDMA_NLDEV_ATTR_RES_CQE, /* u32 */
388 RDMA_NLDEV_ATTR_RES_USECNT, /* u64 */
389 RDMA_NLDEV_ATTR_RES_POLL_CTX, /* u8 */
390
391 RDMA_NLDEV_ATTR_RES_MR, /* nested table */
392 RDMA_NLDEV_ATTR_RES_MR_ENTRY, /* nested table */
393 RDMA_NLDEV_ATTR_RES_RKEY, /* u32 */
394 RDMA_NLDEV_ATTR_RES_LKEY, /* u32 */
395 RDMA_NLDEV_ATTR_RES_IOVA, /* u64 */
396 RDMA_NLDEV_ATTR_RES_MRLEN, /* u64 */
397
398 RDMA_NLDEV_ATTR_RES_PD, /* nested table */
399 RDMA_NLDEV_ATTR_RES_PD_ENTRY, /* nested table */
400 RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
401 RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
402 /*
403 * Provides logical name and index of netdevice which is
404 * connected to physical port. This information is relevant
405 * for RoCE and iWARP.
406 *
407 * The netdevices which are associated with containers are
408 * supposed to be exported together with GID table once it
409 * will be exposed through the netlink. Because the
410 * associated netdevices are properties of GIDs.
411 */
412 RDMA_NLDEV_ATTR_NDEV_INDEX, /* u32 */
413 RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
414 /*
415 * driver-specific attributes.
416 */
417 RDMA_NLDEV_ATTR_DRIVER, /* nested table */
418 RDMA_NLDEV_ATTR_DRIVER_ENTRY, /* nested table */
419 RDMA_NLDEV_ATTR_DRIVER_STRING, /* string */
420 /*
421 * u8 values from enum rdma_nldev_print_type
422 */
423 RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE, /* u8 */
424 RDMA_NLDEV_ATTR_DRIVER_S32, /* s32 */
425 RDMA_NLDEV_ATTR_DRIVER_U32, /* u32 */
426 RDMA_NLDEV_ATTR_DRIVER_S64, /* s64 */
427 RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */
428
429 /*
430 * Always the end
431 */
432 RDMA_NLDEV_ATTR_MAX
433};
434#endif /* _RDMA_NETLINK_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/rdma_user_cm.h deleted-324
...@@ -1,324 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2005-2006 Intel Corporation. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef RDMA_USER_CM_H
35#define RDMA_USER_CM_H
36
37#include <linux/types.h>
38#include <linux/socket.h>
39#include <linux/in6.h>
40#include <rdma/ib_user_verbs.h>
41#include <rdma/ib_user_sa.h>
42
43#define RDMA_USER_CM_ABI_VERSION 4
44
45#define RDMA_MAX_PRIVATE_DATA 256
46
47enum {
48 RDMA_USER_CM_CMD_CREATE_ID,
49 RDMA_USER_CM_CMD_DESTROY_ID,
50 RDMA_USER_CM_CMD_BIND_IP,
51 RDMA_USER_CM_CMD_RESOLVE_IP,
52 RDMA_USER_CM_CMD_RESOLVE_ROUTE,
53 RDMA_USER_CM_CMD_QUERY_ROUTE,
54 RDMA_USER_CM_CMD_CONNECT,
55 RDMA_USER_CM_CMD_LISTEN,
56 RDMA_USER_CM_CMD_ACCEPT,
57 RDMA_USER_CM_CMD_REJECT,
58 RDMA_USER_CM_CMD_DISCONNECT,
59 RDMA_USER_CM_CMD_INIT_QP_ATTR,
60 RDMA_USER_CM_CMD_GET_EVENT,
61 RDMA_USER_CM_CMD_GET_OPTION,
62 RDMA_USER_CM_CMD_SET_OPTION,
63 RDMA_USER_CM_CMD_NOTIFY,
64 RDMA_USER_CM_CMD_JOIN_IP_MCAST,
65 RDMA_USER_CM_CMD_LEAVE_MCAST,
66 RDMA_USER_CM_CMD_MIGRATE_ID,
67 RDMA_USER_CM_CMD_QUERY,
68 RDMA_USER_CM_CMD_BIND,
69 RDMA_USER_CM_CMD_RESOLVE_ADDR,
70 RDMA_USER_CM_CMD_JOIN_MCAST
71};
72
73/* See IBTA Annex A11, servies ID bytes 4 & 5 */
74enum rdma_ucm_port_space {
75 RDMA_PS_IPOIB = 0x0002,
76 RDMA_PS_IB = 0x013F,
77 RDMA_PS_TCP = 0x0106,
78 RDMA_PS_UDP = 0x0111,
79};
80
81/*
82 * command ABI structures.
83 */
84struct rdma_ucm_cmd_hdr {
85 __u32 cmd;
86 __u16 in;
87 __u16 out;
88};
89
90struct rdma_ucm_create_id {
91 __aligned_u64 uid;
92 __aligned_u64 response;
93 __u16 ps; /* use enum rdma_ucm_port_space */
94 __u8 qp_type;
95 __u8 reserved[5];
96};
97
98struct rdma_ucm_create_id_resp {
99 __u32 id;
100};
101
102struct rdma_ucm_destroy_id {
103 __aligned_u64 response;
104 __u32 id;
105 __u32 reserved;
106};
107
108struct rdma_ucm_destroy_id_resp {
109 __u32 events_reported;
110};
111
112struct rdma_ucm_bind_ip {
113 __aligned_u64 response;
114 struct sockaddr_in6 addr;
115 __u32 id;
116};
117
118struct rdma_ucm_bind {
119 __u32 id;
120 __u16 addr_size;
121 __u16 reserved;
122 struct __kernel_sockaddr_storage addr;
123};
124
125struct rdma_ucm_resolve_ip {
126 struct sockaddr_in6 src_addr;
127 struct sockaddr_in6 dst_addr;
128 __u32 id;
129 __u32 timeout_ms;
130};
131
132struct rdma_ucm_resolve_addr {
133 __u32 id;
134 __u32 timeout_ms;
135 __u16 src_size;
136 __u16 dst_size;
137 __u32 reserved;
138 struct __kernel_sockaddr_storage src_addr;
139 struct __kernel_sockaddr_storage dst_addr;
140};
141
142struct rdma_ucm_resolve_route {
143 __u32 id;
144 __u32 timeout_ms;
145};
146
147enum {
148 RDMA_USER_CM_QUERY_ADDR,
149 RDMA_USER_CM_QUERY_PATH,
150 RDMA_USER_CM_QUERY_GID
151};
152
153struct rdma_ucm_query {
154 __aligned_u64 response;
155 __u32 id;
156 __u32 option;
157};
158
159struct rdma_ucm_query_route_resp {
160 __aligned_u64 node_guid;
161 struct ib_user_path_rec ib_route[2];
162 struct sockaddr_in6 src_addr;
163 struct sockaddr_in6 dst_addr;
164 __u32 num_paths;
165 __u8 port_num;
166 __u8 reserved[3];
167};
168
169struct rdma_ucm_query_addr_resp {
170 __aligned_u64 node_guid;
171 __u8 port_num;
172 __u8 reserved;
173 __u16 pkey;
174 __u16 src_size;
175 __u16 dst_size;
176 struct __kernel_sockaddr_storage src_addr;
177 struct __kernel_sockaddr_storage dst_addr;
178};
179
180struct rdma_ucm_query_path_resp {
181 __u32 num_paths;
182 __u32 reserved;
183 struct ib_path_rec_data path_data[0];
184};
185
186struct rdma_ucm_conn_param {
187 __u32 qp_num;
188 __u32 qkey;
189 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
190 __u8 private_data_len;
191 __u8 srq;
192 __u8 responder_resources;
193 __u8 initiator_depth;
194 __u8 flow_control;
195 __u8 retry_count;
196 __u8 rnr_retry_count;
197 __u8 valid;
198};
199
200struct rdma_ucm_ud_param {
201 __u32 qp_num;
202 __u32 qkey;
203 struct ib_uverbs_ah_attr ah_attr;
204 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
205 __u8 private_data_len;
206 __u8 reserved[7];
207};
208
209struct rdma_ucm_connect {
210 struct rdma_ucm_conn_param conn_param;
211 __u32 id;
212 __u32 reserved;
213};
214
215struct rdma_ucm_listen {
216 __u32 id;
217 __u32 backlog;
218};
219
220struct rdma_ucm_accept {
221 __aligned_u64 uid;
222 struct rdma_ucm_conn_param conn_param;
223 __u32 id;
224 __u32 reserved;
225};
226
227struct rdma_ucm_reject {
228 __u32 id;
229 __u8 private_data_len;
230 __u8 reserved[3];
231 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
232};
233
234struct rdma_ucm_disconnect {
235 __u32 id;
236};
237
238struct rdma_ucm_init_qp_attr {
239 __aligned_u64 response;
240 __u32 id;
241 __u32 qp_state;
242};
243
244struct rdma_ucm_notify {
245 __u32 id;
246 __u32 event;
247};
248
249struct rdma_ucm_join_ip_mcast {
250 __aligned_u64 response; /* rdma_ucm_create_id_resp */
251 __aligned_u64 uid;
252 struct sockaddr_in6 addr;
253 __u32 id;
254};
255
256/* Multicast join flags */
257enum {
258 RDMA_MC_JOIN_FLAG_FULLMEMBER,
259 RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
260 RDMA_MC_JOIN_FLAG_RESERVED,
261};
262
263struct rdma_ucm_join_mcast {
264 __aligned_u64 response; /* rdma_ucma_create_id_resp */
265 __aligned_u64 uid;
266 __u32 id;
267 __u16 addr_size;
268 __u16 join_flags;
269 struct __kernel_sockaddr_storage addr;
270};
271
272struct rdma_ucm_get_event {
273 __aligned_u64 response;
274};
275
276struct rdma_ucm_event_resp {
277 __aligned_u64 uid;
278 __u32 id;
279 __u32 event;
280 __u32 status;
281 /*
282 * NOTE: This union is not aligned to 8 bytes so none of the union
283 * members may contain a u64 or anything with higher alignment than 4.
284 */
285 union {
286 struct rdma_ucm_conn_param conn;
287 struct rdma_ucm_ud_param ud;
288 } param;
289 __u32 reserved;
290};
291
292/* Option levels */
293enum {
294 RDMA_OPTION_ID = 0,
295 RDMA_OPTION_IB = 1
296};
297
298/* Option details */
299enum {
300 RDMA_OPTION_ID_TOS = 0,
301 RDMA_OPTION_ID_REUSEADDR = 1,
302 RDMA_OPTION_ID_AFONLY = 2,
303 RDMA_OPTION_IB_PATH = 1
304};
305
306struct rdma_ucm_set_option {
307 __aligned_u64 optval;
308 __u32 id;
309 __u32 level;
310 __u32 optname;
311 __u32 optlen;
312};
313
314struct rdma_ucm_migrate_id {
315 __aligned_u64 response;
316 __u32 id;
317 __u32 fd;
318};
319
320struct rdma_ucm_migrate_resp {
321 __u32 events_reported;
322};
323
324#endif /* RDMA_USER_CM_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/rdma_user_ioctl.h deleted-85
...@@ -1,85 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2016 Mellanox Technologies, LTD. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef RDMA_USER_IOCTL_H
35#define RDMA_USER_IOCTL_H
36
37#include <rdma/ib_user_mad.h>
38#include <rdma/hfi/hfi1_ioctl.h>
39#include <rdma/rdma_user_ioctl_cmds.h>
40
41/* Legacy name, for user space application which already use it */
42#define IB_IOCTL_MAGIC RDMA_IOCTL_MAGIC
43
44/*
45 * General blocks assignments
46 * It is closed on purpose do not expose it it user space
47 * #define MAD_CMD_BASE 0x00
48 * #define HFI1_CMD_BAS 0xE0
49 */
50
51/* MAD specific section */
52#define IB_USER_MAD_REGISTER_AGENT _IOWR(RDMA_IOCTL_MAGIC, 0x01, struct ib_user_mad_reg_req)
53#define IB_USER_MAD_UNREGISTER_AGENT _IOW(RDMA_IOCTL_MAGIC, 0x02, __u32)
54#define IB_USER_MAD_ENABLE_PKEY _IO(RDMA_IOCTL_MAGIC, 0x03)
55#define IB_USER_MAD_REGISTER_AGENT2 _IOWR(RDMA_IOCTL_MAGIC, 0x04, struct ib_user_mad_reg_req2)
56
57/* HFI specific section */
58/* allocate HFI and context */
59#define HFI1_IOCTL_ASSIGN_CTXT _IOWR(RDMA_IOCTL_MAGIC, 0xE1, struct hfi1_user_info)
60/* find out what resources we got */
61#define HFI1_IOCTL_CTXT_INFO _IOW(RDMA_IOCTL_MAGIC, 0xE2, struct hfi1_ctxt_info)
62/* set up userspace */
63#define HFI1_IOCTL_USER_INFO _IOW(RDMA_IOCTL_MAGIC, 0xE3, struct hfi1_base_info)
64/* update expected TID entries */
65#define HFI1_IOCTL_TID_UPDATE _IOWR(RDMA_IOCTL_MAGIC, 0xE4, struct hfi1_tid_info)
66/* free expected TID entries */
67#define HFI1_IOCTL_TID_FREE _IOWR(RDMA_IOCTL_MAGIC, 0xE5, struct hfi1_tid_info)
68/* force an update of PIO credit */
69#define HFI1_IOCTL_CREDIT_UPD _IO(RDMA_IOCTL_MAGIC, 0xE6)
70/* control receipt of packets */
71#define HFI1_IOCTL_RECV_CTRL _IOW(RDMA_IOCTL_MAGIC, 0xE8, int)
72/* set the kind of polling we want */
73#define HFI1_IOCTL_POLL_TYPE _IOW(RDMA_IOCTL_MAGIC, 0xE9, int)
74/* ack & clear user status bits */
75#define HFI1_IOCTL_ACK_EVENT _IOW(RDMA_IOCTL_MAGIC, 0xEA, unsigned long)
76/* set context's pkey */
77#define HFI1_IOCTL_SET_PKEY _IOW(RDMA_IOCTL_MAGIC, 0xEB, __u16)
78/* reset context's HW send context */
79#define HFI1_IOCTL_CTXT_RESET _IO(RDMA_IOCTL_MAGIC, 0xEC)
80/* read TID cache invalidations */
81#define HFI1_IOCTL_TID_INVAL_READ _IOWR(RDMA_IOCTL_MAGIC, 0xED, struct hfi1_tid_info)
82/* get the version of the user cdev */
83#define HFI1_IOCTL_GET_VERS _IOR(RDMA_IOCTL_MAGIC, 0xEE, int)
84
85#endif /* RDMA_USER_IOCTL_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/rdma_user_ioctl_cmds.h deleted-104
...@@ -1,104 +0,0 @@
1/*
2 * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef RDMA_USER_IOCTL_CMDS_H
34#define RDMA_USER_IOCTL_CMDS_H
35
36#include <linux/types.h>
37#include <linux/ioctl.h>
38
39/* Documentation/ioctl/ioctl-number.txt */
40#define RDMA_IOCTL_MAGIC 0x1b
41#define RDMA_VERBS_IOCTL \
42 _IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)
43
44enum {
45 /* User input */
46 UVERBS_ATTR_F_MANDATORY = 1U << 0,
47 /*
48 * Valid output bit should be ignored and considered set in
49 * mandatory fields. This bit is kernel output.
50 */
51 UVERBS_ATTR_F_VALID_OUTPUT = 1U << 1,
52};
53
54struct ib_uverbs_attr {
55 __u16 attr_id; /* command specific type attribute */
56 __u16 len; /* only for pointers */
57 __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */
58 union {
59 struct {
60 __u8 elem_id;
61 __u8 reserved;
62 } enum_data;
63 __u16 reserved;
64 } attr_data;
65 union {
66 /* Used by PTR_IN/OUT, ENUM_IN and IDR */
67 __aligned_u64 data;
68 /* Used by FD_IN and FD_OUT */
69 __s64 data_s64;
70 };
71};
72
73struct ib_uverbs_ioctl_hdr {
74 __u16 length;
75 __u16 object_id;
76 __u16 method_id;
77 __u16 num_attrs;
78 __aligned_u64 reserved1;
79 __u32 driver_id;
80 __u32 reserved2;
81 struct ib_uverbs_attr attrs[0];
82};
83
84enum rdma_driver_id {
85 RDMA_DRIVER_UNKNOWN,
86 RDMA_DRIVER_MLX5,
87 RDMA_DRIVER_MLX4,
88 RDMA_DRIVER_CXGB3,
89 RDMA_DRIVER_CXGB4,
90 RDMA_DRIVER_MTHCA,
91 RDMA_DRIVER_BNXT_RE,
92 RDMA_DRIVER_OCRDMA,
93 RDMA_DRIVER_NES,
94 RDMA_DRIVER_I40IW,
95 RDMA_DRIVER_VMW_PVRDMA,
96 RDMA_DRIVER_QEDR,
97 RDMA_DRIVER_HNS,
98 RDMA_DRIVER_USNIC,
99 RDMA_DRIVER_RXE,
100 RDMA_DRIVER_HFI1,
101 RDMA_DRIVER_QIB,
102};
103
104#endif
\ No newline at end of file
lib/libc/include/generic-musl/rdma/rdma_user_rxe.h deleted-179
...@@ -1,179 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2/*
3 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef RDMA_USER_RXE_H
35#define RDMA_USER_RXE_H
36
37#include <linux/types.h>
38#include <linux/socket.h>
39#include <linux/in.h>
40#include <linux/in6.h>
41
42union rxe_gid {
43 __u8 raw[16];
44 struct {
45 __be64 subnet_prefix;
46 __be64 interface_id;
47 } global;
48};
49
50struct rxe_global_route {
51 union rxe_gid dgid;
52 __u32 flow_label;
53 __u8 sgid_index;
54 __u8 hop_limit;
55 __u8 traffic_class;
56};
57
58struct rxe_av {
59 __u8 port_num;
60 __u8 network_type;
61 __u16 reserved1;
62 __u32 reserved2;
63 struct rxe_global_route grh;
64 union {
65 struct sockaddr_in _sockaddr_in;
66 struct sockaddr_in6 _sockaddr_in6;
67 } sgid_addr, dgid_addr;
68};
69
70struct rxe_send_wr {
71 __aligned_u64 wr_id;
72 __u32 num_sge;
73 __u32 opcode;
74 __u32 send_flags;
75 union {
76 __be32 imm_data;
77 __u32 invalidate_rkey;
78 } ex;
79 union {
80 struct {
81 __aligned_u64 remote_addr;
82 __u32 rkey;
83 __u32 reserved;
84 } rdma;
85 struct {
86 __aligned_u64 remote_addr;
87 __aligned_u64 compare_add;
88 __aligned_u64 swap;
89 __u32 rkey;
90 __u32 reserved;
91 } atomic;
92 struct {
93 __u32 remote_qpn;
94 __u32 remote_qkey;
95 __u16 pkey_index;
96 } ud;
97 /* reg is only used by the kernel and is not part of the uapi */
98 struct {
99 union {
100 struct ib_mr *mr;
101 __aligned_u64 reserved;
102 };
103 __u32 key;
104 __u32 access;
105 } reg;
106 } wr;
107};
108
109struct rxe_sge {
110 __aligned_u64 addr;
111 __u32 length;
112 __u32 lkey;
113};
114
115struct mminfo {
116 __aligned_u64 offset;
117 __u32 size;
118 __u32 pad;
119};
120
121struct rxe_dma_info {
122 __u32 length;
123 __u32 resid;
124 __u32 cur_sge;
125 __u32 num_sge;
126 __u32 sge_offset;
127 __u32 reserved;
128 union {
129 __u8 inline_data[0];
130 struct rxe_sge sge[0];
131 };
132};
133
134struct rxe_send_wqe {
135 struct rxe_send_wr wr;
136 struct rxe_av av;
137 __u32 status;
138 __u32 state;
139 __aligned_u64 iova;
140 __u32 mask;
141 __u32 first_psn;
142 __u32 last_psn;
143 __u32 ack_length;
144 __u32 ssn;
145 __u32 has_rd_atomic;
146 struct rxe_dma_info dma;
147};
148
149struct rxe_recv_wqe {
150 __aligned_u64 wr_id;
151 __u32 num_sge;
152 __u32 padding;
153 struct rxe_dma_info dma;
154};
155
156struct rxe_create_cq_resp {
157 struct mminfo mi;
158};
159
160struct rxe_resize_cq_resp {
161 struct mminfo mi;
162};
163
164struct rxe_create_qp_resp {
165 struct mminfo rq_mi;
166 struct mminfo sq_mi;
167};
168
169struct rxe_create_srq_resp {
170 struct mminfo mi;
171 __u32 srq_num;
172 __u32 reserved;
173};
174
175struct rxe_modify_srq_cmd {
176 __aligned_u64 mmap_info_addr;
177};
178
179#endif /* RDMA_USER_RXE_H */
\ No newline at end of file
lib/libc/include/generic-musl/rdma/vmw_pvrdma-abi.h deleted-298
...@@ -1,298 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 * Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of EITHER the GNU General Public License
7 * version 2 as published by the Free Software Foundation or the BSD
8 * 2-Clause License. This program is distributed in the hope that it
9 * will be useful, but WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED
10 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11 * See the GNU General Public License version 2 for more details at
12 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program available in the file COPYING in the main
16 * directory of this source tree.
17 *
18 * The BSD 2-Clause License
19 *
20 * Redistribution and use in source and binary forms, with or
21 * without modification, are permitted provided that the following
22 * conditions are met:
23 *
24 * - Redistributions of source code must retain the above
25 * copyright notice, this list of conditions and the following
26 * disclaimer.
27 *
28 * - Redistributions in binary form must reproduce the above
29 * copyright notice, this list of conditions and the following
30 * disclaimer in the documentation and/or other materials
31 * provided with the distribution.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
36 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
38 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
42 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
44 * OF THE POSSIBILITY OF SUCH DAMAGE.
45 */
46
47#ifndef __VMW_PVRDMA_ABI_H__
48#define __VMW_PVRDMA_ABI_H__
49
50#include <linux/types.h>
51
52#define PVRDMA_UVERBS_ABI_VERSION 3 /* ABI Version. */
53#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */
54#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell. */
55#define PVRDMA_UAR_QP_SEND (1 << 30) /* Send bit. */
56#define PVRDMA_UAR_QP_RECV (1 << 31) /* Recv bit. */
57#define PVRDMA_UAR_CQ_OFFSET 4 /* CQ doorbell. */
58#define PVRDMA_UAR_CQ_ARM_SOL (1 << 29) /* Arm solicited bit. */
59#define PVRDMA_UAR_CQ_ARM (1 << 30) /* Arm bit. */
60#define PVRDMA_UAR_CQ_POLL (1 << 31) /* Poll bit. */
61#define PVRDMA_UAR_SRQ_OFFSET 8 /* SRQ doorbell. */
62#define PVRDMA_UAR_SRQ_RECV (1 << 30) /* Recv bit. */
63
64enum pvrdma_wr_opcode {
65 PVRDMA_WR_RDMA_WRITE,
66 PVRDMA_WR_RDMA_WRITE_WITH_IMM,
67 PVRDMA_WR_SEND,
68 PVRDMA_WR_SEND_WITH_IMM,
69 PVRDMA_WR_RDMA_READ,
70 PVRDMA_WR_ATOMIC_CMP_AND_SWP,
71 PVRDMA_WR_ATOMIC_FETCH_AND_ADD,
72 PVRDMA_WR_LSO,
73 PVRDMA_WR_SEND_WITH_INV,
74 PVRDMA_WR_RDMA_READ_WITH_INV,
75 PVRDMA_WR_LOCAL_INV,
76 PVRDMA_WR_FAST_REG_MR,
77 PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP,
78 PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD,
79 PVRDMA_WR_BIND_MW,
80 PVRDMA_WR_REG_SIG_MR,
81 PVRDMA_WR_ERROR,
82};
83
84enum pvrdma_wc_status {
85 PVRDMA_WC_SUCCESS,
86 PVRDMA_WC_LOC_LEN_ERR,
87 PVRDMA_WC_LOC_QP_OP_ERR,
88 PVRDMA_WC_LOC_EEC_OP_ERR,
89 PVRDMA_WC_LOC_PROT_ERR,
90 PVRDMA_WC_WR_FLUSH_ERR,
91 PVRDMA_WC_MW_BIND_ERR,
92 PVRDMA_WC_BAD_RESP_ERR,
93 PVRDMA_WC_LOC_ACCESS_ERR,
94 PVRDMA_WC_REM_INV_REQ_ERR,
95 PVRDMA_WC_REM_ACCESS_ERR,
96 PVRDMA_WC_REM_OP_ERR,
97 PVRDMA_WC_RETRY_EXC_ERR,
98 PVRDMA_WC_RNR_RETRY_EXC_ERR,
99 PVRDMA_WC_LOC_RDD_VIOL_ERR,
100 PVRDMA_WC_REM_INV_RD_REQ_ERR,
101 PVRDMA_WC_REM_ABORT_ERR,
102 PVRDMA_WC_INV_EECN_ERR,
103 PVRDMA_WC_INV_EEC_STATE_ERR,
104 PVRDMA_WC_FATAL_ERR,
105 PVRDMA_WC_RESP_TIMEOUT_ERR,
106 PVRDMA_WC_GENERAL_ERR,
107};
108
109enum pvrdma_wc_opcode {
110 PVRDMA_WC_SEND,
111 PVRDMA_WC_RDMA_WRITE,
112 PVRDMA_WC_RDMA_READ,
113 PVRDMA_WC_COMP_SWAP,
114 PVRDMA_WC_FETCH_ADD,
115 PVRDMA_WC_BIND_MW,
116 PVRDMA_WC_LSO,
117 PVRDMA_WC_LOCAL_INV,
118 PVRDMA_WC_FAST_REG_MR,
119 PVRDMA_WC_MASKED_COMP_SWAP,
120 PVRDMA_WC_MASKED_FETCH_ADD,
121 PVRDMA_WC_RECV = 1 << 7,
122 PVRDMA_WC_RECV_RDMA_WITH_IMM,
123};
124
125enum pvrdma_wc_flags {
126 PVRDMA_WC_GRH = 1 << 0,
127 PVRDMA_WC_WITH_IMM = 1 << 1,
128 PVRDMA_WC_WITH_INVALIDATE = 1 << 2,
129 PVRDMA_WC_IP_CSUM_OK = 1 << 3,
130 PVRDMA_WC_WITH_SMAC = 1 << 4,
131 PVRDMA_WC_WITH_VLAN = 1 << 5,
132 PVRDMA_WC_WITH_NETWORK_HDR_TYPE = 1 << 6,
133 PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE,
134};
135
136struct pvrdma_alloc_ucontext_resp {
137 __u32 qp_tab_size;
138 __u32 reserved;
139};
140
141struct pvrdma_alloc_pd_resp {
142 __u32 pdn;
143 __u32 reserved;
144};
145
146struct pvrdma_create_cq {
147 __aligned_u64 buf_addr;
148 __u32 buf_size;
149 __u32 reserved;
150};
151
152struct pvrdma_create_cq_resp {
153 __u32 cqn;
154 __u32 reserved;
155};
156
157struct pvrdma_resize_cq {
158 __aligned_u64 buf_addr;
159 __u32 buf_size;
160 __u32 reserved;
161};
162
163struct pvrdma_create_srq {
164 __aligned_u64 buf_addr;
165 __u32 buf_size;
166 __u32 reserved;
167};
168
169struct pvrdma_create_srq_resp {
170 __u32 srqn;
171 __u32 reserved;
172};
173
174struct pvrdma_create_qp {
175 __aligned_u64 rbuf_addr;
176 __aligned_u64 sbuf_addr;
177 __u32 rbuf_size;
178 __u32 sbuf_size;
179 __aligned_u64 qp_addr;
180};
181
182/* PVRDMA masked atomic compare and swap */
183struct pvrdma_ex_cmp_swap {
184 __aligned_u64 swap_val;
185 __aligned_u64 compare_val;
186 __aligned_u64 swap_mask;
187 __aligned_u64 compare_mask;
188};
189
190/* PVRDMA masked atomic fetch and add */
191struct pvrdma_ex_fetch_add {
192 __aligned_u64 add_val;
193 __aligned_u64 field_boundary;
194};
195
196/* PVRDMA address vector. */
197struct pvrdma_av {
198 __u32 port_pd;
199 __u32 sl_tclass_flowlabel;
200 __u8 dgid[16];
201 __u8 src_path_bits;
202 __u8 gid_index;
203 __u8 stat_rate;
204 __u8 hop_limit;
205 __u8 dmac[6];
206 __u8 reserved[6];
207};
208
209/* PVRDMA scatter/gather entry */
210struct pvrdma_sge {
211 __aligned_u64 addr;
212 __u32 length;
213 __u32 lkey;
214};
215
216/* PVRDMA receive queue work request */
217struct pvrdma_rq_wqe_hdr {
218 __aligned_u64 wr_id; /* wr id */
219 __u32 num_sge; /* size of s/g array */
220 __u32 total_len; /* reserved */
221};
222/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */
223
224/* PVRDMA send queue work request */
225struct pvrdma_sq_wqe_hdr {
226 __aligned_u64 wr_id; /* wr id */
227 __u32 num_sge; /* size of s/g array */
228 __u32 total_len; /* reserved */
229 __u32 opcode; /* operation type */
230 __u32 send_flags; /* wr flags */
231 union {
232 __be32 imm_data;
233 __u32 invalidate_rkey;
234 } ex;
235 __u32 reserved;
236 union {
237 struct {
238 __aligned_u64 remote_addr;
239 __u32 rkey;
240 __u8 reserved[4];
241 } rdma;
242 struct {
243 __aligned_u64 remote_addr;
244 __aligned_u64 compare_add;
245 __aligned_u64 swap;
246 __u32 rkey;
247 __u32 reserved;
248 } atomic;
249 struct {
250 __aligned_u64 remote_addr;
251 __u32 log_arg_sz;
252 __u32 rkey;
253 union {
254 struct pvrdma_ex_cmp_swap cmp_swap;
255 struct pvrdma_ex_fetch_add fetch_add;
256 } wr_data;
257 } masked_atomics;
258 struct {
259 __aligned_u64 iova_start;
260 __aligned_u64 pl_pdir_dma;
261 __u32 page_shift;
262 __u32 page_list_len;
263 __u32 length;
264 __u32 access_flags;
265 __u32 rkey;
266 __u32 reserved;
267 } fast_reg;
268 struct {
269 __u32 remote_qpn;
270 __u32 remote_qkey;
271 struct pvrdma_av av;
272 } ud;
273 } wr;
274};
275/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */
276
277/* Completion queue element. */
278struct pvrdma_cqe {
279 __aligned_u64 wr_id;
280 __aligned_u64 qp;
281 __u32 opcode;
282 __u32 status;
283 __u32 byte_len;
284 __be32 imm_data;
285 __u32 src_qp;
286 __u32 wc_flags;
287 __u32 vendor_err;
288 __u16 pkey_index;
289 __u16 slid;
290 __u8 sl;
291 __u8 dlid_path_bits;
292 __u8 port_num;
293 __u8 smac[6];
294 __u8 network_hdr_type;
295 __u8 reserved2[6]; /* Pad to next power of 2 (64). */
296};
297
298#endif /* __VMW_PVRDMA_ABI_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/cxlflash_ioctl.h deleted-276
...@@ -1,276 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * CXL Flash Device Driver
4 *
5 * Written by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>, IBM Corporation
6 * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation
7 *
8 * Copyright (C) 2015 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#ifndef _CXLFLASH_IOCTL_H
17#define _CXLFLASH_IOCTL_H
18
19#include <linux/types.h>
20
21/*
22 * Structure and definitions for all CXL Flash ioctls
23 */
24#define CXLFLASH_WWID_LEN 16
25
26/*
27 * Structure and flag definitions CXL Flash superpipe ioctls
28 */
29
30#define DK_CXLFLASH_VERSION_0 0
31
32struct dk_cxlflash_hdr {
33 __u16 version; /* Version data */
34 __u16 rsvd[3]; /* Reserved for future use */
35 __u64 flags; /* Input flags */
36 __u64 return_flags; /* Returned flags */
37};
38
39/*
40 * Return flag definitions available to all superpipe ioctls
41 *
42 * Similar to the input flags, these are grown from the bottom-up with the
43 * intention that ioctl-specific return flag definitions would grow from the
44 * top-down, allowing the two sets to co-exist. While not required/enforced
45 * at this time, this provides future flexibility.
46 */
47#define DK_CXLFLASH_ALL_PORTS_ACTIVE 0x0000000000000001ULL
48#define DK_CXLFLASH_APP_CLOSE_ADAP_FD 0x0000000000000002ULL
49#define DK_CXLFLASH_CONTEXT_SQ_CMD_MODE 0x0000000000000004ULL
50
51/*
52 * General Notes:
53 * -------------
54 * The 'context_id' field of all ioctl structures contains the context
55 * identifier for a context in the lower 32-bits (upper 32-bits are not
56 * to be used when identifying a context to the AFU). That said, the value
57 * in its entirety (all 64-bits) is to be treated as an opaque cookie and
58 * should be presented as such when issuing ioctls.
59 */
60
61/*
62 * DK_CXLFLASH_ATTACH Notes:
63 * ------------------------
64 * Read/write access permissions are specified via the O_RDONLY, O_WRONLY,
65 * and O_RDWR flags defined in the fcntl.h header file.
66 *
67 * A valid adapter file descriptor (fd >= 0) is only returned on the initial
68 * attach (successful) of a context. When a context is shared(reused), the user
69 * is expected to already 'know' the adapter file descriptor associated with the
70 * context.
71 */
72#define DK_CXLFLASH_ATTACH_REUSE_CONTEXT 0x8000000000000000ULL
73
74struct dk_cxlflash_attach {
75 struct dk_cxlflash_hdr hdr; /* Common fields */
76 __u64 num_interrupts; /* Requested number of interrupts */
77 __u64 context_id; /* Returned context */
78 __u64 mmio_size; /* Returned size of MMIO area */
79 __u64 block_size; /* Returned block size, in bytes */
80 __u64 adap_fd; /* Returned adapter file descriptor */
81 __u64 last_lba; /* Returned last LBA on the device */
82 __u64 max_xfer; /* Returned max transfer size, blocks */
83 __u64 reserved[8]; /* Reserved for future use */
84};
85
86struct dk_cxlflash_detach {
87 struct dk_cxlflash_hdr hdr; /* Common fields */
88 __u64 context_id; /* Context to detach */
89 __u64 reserved[8]; /* Reserved for future use */
90};
91
92struct dk_cxlflash_udirect {
93 struct dk_cxlflash_hdr hdr; /* Common fields */
94 __u64 context_id; /* Context to own physical resources */
95 __u64 rsrc_handle; /* Returned resource handle */
96 __u64 last_lba; /* Returned last LBA on the device */
97 __u64 reserved[8]; /* Reserved for future use */
98};
99
100#define DK_CXLFLASH_UVIRTUAL_NEED_WRITE_SAME 0x8000000000000000ULL
101
102struct dk_cxlflash_uvirtual {
103 struct dk_cxlflash_hdr hdr; /* Common fields */
104 __u64 context_id; /* Context to own virtual resources */
105 __u64 lun_size; /* Requested size, in 4K blocks */
106 __u64 rsrc_handle; /* Returned resource handle */
107 __u64 last_lba; /* Returned last LBA of LUN */
108 __u64 reserved[8]; /* Reserved for future use */
109};
110
111struct dk_cxlflash_release {
112 struct dk_cxlflash_hdr hdr; /* Common fields */
113 __u64 context_id; /* Context owning resources */
114 __u64 rsrc_handle; /* Resource handle to release */
115 __u64 reserved[8]; /* Reserved for future use */
116};
117
118struct dk_cxlflash_resize {
119 struct dk_cxlflash_hdr hdr; /* Common fields */
120 __u64 context_id; /* Context owning resources */
121 __u64 rsrc_handle; /* Resource handle of LUN to resize */
122 __u64 req_size; /* New requested size, in 4K blocks */
123 __u64 last_lba; /* Returned last LBA of LUN */
124 __u64 reserved[8]; /* Reserved for future use */
125};
126
127struct dk_cxlflash_clone {
128 struct dk_cxlflash_hdr hdr; /* Common fields */
129 __u64 context_id_src; /* Context to clone from */
130 __u64 context_id_dst; /* Context to clone to */
131 __u64 adap_fd_src; /* Source context adapter fd */
132 __u64 reserved[8]; /* Reserved for future use */
133};
134
135#define DK_CXLFLASH_VERIFY_SENSE_LEN 18
136#define DK_CXLFLASH_VERIFY_HINT_SENSE 0x8000000000000000ULL
137
138struct dk_cxlflash_verify {
139 struct dk_cxlflash_hdr hdr; /* Common fields */
140 __u64 context_id; /* Context owning resources to verify */
141 __u64 rsrc_handle; /* Resource handle of LUN */
142 __u64 hint; /* Reasons for verify */
143 __u64 last_lba; /* Returned last LBA of device */
144 __u8 sense_data[DK_CXLFLASH_VERIFY_SENSE_LEN]; /* SCSI sense data */
145 __u8 pad[6]; /* Pad to next 8-byte boundary */
146 __u64 reserved[8]; /* Reserved for future use */
147};
148
149#define DK_CXLFLASH_RECOVER_AFU_CONTEXT_RESET 0x8000000000000000ULL
150
151struct dk_cxlflash_recover_afu {
152 struct dk_cxlflash_hdr hdr; /* Common fields */
153 __u64 reason; /* Reason for recovery request */
154 __u64 context_id; /* Context to recover / updated ID */
155 __u64 mmio_size; /* Returned size of MMIO area */
156 __u64 adap_fd; /* Returned adapter file descriptor */
157 __u64 reserved[8]; /* Reserved for future use */
158};
159
160#define DK_CXLFLASH_MANAGE_LUN_WWID_LEN CXLFLASH_WWID_LEN
161#define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL
162#define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL
163#define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL
164
165struct dk_cxlflash_manage_lun {
166 struct dk_cxlflash_hdr hdr; /* Common fields */
167 __u8 wwid[DK_CXLFLASH_MANAGE_LUN_WWID_LEN]; /* Page83 WWID, NAA-6 */
168 __u64 reserved[8]; /* Rsvd, future use */
169};
170
171union cxlflash_ioctls {
172 struct dk_cxlflash_attach attach;
173 struct dk_cxlflash_detach detach;
174 struct dk_cxlflash_udirect udirect;
175 struct dk_cxlflash_uvirtual uvirtual;
176 struct dk_cxlflash_release release;
177 struct dk_cxlflash_resize resize;
178 struct dk_cxlflash_clone clone;
179 struct dk_cxlflash_verify verify;
180 struct dk_cxlflash_recover_afu recover_afu;
181 struct dk_cxlflash_manage_lun manage_lun;
182};
183
184#define MAX_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ioctls))
185
186#define CXL_MAGIC 0xCA
187#define CXL_IOWR(_n, _s) _IOWR(CXL_MAGIC, _n, struct _s)
188
189/*
190 * CXL Flash superpipe ioctls start at base of the reserved CXL_MAGIC
191 * region (0x80) and grow upwards.
192 */
193#define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach)
194#define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect)
195#define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release)
196#define DK_CXLFLASH_DETACH CXL_IOWR(0x83, dk_cxlflash_detach)
197#define DK_CXLFLASH_VERIFY CXL_IOWR(0x84, dk_cxlflash_verify)
198#define DK_CXLFLASH_RECOVER_AFU CXL_IOWR(0x85, dk_cxlflash_recover_afu)
199#define DK_CXLFLASH_MANAGE_LUN CXL_IOWR(0x86, dk_cxlflash_manage_lun)
200#define DK_CXLFLASH_USER_VIRTUAL CXL_IOWR(0x87, dk_cxlflash_uvirtual)
201#define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize)
202#define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone)
203
204/*
205 * Structure and flag definitions CXL Flash host ioctls
206 */
207
208#define HT_CXLFLASH_VERSION_0 0
209
210struct ht_cxlflash_hdr {
211 __u16 version; /* Version data */
212 __u16 subcmd; /* Sub-command */
213 __u16 rsvd[2]; /* Reserved for future use */
214 __u64 flags; /* Input flags */
215 __u64 return_flags; /* Returned flags */
216};
217
218/*
219 * Input flag definitions available to all host ioctls
220 *
221 * These are grown from the bottom-up with the intention that ioctl-specific
222 * input flag definitions would grow from the top-down, allowing the two sets
223 * to co-exist. While not required/enforced at this time, this provides future
224 * flexibility.
225 */
226#define HT_CXLFLASH_HOST_READ 0x0000000000000000ULL
227#define HT_CXLFLASH_HOST_WRITE 0x0000000000000001ULL
228
229#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_CREATE_LUN 0x0001
230#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_DELETE_LUN 0x0002
231#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_QUERY_PORT 0x0003
232
233struct ht_cxlflash_lun_provision {
234 struct ht_cxlflash_hdr hdr; /* Common fields */
235 __u16 port; /* Target port for provision request */
236 __u16 reserved16[3]; /* Reserved for future use */
237 __u64 size; /* Size of LUN (4K blocks) */
238 __u64 lun_id; /* SCSI LUN ID */
239 __u8 wwid[CXLFLASH_WWID_LEN];/* Page83 WWID, NAA-6 */
240 __u64 max_num_luns; /* Maximum number of LUNs provisioned */
241 __u64 cur_num_luns; /* Current number of LUNs provisioned */
242 __u64 max_cap_port; /* Total capacity for port (4K blocks) */
243 __u64 cur_cap_port; /* Current capacity for port (4K blocks) */
244 __u64 reserved[8]; /* Reserved for future use */
245};
246
247#define HT_CXLFLASH_AFU_DEBUG_MAX_DATA_LEN 262144 /* 256K */
248#define HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN 12
249struct ht_cxlflash_afu_debug {
250 struct ht_cxlflash_hdr hdr; /* Common fields */
251 __u8 reserved8[4]; /* Reserved for future use */
252 __u8 afu_subcmd[HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN]; /* AFU subcommand,
253 * (pass through)
254 */
255 __u64 data_ea; /* Data buffer effective address */
256 __u32 data_len; /* Data buffer length */
257 __u32 reserved32; /* Reserved for future use */
258 __u64 reserved[8]; /* Reserved for future use */
259};
260
261union cxlflash_ht_ioctls {
262 struct ht_cxlflash_lun_provision lun_provision;
263 struct ht_cxlflash_afu_debug afu_debug;
264};
265
266#define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls))
267
268/*
269 * CXL Flash host ioctls start at the top of the reserved CXL_MAGIC
270 * region (0xBF) and grow downwards.
271 */
272#define HT_CXLFLASH_LUN_PROVISION CXL_IOWR(0xBF, ht_cxlflash_lun_provision)
273#define HT_CXLFLASH_AFU_DEBUG CXL_IOWR(0xBE, ht_cxlflash_afu_debug)
274
275
276#endif /* ifndef _CXLFLASH_IOCTL_H */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/fc/fc_els.h deleted-832
...@@ -1,832 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Maintained at www.Open-FCoE.org
19 */
20
21#ifndef _FC_ELS_H_
22#define _FC_ELS_H_
23
24#include <linux/types.h>
25
26/*
27 * Fibre Channel Switch - Enhanced Link Services definitions.
28 * From T11 FC-LS Rev 1.2 June 7, 2005.
29 */
30
31/*
32 * ELS Command codes - byte 0 of the frame payload
33 */
34enum fc_els_cmd {
35 ELS_LS_RJT = 0x01, /* ESL reject */
36 ELS_LS_ACC = 0x02, /* ESL Accept */
37 ELS_PLOGI = 0x03, /* N_Port login */
38 ELS_FLOGI = 0x04, /* F_Port login */
39 ELS_LOGO = 0x05, /* Logout */
40 ELS_ABTX = 0x06, /* Abort exchange - obsolete */
41 ELS_RCS = 0x07, /* read connection status */
42 ELS_RES = 0x08, /* read exchange status block */
43 ELS_RSS = 0x09, /* read sequence status block */
44 ELS_RSI = 0x0a, /* read sequence initiative */
45 ELS_ESTS = 0x0b, /* establish streaming */
46 ELS_ESTC = 0x0c, /* estimate credit */
47 ELS_ADVC = 0x0d, /* advise credit */
48 ELS_RTV = 0x0e, /* read timeout value */
49 ELS_RLS = 0x0f, /* read link error status block */
50 ELS_ECHO = 0x10, /* echo */
51 ELS_TEST = 0x11, /* test */
52 ELS_RRQ = 0x12, /* reinstate recovery qualifier */
53 ELS_REC = 0x13, /* read exchange concise */
54 ELS_SRR = 0x14, /* sequence retransmission request */
55 ELS_PRLI = 0x20, /* process login */
56 ELS_PRLO = 0x21, /* process logout */
57 ELS_SCN = 0x22, /* state change notification */
58 ELS_TPLS = 0x23, /* test process login state */
59 ELS_TPRLO = 0x24, /* third party process logout */
60 ELS_LCLM = 0x25, /* login control list mgmt (obs) */
61 ELS_GAID = 0x30, /* get alias_ID */
62 ELS_FACT = 0x31, /* fabric activate alias_id */
63 ELS_FDACDT = 0x32, /* fabric deactivate alias_id */
64 ELS_NACT = 0x33, /* N-port activate alias_id */
65 ELS_NDACT = 0x34, /* N-port deactivate alias_id */
66 ELS_QOSR = 0x40, /* quality of service request */
67 ELS_RVCS = 0x41, /* read virtual circuit status */
68 ELS_PDISC = 0x50, /* discover N_port service params */
69 ELS_FDISC = 0x51, /* discover F_port service params */
70 ELS_ADISC = 0x52, /* discover address */
71 ELS_RNC = 0x53, /* report node cap (obs) */
72 ELS_FARP_REQ = 0x54, /* FC ARP request */
73 ELS_FARP_REPL = 0x55, /* FC ARP reply */
74 ELS_RPS = 0x56, /* read port status block */
75 ELS_RPL = 0x57, /* read port list */
76 ELS_RPBC = 0x58, /* read port buffer condition */
77 ELS_FAN = 0x60, /* fabric address notification */
78 ELS_RSCN = 0x61, /* registered state change notification */
79 ELS_SCR = 0x62, /* state change registration */
80 ELS_RNFT = 0x63, /* report node FC-4 types */
81 ELS_CSR = 0x68, /* clock synch. request */
82 ELS_CSU = 0x69, /* clock synch. update */
83 ELS_LINIT = 0x70, /* loop initialize */
84 ELS_LSTS = 0x72, /* loop status */
85 ELS_RNID = 0x78, /* request node ID data */
86 ELS_RLIR = 0x79, /* registered link incident report */
87 ELS_LIRR = 0x7a, /* link incident record registration */
88 ELS_SRL = 0x7b, /* scan remote loop */
89 ELS_SBRP = 0x7c, /* set bit-error reporting params */
90 ELS_RPSC = 0x7d, /* report speed capabilities */
91 ELS_QSA = 0x7e, /* query security attributes */
92 ELS_EVFP = 0x7f, /* exchange virt. fabrics params */
93 ELS_LKA = 0x80, /* link keep-alive */
94 ELS_AUTH_ELS = 0x90, /* authentication ELS */
95};
96
97/*
98 * Initializer useful for decoding table.
99 * Please keep this in sync with the above definitions.
100 */
101#define FC_ELS_CMDS_INIT { \
102 [ELS_LS_RJT] = "LS_RJT", \
103 [ELS_LS_ACC] = "LS_ACC", \
104 [ELS_PLOGI] = "PLOGI", \
105 [ELS_FLOGI] = "FLOGI", \
106 [ELS_LOGO] = "LOGO", \
107 [ELS_ABTX] = "ABTX", \
108 [ELS_RCS] = "RCS", \
109 [ELS_RES] = "RES", \
110 [ELS_RSS] = "RSS", \
111 [ELS_RSI] = "RSI", \
112 [ELS_ESTS] = "ESTS", \
113 [ELS_ESTC] = "ESTC", \
114 [ELS_ADVC] = "ADVC", \
115 [ELS_RTV] = "RTV", \
116 [ELS_RLS] = "RLS", \
117 [ELS_ECHO] = "ECHO", \
118 [ELS_TEST] = "TEST", \
119 [ELS_RRQ] = "RRQ", \
120 [ELS_REC] = "REC", \
121 [ELS_SRR] = "SRR", \
122 [ELS_PRLI] = "PRLI", \
123 [ELS_PRLO] = "PRLO", \
124 [ELS_SCN] = "SCN", \
125 [ELS_TPLS] = "TPLS", \
126 [ELS_TPRLO] = "TPRLO", \
127 [ELS_LCLM] = "LCLM", \
128 [ELS_GAID] = "GAID", \
129 [ELS_FACT] = "FACT", \
130 [ELS_FDACDT] = "FDACDT", \
131 [ELS_NACT] = "NACT", \
132 [ELS_NDACT] = "NDACT", \
133 [ELS_QOSR] = "QOSR", \
134 [ELS_RVCS] = "RVCS", \
135 [ELS_PDISC] = "PDISC", \
136 [ELS_FDISC] = "FDISC", \
137 [ELS_ADISC] = "ADISC", \
138 [ELS_RNC] = "RNC", \
139 [ELS_FARP_REQ] = "FARP_REQ", \
140 [ELS_FARP_REPL] = "FARP_REPL", \
141 [ELS_RPS] = "RPS", \
142 [ELS_RPL] = "RPL", \
143 [ELS_RPBC] = "RPBC", \
144 [ELS_FAN] = "FAN", \
145 [ELS_RSCN] = "RSCN", \
146 [ELS_SCR] = "SCR", \
147 [ELS_RNFT] = "RNFT", \
148 [ELS_CSR] = "CSR", \
149 [ELS_CSU] = "CSU", \
150 [ELS_LINIT] = "LINIT", \
151 [ELS_LSTS] = "LSTS", \
152 [ELS_RNID] = "RNID", \
153 [ELS_RLIR] = "RLIR", \
154 [ELS_LIRR] = "LIRR", \
155 [ELS_SRL] = "SRL", \
156 [ELS_SBRP] = "SBRP", \
157 [ELS_RPSC] = "RPSC", \
158 [ELS_QSA] = "QSA", \
159 [ELS_EVFP] = "EVFP", \
160 [ELS_LKA] = "LKA", \
161 [ELS_AUTH_ELS] = "AUTH_ELS", \
162}
163
164/*
165 * LS_ACC payload.
166 */
167struct fc_els_ls_acc {
168 __u8 la_cmd; /* command code ELS_LS_ACC */
169 __u8 la_resv[3]; /* reserved */
170};
171
172/*
173 * ELS reject payload.
174 */
175struct fc_els_ls_rjt {
176 __u8 er_cmd; /* command code ELS_LS_RJT */
177 __u8 er_resv[4]; /* reserved must be zero */
178 __u8 er_reason; /* reason (enum fc_els_rjt_reason below) */
179 __u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */
180 __u8 er_vendor; /* vendor specific code */
181};
182
183/*
184 * ELS reject reason codes (er_reason).
185 */
186enum fc_els_rjt_reason {
187 ELS_RJT_NONE = 0, /* no reject - not to be sent */
188 ELS_RJT_INVAL = 0x01, /* invalid ELS command code */
189 ELS_RJT_LOGIC = 0x03, /* logical error */
190 ELS_RJT_BUSY = 0x05, /* logical busy */
191 ELS_RJT_PROT = 0x07, /* protocol error */
192 ELS_RJT_UNAB = 0x09, /* unable to perform command request */
193 ELS_RJT_UNSUP = 0x0b, /* command not supported */
194 ELS_RJT_INPROG = 0x0e, /* command already in progress */
195 ELS_RJT_FIP = 0x20, /* FIP error */
196 ELS_RJT_VENDOR = 0xff, /* vendor specific error */
197};
198
199
200/*
201 * reason code explanation (er_explan).
202 */
203enum fc_els_rjt_explan {
204 ELS_EXPL_NONE = 0x00, /* No additional explanation */
205 ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */
206 ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */
207 ELS_EXPL_AH = 0x11, /* invalid association header */
208 ELS_EXPL_AH_REQ = 0x13, /* association_header required */
209 ELS_EXPL_SID = 0x15, /* invalid originator S_ID */
210 ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */
211 ELS_EXPL_INPROG = 0x19, /* Request already in progress */
212 ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */
213 ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */
214 ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */
215 ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */
216 ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */
217 ELS_EXPL_NOT_NEIGHBOR = 0x62, /* VN2VN_Port not in neighbor set */
218 /* TBD - above definitions incomplete */
219};
220
221/*
222 * Common service parameters (N ports).
223 */
224struct fc_els_csp {
225 __u8 sp_hi_ver; /* highest version supported (obs.) */
226 __u8 sp_lo_ver; /* highest version supported (obs.) */
227 __be16 sp_bb_cred; /* buffer-to-buffer credits */
228 __be16 sp_features; /* common feature flags */
229 __be16 sp_bb_data; /* b-b state number and data field sz */
230 union {
231 struct {
232 __be16 _sp_tot_seq; /* total concurrent sequences */
233 __be16 _sp_rel_off; /* rel. offset by info cat */
234 } sp_plogi;
235 struct {
236 __be32 _sp_r_a_tov; /* resource alloc. timeout msec */
237 } sp_flogi_acc;
238 } sp_u;
239 __be32 sp_e_d_tov; /* error detect timeout value */
240};
241#define sp_tot_seq sp_u.sp_plogi._sp_tot_seq
242#define sp_rel_off sp_u.sp_plogi._sp_rel_off
243#define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov
244
245#define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */
246
247/*
248 * Minimum and maximum values for max data field size in service parameters.
249 */
250#define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD
251#define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD
252
253/*
254 * sp_features
255 */
256#define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */
257#define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */
258#define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */
259#define FC_SP_FT_RAND 0x4000 /* random relative offset */
260#define FC_SP_FT_VAL 0x2000 /* valid vendor version level */
261#define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */
262#define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */
263#define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */
264#define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */
265#define FC_SP_FT_MCAST 0x0200 /* multicast */
266#define FC_SP_FT_BCAST 0x0100 /* broadcast */
267#define FC_SP_FT_HUNT 0x0080 /* hunt group */
268#define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */
269#define FC_SP_FT_SEC 0x0020 /* reserved for security */
270#define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */
271#define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */
272#define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */
273#define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */
274#define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */
275
276/*
277 * Class-specific service parameters.
278 */
279struct fc_els_cssp {
280 __be16 cp_class; /* class flags */
281 __be16 cp_init; /* initiator flags */
282 __be16 cp_recip; /* recipient flags */
283 __be16 cp_rdfs; /* receive data field size */
284 __be16 cp_con_seq; /* concurrent sequences */
285 __be16 cp_ee_cred; /* N-port end-to-end credit */
286 __u8 cp_resv1; /* reserved */
287 __u8 cp_open_seq; /* open sequences per exchange */
288 __u8 _cp_resv2[2]; /* reserved */
289};
290
291/*
292 * cp_class flags.
293 */
294#define FC_CPC_VALID 0x8000 /* class valid */
295#define FC_CPC_IMIX 0x4000 /* intermix mode */
296#define FC_CPC_SEQ 0x0800 /* sequential delivery */
297#define FC_CPC_CAMP 0x0200 /* camp-on */
298#define FC_CPC_PRI 0x0080 /* priority */
299
300/*
301 * cp_init flags.
302 * (TBD: not all flags defined here).
303 */
304#define FC_CPI_CSYN 0x0010 /* clock synch. capable */
305
306/*
307 * cp_recip flags.
308 */
309#define FC_CPR_CSYN 0x0008 /* clock synch. capable */
310
311/*
312 * NFC_ELS_FLOGI: Fabric login request.
313 * NFC_ELS_PLOGI: Port login request (same format).
314 */
315struct fc_els_flogi {
316 __u8 fl_cmd; /* command */
317 __u8 _fl_resvd[3]; /* must be zero */
318 struct fc_els_csp fl_csp; /* common service parameters */
319 __be64 fl_wwpn; /* port name */
320 __be64 fl_wwnn; /* node name */
321 struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */
322 __u8 fl_vend[16]; /* vendor version level */
323} __attribute__((__packed__));
324
325/*
326 * Process login service parameter page.
327 */
328struct fc_els_spp {
329 __u8 spp_type; /* type code or common service params */
330 __u8 spp_type_ext; /* type code extension */
331 __u8 spp_flags;
332 __u8 _spp_resvd;
333 __be32 spp_orig_pa; /* originator process associator */
334 __be32 spp_resp_pa; /* responder process associator */
335 __be32 spp_params; /* service parameters */
336};
337
338/*
339 * spp_flags.
340 */
341#define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */
342#define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */
343#define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */
344#define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */
345
346/*
347 * SPP response code in spp_flags - lower 4 bits.
348 */
349enum fc_els_spp_resp {
350 FC_SPP_RESP_ACK = 1, /* request executed */
351 FC_SPP_RESP_RES = 2, /* unable due to lack of resources */
352 FC_SPP_RESP_INIT = 3, /* initialization not complete */
353 FC_SPP_RESP_NO_PA = 4, /* unknown process associator */
354 FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */
355 FC_SPP_RESP_COND = 6, /* request completed conditionally */
356 FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */
357 FC_SPP_RESP_INVL = 8, /* SPP is invalid */
358};
359
360/*
361 * ELS_RRQ - Reinstate Recovery Qualifier
362 */
363struct fc_els_rrq {
364 __u8 rrq_cmd; /* command (0x12) */
365 __u8 rrq_zero[3]; /* specified as zero - part of cmd */
366 __u8 rrq_resvd; /* reserved */
367 __u8 rrq_s_id[3]; /* originator FID */
368 __be16 rrq_ox_id; /* originator exchange ID */
369 __be16 rrq_rx_id; /* responders exchange ID */
370};
371
372/*
373 * ELS_REC - Read exchange concise.
374 */
375struct fc_els_rec {
376 __u8 rec_cmd; /* command (0x13) */
377 __u8 rec_zero[3]; /* specified as zero - part of cmd */
378 __u8 rec_resvd; /* reserved */
379 __u8 rec_s_id[3]; /* originator FID */
380 __be16 rec_ox_id; /* originator exchange ID */
381 __be16 rec_rx_id; /* responders exchange ID */
382};
383
384/*
385 * ELS_REC LS_ACC payload.
386 */
387struct fc_els_rec_acc {
388 __u8 reca_cmd; /* accept (0x02) */
389 __u8 reca_zero[3]; /* specified as zero - part of cmd */
390 __be16 reca_ox_id; /* originator exchange ID */
391 __be16 reca_rx_id; /* responders exchange ID */
392 __u8 reca_resvd1; /* reserved */
393 __u8 reca_ofid[3]; /* originator FID */
394 __u8 reca_resvd2; /* reserved */
395 __u8 reca_rfid[3]; /* responder FID */
396 __be32 reca_fc4value; /* FC4 value */
397 __be32 reca_e_stat; /* ESB (exchange status block) status */
398};
399
400/*
401 * ELS_PRLI - Process login request and response.
402 */
403struct fc_els_prli {
404 __u8 prli_cmd; /* command */
405 __u8 prli_spp_len; /* length of each serv. parm. page */
406 __be16 prli_len; /* length of entire payload */
407 /* service parameter pages follow */
408};
409
410/*
411 * ELS_PRLO - Process logout request and response.
412 */
413struct fc_els_prlo {
414 __u8 prlo_cmd; /* command */
415 __u8 prlo_obs; /* obsolete, but shall be set to 10h */
416 __be16 prlo_len; /* payload length */
417};
418
419/*
420 * ELS_ADISC payload
421 */
422struct fc_els_adisc {
423 __u8 adisc_cmd;
424 __u8 adisc_resv[3];
425 __u8 adisc_resv1;
426 __u8 adisc_hard_addr[3];
427 __be64 adisc_wwpn;
428 __be64 adisc_wwnn;
429 __u8 adisc_resv2;
430 __u8 adisc_port_id[3];
431} __attribute__((__packed__));
432
433/*
434 * ELS_LOGO - process or fabric logout.
435 */
436struct fc_els_logo {
437 __u8 fl_cmd; /* command code */
438 __u8 fl_zero[3]; /* specified as zero - part of cmd */
439 __u8 fl_resvd; /* reserved */
440 __u8 fl_n_port_id[3];/* N port ID */
441 __be64 fl_n_port_wwn; /* port name */
442};
443
444/*
445 * ELS_RTV - read timeout value.
446 */
447struct fc_els_rtv {
448 __u8 rtv_cmd; /* command code 0x0e */
449 __u8 rtv_zero[3]; /* specified as zero - part of cmd */
450};
451
452/*
453 * LS_ACC for ELS_RTV - read timeout value.
454 */
455struct fc_els_rtv_acc {
456 __u8 rtv_cmd; /* command code 0x02 */
457 __u8 rtv_zero[3]; /* specified as zero - part of cmd */
458 __be32 rtv_r_a_tov; /* resource allocation timeout value */
459 __be32 rtv_e_d_tov; /* error detection timeout value */
460 __be32 rtv_toq; /* timeout qualifier (see below) */
461};
462
463/*
464 * rtv_toq bits.
465 */
466#define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */
467#define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */
468
469/*
470 * ELS_SCR - state change registration payload.
471 */
472struct fc_els_scr {
473 __u8 scr_cmd; /* command code */
474 __u8 scr_resv[6]; /* reserved */
475 __u8 scr_reg_func; /* registration function (see below) */
476};
477
478enum fc_els_scr_func {
479 ELS_SCRF_FAB = 1, /* fabric-detected registration */
480 ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */
481 ELS_SCRF_FULL = 3, /* full registration */
482 ELS_SCRF_CLEAR = 255, /* remove any current registrations */
483};
484
485/*
486 * ELS_RSCN - registered state change notification payload.
487 */
488struct fc_els_rscn {
489 __u8 rscn_cmd; /* RSCN opcode (0x61) */
490 __u8 rscn_page_len; /* page length (4) */
491 __be16 rscn_plen; /* payload length including this word */
492
493 /* followed by 4-byte generic affected Port_ID pages */
494};
495
496struct fc_els_rscn_page {
497 __u8 rscn_page_flags; /* event and address format */
498 __u8 rscn_fid[3]; /* fabric ID */
499};
500
501#define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */
502#define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */
503#define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */
504#define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */
505
506enum fc_els_rscn_ev_qual {
507 ELS_EV_QUAL_NONE = 0, /* unspecified */
508 ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */
509 ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */
510 ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */
511 ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */
512 ELS_EV_QUAL_REM_OBJ = 5, /* removed object */
513};
514
515enum fc_els_rscn_addr_fmt {
516 ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */
517 ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */
518 ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */
519 ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */
520};
521
522/*
523 * ELS_RNID - request Node ID.
524 */
525struct fc_els_rnid {
526 __u8 rnid_cmd; /* RNID opcode (0x78) */
527 __u8 rnid_resv[3]; /* reserved */
528 __u8 rnid_fmt; /* data format */
529 __u8 rnid_resv2[3]; /* reserved */
530};
531
532/*
533 * Node Identification Data formats (rnid_fmt)
534 */
535enum fc_els_rnid_fmt {
536 ELS_RNIDF_NONE = 0, /* no specific identification data */
537 ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */
538};
539
540/*
541 * ELS_RNID response.
542 */
543struct fc_els_rnid_resp {
544 __u8 rnid_cmd; /* response code (LS_ACC) */
545 __u8 rnid_resv[3]; /* reserved */
546 __u8 rnid_fmt; /* data format */
547 __u8 rnid_cid_len; /* common ID data length */
548 __u8 rnid_resv2; /* reserved */
549 __u8 rnid_sid_len; /* specific ID data length */
550};
551
552struct fc_els_rnid_cid {
553 __be64 rnid_wwpn; /* N port name */
554 __be64 rnid_wwnn; /* node name */
555};
556
557struct fc_els_rnid_gen {
558 __u8 rnid_vend_id[16]; /* vendor-unique ID */
559 __be32 rnid_atype; /* associated type (see below) */
560 __be32 rnid_phys_port; /* physical port number */
561 __be32 rnid_att_nodes; /* number of attached nodes */
562 __u8 rnid_node_mgmt; /* node management (see below) */
563 __u8 rnid_ip_ver; /* IP version (see below) */
564 __be16 rnid_prot_port; /* UDP / TCP port number */
565 __be32 rnid_ip_addr[4]; /* IP address */
566 __u8 rnid_resvd[2]; /* reserved */
567 __be16 rnid_vend_spec; /* vendor-specific field */
568};
569
570enum fc_els_rnid_atype {
571 ELS_RNIDA_UNK = 0x01, /* unknown */
572 ELS_RNIDA_OTHER = 0x02, /* none of the following */
573 ELS_RNIDA_HUB = 0x03,
574 ELS_RNIDA_SWITCH = 0x04,
575 ELS_RNIDA_GATEWAY = 0x05,
576 ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */
577 ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */
578 ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */
579 ELS_RNIDA_STORAGE = 0x09,
580 ELS_RNIDA_HOST = 0x0a,
581 ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */
582 ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */
583 ELS_RNIDA_NAS = 0x11, /* NAS server */
584 ELS_RNIDA_BRIDGE = 0x12, /* bridge */
585 ELS_RNIDA_VIRT = 0x13, /* virtualization device */
586 ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */
587 ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */
588 ELS_RNIDA_MF_SW = 1UL << 30, /* switch */
589 ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */
590 ELS_RNIDA_MF_ST = 1UL << 28, /* storage */
591 ELS_RNIDA_MF_HOST = 1UL << 27, /* host */
592 ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */
593 ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */
594 ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */
595 ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */
596 ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */
597 ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */
598};
599
600enum fc_els_rnid_mgmt {
601 ELS_RNIDM_SNMP = 0,
602 ELS_RNIDM_TELNET = 1,
603 ELS_RNIDM_HTTP = 2,
604 ELS_RNIDM_HTTPS = 3,
605 ELS_RNIDM_XML = 4, /* HTTP + XML */
606};
607
608enum fc_els_rnid_ipver {
609 ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */
610 ELS_RNIDIP_V4 = 1, /* IPv4 */
611 ELS_RNIDIP_V6 = 2, /* IPv6 */
612};
613
614/*
615 * ELS RPL - Read Port List.
616 */
617struct fc_els_rpl {
618 __u8 rpl_cmd; /* command */
619 __u8 rpl_resv[5]; /* reserved - must be zero */
620 __be16 rpl_max_size; /* maximum response size or zero */
621 __u8 rpl_resv1; /* reserved - must be zero */
622 __u8 rpl_index[3]; /* starting index */
623};
624
625/*
626 * Port number block in RPL response.
627 */
628struct fc_els_pnb {
629 __be32 pnb_phys_pn; /* physical port number */
630 __u8 pnb_resv; /* reserved */
631 __u8 pnb_port_id[3]; /* port ID */
632 __be64 pnb_wwpn; /* port name */
633};
634
635/*
636 * RPL LS_ACC response.
637 */
638struct fc_els_rpl_resp {
639 __u8 rpl_cmd; /* ELS_LS_ACC */
640 __u8 rpl_resv1; /* reserved - must be zero */
641 __be16 rpl_plen; /* payload length */
642 __u8 rpl_resv2; /* reserved - must be zero */
643 __u8 rpl_llen[3]; /* list length */
644 __u8 rpl_resv3; /* reserved - must be zero */
645 __u8 rpl_index[3]; /* starting index */
646 struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */
647};
648
649/*
650 * Link Error Status Block.
651 */
652struct fc_els_lesb {
653 __be32 lesb_link_fail; /* link failure count */
654 __be32 lesb_sync_loss; /* loss of synchronization count */
655 __be32 lesb_sig_loss; /* loss of signal count */
656 __be32 lesb_prim_err; /* primitive sequence error count */
657 __be32 lesb_inv_word; /* invalid transmission word count */
658 __be32 lesb_inv_crc; /* invalid CRC count */
659};
660
661/*
662 * ELS RPS - Read Port Status Block request.
663 */
664struct fc_els_rps {
665 __u8 rps_cmd; /* command */
666 __u8 rps_resv[2]; /* reserved - must be zero */
667 __u8 rps_flag; /* flag - see below */
668 __be64 rps_port_spec; /* port selection */
669};
670
671enum fc_els_rps_flag {
672 FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */
673 FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */
674 FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */
675};
676
677/*
678 * ELS RPS LS_ACC response.
679 */
680struct fc_els_rps_resp {
681 __u8 rps_cmd; /* command - LS_ACC */
682 __u8 rps_resv[2]; /* reserved - must be zero */
683 __u8 rps_flag; /* flag - see below */
684 __u8 rps_resv2[2]; /* reserved */
685 __be16 rps_status; /* port status - see below */
686 struct fc_els_lesb rps_lesb; /* link error status block */
687};
688
689enum fc_els_rps_resp_flag {
690 FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */
691};
692
693enum fc_els_rps_resp_status {
694 FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */
695 FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */
696 FC_ELS_RPS_FAB = 1 << 3, /* fabric present */
697 FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */
698 FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */
699 FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */
700};
701
702/*
703 * ELS LIRR - Link Incident Record Registration request.
704 */
705struct fc_els_lirr {
706 __u8 lirr_cmd; /* command */
707 __u8 lirr_resv[3]; /* reserved - must be zero */
708 __u8 lirr_func; /* registration function */
709 __u8 lirr_fmt; /* FC-4 type of RLIR requested */
710 __u8 lirr_resv2[2]; /* reserved - must be zero */
711};
712
713enum fc_els_lirr_func {
714 ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */
715 ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */
716 ELS_LIRR_CLEAR = 0xff /* clear registration */
717};
718
719/*
720 * ELS SRL - Scan Remote Loop request.
721 */
722struct fc_els_srl {
723 __u8 srl_cmd; /* command */
724 __u8 srl_resv[3]; /* reserved - must be zero */
725 __u8 srl_flag; /* flag - see below */
726 __u8 srl_flag_param[3]; /* flag parameter */
727};
728
729enum fc_els_srl_flag {
730 FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */
731 FC_ELS_SRL_ONE = 0x01, /* scan specified loop */
732 FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */
733 FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */
734};
735
736/*
737 * ELS RLS - Read Link Error Status Block request.
738 */
739struct fc_els_rls {
740 __u8 rls_cmd; /* command */
741 __u8 rls_resv[4]; /* reserved - must be zero */
742 __u8 rls_port_id[3]; /* port ID */
743};
744
745/*
746 * ELS RLS LS_ACC Response.
747 */
748struct fc_els_rls_resp {
749 __u8 rls_cmd; /* ELS_LS_ACC */
750 __u8 rls_resv[3]; /* reserved - must be zero */
751 struct fc_els_lesb rls_lesb; /* link error status block */
752};
753
754/*
755 * ELS RLIR - Registered Link Incident Report.
756 * This is followed by the CLIR and the CLID, described below.
757 */
758struct fc_els_rlir {
759 __u8 rlir_cmd; /* command */
760 __u8 rlir_resv[3]; /* reserved - must be zero */
761 __u8 rlir_fmt; /* format (FC4-type if type specific) */
762 __u8 rlir_clr_len; /* common link incident record length */
763 __u8 rlir_cld_len; /* common link incident desc. length */
764 __u8 rlir_slr_len; /* spec. link incident record length */
765};
766
767/*
768 * CLIR - Common Link Incident Record Data. - Sent via RLIR.
769 */
770struct fc_els_clir {
771 __be64 clir_wwpn; /* incident port name */
772 __be64 clir_wwnn; /* incident port node name */
773 __u8 clir_port_type; /* incident port type */
774 __u8 clir_port_id[3]; /* incident port ID */
775
776 __be64 clir_conn_wwpn; /* connected port name */
777 __be64 clir_conn_wwnn; /* connected node name */
778 __be64 clir_fab_name; /* fabric name */
779 __be32 clir_phys_port; /* physical port number */
780 __be32 clir_trans_id; /* transaction ID */
781 __u8 clir_resv[3]; /* reserved */
782 __u8 clir_ts_fmt; /* time stamp format */
783 __be64 clir_timestamp; /* time stamp */
784};
785
786/*
787 * CLIR clir_ts_fmt - time stamp format values.
788 */
789enum fc_els_clir_ts_fmt {
790 ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */
791 ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */
792 ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */
793};
794
795/*
796 * Common Link Incident Descriptor - sent via RLIR.
797 */
798struct fc_els_clid {
799 __u8 clid_iq; /* incident qualifier flags */
800 __u8 clid_ic; /* incident code */
801 __be16 clid_epai; /* domain/area of ISL */
802};
803
804/*
805 * CLID incident qualifier flags.
806 */
807enum fc_els_clid_iq {
808 ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */
809 ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */
810 ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */
811 ELS_CLID_SEV_INFO = 0x00, /* report is informational */
812 ELS_CLID_SEV_INOP = 0x08, /* link not operational */
813 ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */
814 ELS_CLID_LASER = 0x02, /* subassembly is a laser */
815 ELS_CLID_FRU = 0x01, /* format can identify a FRU */
816};
817
818/*
819 * CLID incident code.
820 */
821enum fc_els_clid_ic {
822 ELS_CLID_IC_IMPL = 1, /* implicit incident */
823 ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */
824 ELS_CLID_IC_LOS = 3, /* loss of synch or signal */
825 ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */
826 ELS_CLID_IC_PST = 5, /* primitive sequence timeout */
827 ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */
828 ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */
829 ELS_CLID_IC_LIP = 8, /* receiving LIP */
830};
831
832#endif /* _FC_ELS_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/fc/fc_fs.h deleted-351
...@@ -1,351 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Maintained at www.Open-FCoE.org
19 */
20
21#ifndef _FC_FS_H_
22#define _FC_FS_H_
23
24#include <linux/types.h>
25
26/*
27 * Fibre Channel Framing and Signalling definitions.
28 * From T11 FC-FS-2 Rev 0.90 - 9 August 2005.
29 */
30
31/*
32 * Frame header
33 */
34struct fc_frame_header {
35 __u8 fh_r_ctl; /* routing control */
36 __u8 fh_d_id[3]; /* Destination ID */
37
38 __u8 fh_cs_ctl; /* class of service control / pri */
39 __u8 fh_s_id[3]; /* Source ID */
40
41 __u8 fh_type; /* see enum fc_fh_type below */
42 __u8 fh_f_ctl[3]; /* frame control */
43
44 __u8 fh_seq_id; /* sequence ID */
45 __u8 fh_df_ctl; /* data field control */
46 __be16 fh_seq_cnt; /* sequence count */
47
48 __be16 fh_ox_id; /* originator exchange ID */
49 __be16 fh_rx_id; /* responder exchange ID */
50 __be32 fh_parm_offset; /* parameter or relative offset */
51};
52
53#define FC_FRAME_HEADER_LEN 24 /* expected length of structure */
54
55#define FC_MAX_PAYLOAD 2112U /* max payload length in bytes */
56#define FC_MIN_MAX_PAYLOAD 256U /* lower limit on max payload */
57
58#define FC_MAX_FRAME (FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
59#define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
60
61/*
62 * fh_r_ctl - Routing control definitions.
63 */
64 /*
65 * FC-4 device_data.
66 */
67enum fc_rctl {
68 FC_RCTL_DD_UNCAT = 0x00, /* uncategorized information */
69 FC_RCTL_DD_SOL_DATA = 0x01, /* solicited data */
70 FC_RCTL_DD_UNSOL_CTL = 0x02, /* unsolicited control */
71 FC_RCTL_DD_SOL_CTL = 0x03, /* solicited control or reply */
72 FC_RCTL_DD_UNSOL_DATA = 0x04, /* unsolicited data */
73 FC_RCTL_DD_DATA_DESC = 0x05, /* data descriptor */
74 FC_RCTL_DD_UNSOL_CMD = 0x06, /* unsolicited command */
75 FC_RCTL_DD_CMD_STATUS = 0x07, /* command status */
76
77#define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL /* ILS request */
78#define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL /* ILS reply */
79
80 /*
81 * Extended Link_Data
82 */
83 FC_RCTL_ELS_REQ = 0x22, /* extended link services request */
84 FC_RCTL_ELS_REP = 0x23, /* extended link services reply */
85 FC_RCTL_ELS4_REQ = 0x32, /* FC-4 ELS request */
86 FC_RCTL_ELS4_REP = 0x33, /* FC-4 ELS reply */
87 /*
88 * Optional Extended Headers
89 */
90 FC_RCTL_VFTH = 0x50, /* virtual fabric tagging header */
91 FC_RCTL_IFRH = 0x51, /* inter-fabric routing header */
92 FC_RCTL_ENCH = 0x52, /* encapsulation header */
93 /*
94 * Basic Link Services fh_r_ctl values.
95 */
96 FC_RCTL_BA_NOP = 0x80, /* basic link service NOP */
97 FC_RCTL_BA_ABTS = 0x81, /* basic link service abort */
98 FC_RCTL_BA_RMC = 0x82, /* remove connection */
99 FC_RCTL_BA_ACC = 0x84, /* basic accept */
100 FC_RCTL_BA_RJT = 0x85, /* basic reject */
101 FC_RCTL_BA_PRMT = 0x86, /* dedicated connection preempted */
102 /*
103 * Link Control Information.
104 */
105 FC_RCTL_ACK_1 = 0xc0, /* acknowledge_1 */
106 FC_RCTL_ACK_0 = 0xc1, /* acknowledge_0 */
107 FC_RCTL_P_RJT = 0xc2, /* port reject */
108 FC_RCTL_F_RJT = 0xc3, /* fabric reject */
109 FC_RCTL_P_BSY = 0xc4, /* port busy */
110 FC_RCTL_F_BSY = 0xc5, /* fabric busy to data frame */
111 FC_RCTL_F_BSYL = 0xc6, /* fabric busy to link control frame */
112 FC_RCTL_LCR = 0xc7, /* link credit reset */
113 FC_RCTL_END = 0xc9, /* end */
114};
115 /* incomplete list of definitions */
116
117/*
118 * R_CTL names initializer.
119 * Please keep this matching the above definitions.
120 */
121#define FC_RCTL_NAMES_INIT { \
122 [FC_RCTL_DD_UNCAT] = "uncat", \
123 [FC_RCTL_DD_SOL_DATA] = "sol data", \
124 [FC_RCTL_DD_UNSOL_CTL] = "unsol ctl", \
125 [FC_RCTL_DD_SOL_CTL] = "sol ctl/reply", \
126 [FC_RCTL_DD_UNSOL_DATA] = "unsol data", \
127 [FC_RCTL_DD_DATA_DESC] = "data desc", \
128 [FC_RCTL_DD_UNSOL_CMD] = "unsol cmd", \
129 [FC_RCTL_DD_CMD_STATUS] = "cmd status", \
130 [FC_RCTL_ELS_REQ] = "ELS req", \
131 [FC_RCTL_ELS_REP] = "ELS rep", \
132 [FC_RCTL_ELS4_REQ] = "FC-4 ELS req", \
133 [FC_RCTL_ELS4_REP] = "FC-4 ELS rep", \
134 [FC_RCTL_BA_NOP] = "BLS NOP", \
135 [FC_RCTL_BA_ABTS] = "BLS abort", \
136 [FC_RCTL_BA_RMC] = "BLS remove connection", \
137 [FC_RCTL_BA_ACC] = "BLS accept", \
138 [FC_RCTL_BA_RJT] = "BLS reject", \
139 [FC_RCTL_BA_PRMT] = "BLS dedicated connection preempted", \
140 [FC_RCTL_ACK_1] = "LC ACK_1", \
141 [FC_RCTL_ACK_0] = "LC ACK_0", \
142 [FC_RCTL_P_RJT] = "LC port reject", \
143 [FC_RCTL_F_RJT] = "LC fabric reject", \
144 [FC_RCTL_P_BSY] = "LC port busy", \
145 [FC_RCTL_F_BSY] = "LC fabric busy to data frame", \
146 [FC_RCTL_F_BSYL] = "LC fabric busy to link control frame",\
147 [FC_RCTL_LCR] = "LC link credit reset", \
148 [FC_RCTL_END] = "LC end", \
149}
150
151/*
152 * Well-known fabric addresses.
153 */
154enum fc_well_known_fid {
155 FC_FID_NONE = 0x000000, /* No destination */
156 FC_FID_BCAST = 0xffffff, /* broadcast */
157 FC_FID_FLOGI = 0xfffffe, /* fabric login */
158 FC_FID_FCTRL = 0xfffffd, /* fabric controller */
159 FC_FID_DIR_SERV = 0xfffffc, /* directory server */
160 FC_FID_TIME_SERV = 0xfffffb, /* time server */
161 FC_FID_MGMT_SERV = 0xfffffa, /* management server */
162 FC_FID_QOS = 0xfffff9, /* QoS Facilitator */
163 FC_FID_ALIASES = 0xfffff8, /* alias server (FC-PH2) */
164 FC_FID_SEC_KEY = 0xfffff7, /* Security key dist. server */
165 FC_FID_CLOCK = 0xfffff6, /* clock synch server */
166 FC_FID_MCAST_SERV = 0xfffff5, /* multicast server */
167};
168
169#define FC_FID_WELL_KNOWN_MAX 0xffffff /* highest well-known fabric ID */
170#define FC_FID_WELL_KNOWN_BASE 0xfffff5 /* start of well-known fabric ID */
171
172/*
173 * Other well-known addresses, outside the above contiguous range.
174 */
175#define FC_FID_DOM_MGR 0xfffc00 /* domain manager base */
176
177/*
178 * Fabric ID bytes.
179 */
180#define FC_FID_DOMAIN 0
181#define FC_FID_PORT 1
182#define FC_FID_LINK 2
183
184/*
185 * fh_type codes
186 */
187enum fc_fh_type {
188 FC_TYPE_BLS = 0x00, /* basic link service */
189 FC_TYPE_ELS = 0x01, /* extended link service */
190 FC_TYPE_IP = 0x05, /* IP over FC, RFC 4338 */
191 FC_TYPE_FCP = 0x08, /* SCSI FCP */
192 FC_TYPE_CT = 0x20, /* Fibre Channel Services (FC-CT) */
193 FC_TYPE_ILS = 0x22, /* internal link service */
194 FC_TYPE_NVME = 0x28, /* FC-NVME */
195};
196
197/*
198 * FC_TYPE names initializer.
199 * Please keep this matching the above definitions.
200 */
201#define FC_TYPE_NAMES_INIT { \
202 [FC_TYPE_BLS] = "BLS", \
203 [FC_TYPE_ELS] = "ELS", \
204 [FC_TYPE_IP] = "IP", \
205 [FC_TYPE_FCP] = "FCP", \
206 [FC_TYPE_CT] = "CT", \
207 [FC_TYPE_ILS] = "ILS", \
208 [FC_TYPE_NVME] = "NVME", \
209}
210
211/*
212 * Exchange IDs.
213 */
214#define FC_XID_UNKNOWN 0xffff /* unknown exchange ID */
215#define FC_XID_MIN 0x0 /* supported min exchange ID */
216#define FC_XID_MAX 0xfffe /* supported max exchange ID */
217
218/*
219 * fh_f_ctl - Frame control flags.
220 */
221#define FC_FC_EX_CTX (1 << 23) /* sent by responder to exchange */
222#define FC_FC_SEQ_CTX (1 << 22) /* sent by responder to sequence */
223#define FC_FC_FIRST_SEQ (1 << 21) /* first sequence of this exchange */
224#define FC_FC_LAST_SEQ (1 << 20) /* last sequence of this exchange */
225#define FC_FC_END_SEQ (1 << 19) /* last frame of sequence */
226#define FC_FC_END_CONN (1 << 18) /* end of class 1 connection pending */
227#define FC_FC_RES_B17 (1 << 17) /* reserved */
228#define FC_FC_SEQ_INIT (1 << 16) /* transfer of sequence initiative */
229#define FC_FC_X_ID_REASS (1 << 15) /* exchange ID has been changed */
230#define FC_FC_X_ID_INVAL (1 << 14) /* exchange ID invalidated */
231
232#define FC_FC_ACK_1 (1 << 12) /* 13:12 = 1: ACK_1 expected */
233#define FC_FC_ACK_N (2 << 12) /* 13:12 = 2: ACK_N expected */
234#define FC_FC_ACK_0 (3 << 12) /* 13:12 = 3: ACK_0 expected */
235
236#define FC_FC_RES_B11 (1 << 11) /* reserved */
237#define FC_FC_RES_B10 (1 << 10) /* reserved */
238#define FC_FC_RETX_SEQ (1 << 9) /* retransmitted sequence */
239#define FC_FC_UNI_TX (1 << 8) /* unidirectional transmit (class 1) */
240#define FC_FC_CONT_SEQ(i) ((i) << 6)
241#define FC_FC_ABT_SEQ(i) ((i) << 4)
242#define FC_FC_REL_OFF (1 << 3) /* parameter is relative offset */
243#define FC_FC_RES2 (1 << 2) /* reserved */
244#define FC_FC_FILL(i) ((i) & 3) /* 1:0: bytes of trailing fill */
245
246/*
247 * BA_ACC payload.
248 */
249struct fc_ba_acc {
250 __u8 ba_seq_id_val; /* SEQ_ID validity */
251#define FC_BA_SEQ_ID_VAL 0x80
252 __u8 ba_seq_id; /* SEQ_ID of seq last deliverable */
253 __u8 ba_resvd[2]; /* reserved */
254 __be16 ba_ox_id; /* OX_ID for aborted seq or exch */
255 __be16 ba_rx_id; /* RX_ID for aborted seq or exch */
256 __be16 ba_low_seq_cnt; /* low SEQ_CNT of aborted seq */
257 __be16 ba_high_seq_cnt; /* high SEQ_CNT of aborted seq */
258};
259
260/*
261 * BA_RJT: Basic Reject payload.
262 */
263struct fc_ba_rjt {
264 __u8 br_resvd; /* reserved */
265 __u8 br_reason; /* reason code */
266 __u8 br_explan; /* reason explanation */
267 __u8 br_vendor; /* vendor unique code */
268};
269
270/*
271 * BA_RJT reason codes.
272 * From FS-2.
273 */
274enum fc_ba_rjt_reason {
275 FC_BA_RJT_NONE = 0, /* in software this means no reject */
276 FC_BA_RJT_INVL_CMD = 0x01, /* invalid command code */
277 FC_BA_RJT_LOG_ERR = 0x03, /* logical error */
278 FC_BA_RJT_LOG_BUSY = 0x05, /* logical busy */
279 FC_BA_RJT_PROTO_ERR = 0x07, /* protocol error */
280 FC_BA_RJT_UNABLE = 0x09, /* unable to perform request */
281 FC_BA_RJT_VENDOR = 0xff, /* vendor-specific (see br_vendor) */
282};
283
284/*
285 * BA_RJT reason code explanations.
286 */
287enum fc_ba_rjt_explan {
288 FC_BA_RJT_EXP_NONE = 0x00, /* no additional expanation */
289 FC_BA_RJT_INV_XID = 0x03, /* invalid OX_ID-RX_ID combination */
290 FC_BA_RJT_ABT = 0x05, /* sequence aborted, no seq info */
291};
292
293/*
294 * P_RJT or F_RJT: Port Reject or Fabric Reject parameter field.
295 */
296struct fc_pf_rjt {
297 __u8 rj_action; /* reserved */
298 __u8 rj_reason; /* reason code */
299 __u8 rj_resvd; /* reserved */
300 __u8 rj_vendor; /* vendor unique code */
301};
302
303/*
304 * P_RJT and F_RJT reject reason codes.
305 */
306enum fc_pf_rjt_reason {
307 FC_RJT_NONE = 0, /* non-reject (reserved by standard) */
308 FC_RJT_INVL_DID = 0x01, /* invalid destination ID */
309 FC_RJT_INVL_SID = 0x02, /* invalid source ID */
310 FC_RJT_P_UNAV_T = 0x03, /* port unavailable, temporary */
311 FC_RJT_P_UNAV = 0x04, /* port unavailable, permanent */
312 FC_RJT_CLS_UNSUP = 0x05, /* class not supported */
313 FC_RJT_DEL_USAGE = 0x06, /* delimiter usage error */
314 FC_RJT_TYPE_UNSUP = 0x07, /* type not supported */
315 FC_RJT_LINK_CTL = 0x08, /* invalid link control */
316 FC_RJT_R_CTL = 0x09, /* invalid R_CTL field */
317 FC_RJT_F_CTL = 0x0a, /* invalid F_CTL field */
318 FC_RJT_OX_ID = 0x0b, /* invalid originator exchange ID */
319 FC_RJT_RX_ID = 0x0c, /* invalid responder exchange ID */
320 FC_RJT_SEQ_ID = 0x0d, /* invalid sequence ID */
321 FC_RJT_DF_CTL = 0x0e, /* invalid DF_CTL field */
322 FC_RJT_SEQ_CNT = 0x0f, /* invalid SEQ_CNT field */
323 FC_RJT_PARAM = 0x10, /* invalid parameter field */
324 FC_RJT_EXCH_ERR = 0x11, /* exchange error */
325 FC_RJT_PROTO = 0x12, /* protocol error */
326 FC_RJT_LEN = 0x13, /* incorrect length */
327 FC_RJT_UNEXP_ACK = 0x14, /* unexpected ACK */
328 FC_RJT_FAB_CLASS = 0x15, /* class unsupported by fabric entity */
329 FC_RJT_LOGI_REQ = 0x16, /* login required */
330 FC_RJT_SEQ_XS = 0x17, /* excessive sequences attempted */
331 FC_RJT_EXCH_EST = 0x18, /* unable to establish exchange */
332 FC_RJT_FAB_UNAV = 0x1a, /* fabric unavailable */
333 FC_RJT_VC_ID = 0x1b, /* invalid VC_ID (class 4) */
334 FC_RJT_CS_CTL = 0x1c, /* invalid CS_CTL field */
335 FC_RJT_INSUF_RES = 0x1d, /* insuff. resources for VC (Class 4) */
336 FC_RJT_INVL_CLS = 0x1f, /* invalid class of service */
337 FC_RJT_PREEMT_RJT = 0x20, /* preemption request rejected */
338 FC_RJT_PREEMT_DIS = 0x21, /* preemption not enabled */
339 FC_RJT_MCAST_ERR = 0x22, /* multicast error */
340 FC_RJT_MCAST_ET = 0x23, /* multicast error terminate */
341 FC_RJT_PRLI_REQ = 0x24, /* process login required */
342 FC_RJT_INVL_ATT = 0x25, /* invalid attachment */
343 FC_RJT_VENDOR = 0xff, /* vendor specific reject */
344};
345
346/* default timeout values */
347
348#define FC_DEF_E_D_TOV 2000UL
349#define FC_DEF_R_A_TOV 10000UL
350
351#endif /* _FC_FS_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/fc/fc_gs.h deleted-97
...@@ -1,97 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Maintained at www.Open-FCoE.org
19 */
20
21#ifndef _FC_GS_H_
22#define _FC_GS_H_
23
24#include <linux/types.h>
25
26/*
27 * Fibre Channel Services - Common Transport.
28 * From T11.org FC-GS-2 Rev 5.3 November 1998.
29 */
30
31struct fc_ct_hdr {
32 __u8 ct_rev; /* revision */
33 __u8 ct_in_id[3]; /* N_Port ID of original requestor */
34 __u8 ct_fs_type; /* type of fibre channel service */
35 __u8 ct_fs_subtype; /* subtype */
36 __u8 ct_options;
37 __u8 _ct_resvd1;
38 __be16 ct_cmd; /* command / response code */
39 __be16 ct_mr_size; /* maximum / residual size */
40 __u8 _ct_resvd2;
41 __u8 ct_reason; /* reject reason */
42 __u8 ct_explan; /* reason code explanation */
43 __u8 ct_vendor; /* vendor unique data */
44};
45
46#define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */
47
48enum fc_ct_rev {
49 FC_CT_REV = 1 /* common transport revision */
50};
51
52/*
53 * ct_fs_type values.
54 */
55enum fc_ct_fs_type {
56 FC_FST_ALIAS = 0xf8, /* alias service */
57 FC_FST_MGMT = 0xfa, /* management service */
58 FC_FST_TIME = 0xfb, /* time service */
59 FC_FST_DIR = 0xfc, /* directory service */
60};
61
62/*
63 * ct_cmd: Command / response codes
64 */
65enum fc_ct_cmd {
66 FC_FS_RJT = 0x8001, /* reject */
67 FC_FS_ACC = 0x8002, /* accept */
68};
69
70/*
71 * FS_RJT reason codes.
72 */
73enum fc_ct_reason {
74 FC_FS_RJT_CMD = 0x01, /* invalid command code */
75 FC_FS_RJT_VER = 0x02, /* invalid version level */
76 FC_FS_RJT_LOG = 0x03, /* logical error */
77 FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */
78 FC_FS_RJT_BSY = 0x05, /* logical busy */
79 FC_FS_RJT_PROTO = 0x07, /* protocol error */
80 FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */
81 FC_FS_RJT_UNSUP = 0x0b, /* command not supported */
82};
83
84/*
85 * FS_RJT reason code explanations.
86 */
87enum fc_ct_explan {
88 FC_FS_EXP_NONE = 0x00, /* no additional explanation */
89 FC_FS_EXP_PID = 0x01, /* port ID not registered */
90 FC_FS_EXP_PNAM = 0x02, /* port name not registered */
91 FC_FS_EXP_NNAM = 0x03, /* node name not registered */
92 FC_FS_EXP_COS = 0x04, /* class of service not registered */
93 FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */
94 /* definitions not complete */
95};
96
97#endif /* _FC_GS_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/fc/fc_ns.h deleted-209
...@@ -1,209 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2007 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Maintained at www.Open-FCoE.org
19 */
20
21#ifndef _FC_NS_H_
22#define _FC_NS_H_
23
24#include <linux/types.h>
25
26/*
27 * Fibre Channel Services - Name Service (dNS)
28 * From T11.org FC-GS-2 Rev 5.3 November 1998.
29 */
30
31/*
32 * Common-transport sub-type for Name Server.
33 */
34#define FC_NS_SUBTYPE 2 /* fs_ct_hdr.ct_fs_subtype */
35
36/*
37 * Name server Requests.
38 * Note: this is an incomplete list, some unused requests are omitted.
39 */
40enum fc_ns_req {
41 FC_NS_GA_NXT = 0x0100, /* get all next */
42 FC_NS_GI_A = 0x0101, /* get identifiers - scope */
43 FC_NS_GPN_ID = 0x0112, /* get port name by ID */
44 FC_NS_GNN_ID = 0x0113, /* get node name by ID */
45 FC_NS_GSPN_ID = 0x0118, /* get symbolic port name */
46 FC_NS_GID_PN = 0x0121, /* get ID for port name */
47 FC_NS_GID_NN = 0x0131, /* get IDs for node name */
48 FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */
49 FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */
50 FC_NS_GID_PT = 0x01a1, /* get IDs by port type */
51 FC_NS_RPN_ID = 0x0212, /* reg port name for ID */
52 FC_NS_RNN_ID = 0x0213, /* reg node name for ID */
53 FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */
54 FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */
55 FC_NS_RFF_ID = 0x021f, /* reg FC4 Features for ID */
56 FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */
57};
58
59/*
60 * Port type values.
61 */
62enum fc_ns_pt {
63 FC_NS_UNID_PORT = 0x00, /* unidentified */
64 FC_NS_N_PORT = 0x01, /* N port */
65 FC_NS_NL_PORT = 0x02, /* NL port */
66 FC_NS_FNL_PORT = 0x03, /* F/NL port */
67 FC_NS_NX_PORT = 0x7f, /* Nx port */
68 FC_NS_F_PORT = 0x81, /* F port */
69 FC_NS_FL_PORT = 0x82, /* FL port */
70 FC_NS_E_PORT = 0x84, /* E port */
71 FC_NS_B_PORT = 0x85, /* B port */
72};
73
74/*
75 * Port type object.
76 */
77struct fc_ns_pt_obj {
78 __u8 pt_type;
79};
80
81/*
82 * Port ID object
83 */
84struct fc_ns_fid {
85 __u8 fp_flags; /* flags for responses only */
86 __u8 fp_fid[3];
87};
88
89/*
90 * fp_flags in port ID object, for responses only.
91 */
92#define FC_NS_FID_LAST 0x80 /* last object */
93
94/*
95 * FC4-types object.
96 */
97#define FC_NS_TYPES 256 /* number of possible FC-4 types */
98#define FC_NS_BPW 32 /* bits per word in bitmap */
99
100struct fc_ns_fts {
101 __be32 ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */
102};
103
104/*
105 * FC4-features object.
106 */
107struct fc_ns_ff {
108 __be32 fd_feat[FC_NS_TYPES * 4 / FC_NS_BPW]; /* 4-bits per FC-type */
109};
110
111/*
112 * GID_PT request.
113 */
114struct fc_ns_gid_pt {
115 __u8 fn_pt_type;
116 __u8 fn_domain_id_scope;
117 __u8 fn_area_id_scope;
118 __u8 fn_resvd;
119};
120
121/*
122 * GID_FT or GPN_FT request.
123 */
124struct fc_ns_gid_ft {
125 __u8 fn_resvd;
126 __u8 fn_domain_id_scope;
127 __u8 fn_area_id_scope;
128 __u8 fn_fc4_type;
129};
130
131/*
132 * GPN_FT response.
133 */
134struct fc_gpn_ft_resp {
135 __u8 fp_flags; /* see fp_flags definitions above */
136 __u8 fp_fid[3]; /* port ID */
137 __be32 fp_resvd;
138 __be64 fp_wwpn; /* port name */
139};
140
141/*
142 * GID_PN request
143 */
144struct fc_ns_gid_pn {
145 __be64 fn_wwpn; /* port name */
146};
147
148/*
149 * GID_PN response or GSPN_ID request
150 */
151struct fc_gid_pn_resp {
152 __u8 fp_resvd;
153 __u8 fp_fid[3]; /* port ID */
154};
155
156/*
157 * GSPN_ID response
158 */
159struct fc_gspn_resp {
160 __u8 fp_name_len;
161 char fp_name[];
162};
163
164/*
165 * RFT_ID request - register FC-4 types for ID.
166 */
167struct fc_ns_rft_id {
168 struct fc_ns_fid fr_fid; /* port ID object */
169 struct fc_ns_fts fr_fts; /* FC-4 types object */
170};
171
172/*
173 * RPN_ID request - register port name for ID.
174 * RNN_ID request - register node name for ID.
175 */
176struct fc_ns_rn_id {
177 struct fc_ns_fid fr_fid; /* port ID object */
178 __be64 fr_wwn; /* node name or port name */
179} __attribute__((__packed__));
180
181/*
182 * RSNN_NN request - register symbolic node name
183 */
184struct fc_ns_rsnn {
185 __be64 fr_wwn; /* node name */
186 __u8 fr_name_len;
187 char fr_name[];
188} __attribute__((__packed__));
189
190/*
191 * RSPN_ID request - register symbolic port name
192 */
193struct fc_ns_rspn {
194 struct fc_ns_fid fr_fid; /* port ID object */
195 __u8 fr_name_len;
196 char fr_name[];
197} __attribute__((__packed__));
198
199/*
200 * RFF_ID request - register FC-4 Features for ID.
201 */
202struct fc_ns_rff_id {
203 struct fc_ns_fid fr_fid; /* port ID object */
204 __u8 fr_resvd[2];
205 __u8 fr_feat; /* FC-4 Feature bits */
206 __u8 fr_type; /* FC-4 type */
207} __attribute__((__packed__));
208
209#endif /* _FC_NS_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/scsi_bsg_fc.h deleted-320
...@@ -1,320 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * FC Transport BSG Interface
4 *
5 * Copyright (C) 2008 James Smart, Emulex Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#ifndef SCSI_BSG_FC_H
24#define SCSI_BSG_FC_H
25
26/*
27 * This file intended to be included by both kernel and user space
28 */
29
30/*
31 * FC Transport SGIO v4 BSG Message Support
32 */
33
34/* Default BSG request timeout (in seconds) */
35#define FC_DEFAULT_BSG_TIMEOUT (10 * HZ)
36
37
38/*
39 * Request Message Codes supported by the FC Transport
40 */
41
42/* define the class masks for the message codes */
43#define FC_BSG_CLS_MASK 0xF0000000 /* find object class */
44#define FC_BSG_HST_MASK 0x80000000 /* fc host class */
45#define FC_BSG_RPT_MASK 0x40000000 /* fc rport class */
46
47 /* fc_host Message Codes */
48#define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001)
49#define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002)
50#define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003)
51#define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004)
52#define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF)
53
54 /* fc_rport Message Codes */
55#define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001)
56#define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002)
57
58
59
60/*
61 * FC Address Identifiers in Message Structures :
62 *
63 * Whenever a command payload contains a FC Address Identifier
64 * (aka port_id), the value is effectively in big-endian
65 * order, thus the array elements are decoded as follows:
66 * element [0] is bits 23:16 of the FC Address Identifier
67 * element [1] is bits 15:8 of the FC Address Identifier
68 * element [2] is bits 7:0 of the FC Address Identifier
69 */
70
71
72/*
73 * FC Host Messages
74 */
75
76/* FC_BSG_HST_ADDR_PORT : */
77
78/* Request:
79 * This message requests the FC host to login to the remote port
80 * at the specified N_Port_Id. The remote port is to be enumerated
81 * with the transport upon completion of the login.
82 */
83struct fc_bsg_host_add_rport {
84 uint8_t reserved;
85
86 /* FC Address Identier of the remote port to login to */
87 uint8_t port_id[3];
88};
89
90/* Response:
91 * There is no additional response data - fc_bsg_reply->result is sufficient
92 */
93
94
95/* FC_BSG_HST_DEL_RPORT : */
96
97/* Request:
98 * This message requests the FC host to remove an enumerated
99 * remote port and to terminate the login to it.
100 *
101 * Note: The driver is free to reject this request if it desires to
102 * remain logged in with the remote port.
103 */
104struct fc_bsg_host_del_rport {
105 uint8_t reserved;
106
107 /* FC Address Identier of the remote port to logout of */
108 uint8_t port_id[3];
109};
110
111/* Response:
112 * There is no additional response data - fc_bsg_reply->result is sufficient
113 */
114
115
116/* FC_BSG_HST_ELS_NOLOGIN : */
117
118/* Request:
119 * This message requests the FC_Host to send an ELS to a specific
120 * N_Port_ID. The host does not need to log into the remote port,
121 * nor does it need to enumerate the rport for further traffic
122 * (although, the FC host is free to do so if it desires).
123 */
124struct fc_bsg_host_els {
125 /*
126 * ELS Command Code being sent (must be the same as byte 0
127 * of the payload)
128 */
129 uint8_t command_code;
130
131 /* FC Address Identier of the remote port to send the ELS to */
132 uint8_t port_id[3];
133};
134
135/* Response:
136 */
137/* fc_bsg_ctels_reply->status values */
138#define FC_CTELS_STATUS_OK 0x00000000
139#define FC_CTELS_STATUS_REJECT 0x00000001
140#define FC_CTELS_STATUS_P_RJT 0x00000002
141#define FC_CTELS_STATUS_F_RJT 0x00000003
142#define FC_CTELS_STATUS_P_BSY 0x00000004
143#define FC_CTELS_STATUS_F_BSY 0x00000006
144struct fc_bsg_ctels_reply {
145 /*
146 * Note: An ELS LS_RJT may be reported in 2 ways:
147 * a) A status of FC_CTELS_STATUS_OK is returned. The caller
148 * is to look into the ELS receive payload to determine
149 * LS_ACC or LS_RJT (by contents of word 0). The reject
150 * data will be in word 1.
151 * b) A status of FC_CTELS_STATUS_REJECT is returned, The
152 * rjt_data field will contain valid data.
153 *
154 * Note: ELS LS_ACC is determined by an FC_CTELS_STATUS_OK, and
155 * the receive payload word 0 indicates LS_ACC
156 * (e.g. value is 0x02xxxxxx).
157 *
158 * Note: Similarly, a CT Reject may be reported in 2 ways:
159 * a) A status of FC_CTELS_STATUS_OK is returned. The caller
160 * is to look into the CT receive payload to determine
161 * Accept or Reject (by contents of word 2). The reject
162 * data will be in word 3.
163 * b) A status of FC_CTELS_STATUS_REJECT is returned, The
164 * rjt_data field will contain valid data.
165 *
166 * Note: x_RJT/BSY status will indicae that the rjt_data field
167 * is valid and contains the reason/explanation values.
168 */
169 uint32_t status; /* See FC_CTELS_STATUS_xxx */
170
171 /* valid if status is not FC_CTELS_STATUS_OK */
172 struct {
173 uint8_t action; /* fragment_id for CT REJECT */
174 uint8_t reason_code;
175 uint8_t reason_explanation;
176 uint8_t vendor_unique;
177 } rjt_data;
178};
179
180
181/* FC_BSG_HST_CT : */
182
183/* Request:
184 * This message requests that a CT Request be performed with the
185 * indicated N_Port_ID. The driver is responsible for logging in with
186 * the fabric and/or N_Port_ID, etc as per FC rules. This request does
187 * not mandate that the driver must enumerate the destination in the
188 * transport. The driver is allowed to decide whether to enumerate it,
189 * and whether to tear it down after the request.
190 */
191struct fc_bsg_host_ct {
192 uint8_t reserved;
193
194 /* FC Address Identier of the remote port to send the ELS to */
195 uint8_t port_id[3];
196
197 /*
198 * We need words 0-2 of the generic preamble for the LLD's
199 */
200 uint32_t preamble_word0; /* revision & IN_ID */
201 uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
202 uint32_t preamble_word2; /* Cmd Code, Max Size */
203
204};
205/* Response:
206 *
207 * The reply structure is an fc_bsg_ctels_reply structure
208 */
209
210
211/* FC_BSG_HST_VENDOR : */
212
213/* Request:
214 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
215 * formatting requirements specified in scsi_netlink.h
216 */
217struct fc_bsg_host_vendor {
218 /*
219 * Identifies the vendor that the message is formatted for. This
220 * should be the recipient of the message.
221 */
222 uint64_t vendor_id;
223
224 /* start of vendor command area */
225 uint32_t vendor_cmd[0];
226};
227
228/* Response:
229 */
230struct fc_bsg_host_vendor_reply {
231 /* start of vendor response area */
232 uint32_t vendor_rsp[0];
233};
234
235
236
237/*
238 * FC Remote Port Messages
239 */
240
241/* FC_BSG_RPT_ELS : */
242
243/* Request:
244 * This message requests that an ELS be performed with the rport.
245 */
246struct fc_bsg_rport_els {
247 /*
248 * ELS Command Code being sent (must be the same as
249 * byte 0 of the payload)
250 */
251 uint8_t els_code;
252};
253
254/* Response:
255 *
256 * The reply structure is an fc_bsg_ctels_reply structure
257 */
258
259
260/* FC_BSG_RPT_CT : */
261
262/* Request:
263 * This message requests that a CT Request be performed with the rport.
264 */
265struct fc_bsg_rport_ct {
266 /*
267 * We need words 0-2 of the generic preamble for the LLD's
268 */
269 uint32_t preamble_word0; /* revision & IN_ID */
270 uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
271 uint32_t preamble_word2; /* Cmd Code, Max Size */
272};
273/* Response:
274 *
275 * The reply structure is an fc_bsg_ctels_reply structure
276 */
277
278
279
280
281/* request (CDB) structure of the sg_io_v4 */
282struct fc_bsg_request {
283 uint32_t msgcode;
284 union {
285 struct fc_bsg_host_add_rport h_addrport;
286 struct fc_bsg_host_del_rport h_delrport;
287 struct fc_bsg_host_els h_els;
288 struct fc_bsg_host_ct h_ct;
289 struct fc_bsg_host_vendor h_vendor;
290
291 struct fc_bsg_rport_els r_els;
292 struct fc_bsg_rport_ct r_ct;
293 } rqst_data;
294} __attribute__((packed));
295
296
297/* response (request sense data) structure of the sg_io_v4 */
298struct fc_bsg_reply {
299 /*
300 * The completion result. Result exists in two forms:
301 * if negative, it is an -Exxx system errno value. There will
302 * be no further reply information supplied.
303 * else, it's the 4-byte scsi error result, with driver, host,
304 * msg and status fields. The per-msgcode reply structure
305 * will contain valid data.
306 */
307 uint32_t result;
308
309 /* If there was reply_payload, how much was recevied ? */
310 uint32_t reply_payload_rcv_len;
311
312 union {
313 struct fc_bsg_host_vendor_reply vendor_reply;
314
315 struct fc_bsg_ctels_reply ctels_reply;
316 } reply_data;
317};
318
319
320#endif /* SCSI_BSG_FC_H */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/scsi_netlink.h deleted-123
...@@ -1,123 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * SCSI Transport Netlink Interface
4 * Used for the posting of outbound SCSI transport events
5 *
6 * Copyright (C) 2006 James Smart, Emulex Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef SCSI_NETLINK_H
24#define SCSI_NETLINK_H
25
26#include <linux/netlink.h>
27#include <linux/types.h>
28
29/*
30 * This file intended to be included by both kernel and user space
31 */
32
33/* Single Netlink Message type to send all SCSI Transport messages */
34#define SCSI_TRANSPORT_MSG NLMSG_MIN_TYPE + 1
35
36/* SCSI Transport Broadcast Groups */
37 /* leaving groups 0 and 1 unassigned */
38#define SCSI_NL_GRP_FC_EVENTS (1<<2) /* Group 2 */
39#define SCSI_NL_GRP_CNT 3
40
41
42/* SCSI_TRANSPORT_MSG event message header */
43struct scsi_nl_hdr {
44 uint8_t version;
45 uint8_t transport;
46 uint16_t magic;
47 uint16_t msgtype;
48 uint16_t msglen;
49} __attribute__((aligned(sizeof(uint64_t))));
50
51/* scsi_nl_hdr->version value */
52#define SCSI_NL_VERSION 1
53
54/* scsi_nl_hdr->magic value */
55#define SCSI_NL_MAGIC 0xA1B2
56
57/* scsi_nl_hdr->transport value */
58#define SCSI_NL_TRANSPORT 0
59#define SCSI_NL_TRANSPORT_FC 1
60#define SCSI_NL_MAX_TRANSPORTS 2
61
62/* Transport-based scsi_nl_hdr->msgtype values are defined in each transport */
63
64/*
65 * GENERIC SCSI scsi_nl_hdr->msgtype Values
66 */
67 /* kernel -> user */
68#define SCSI_NL_SHOST_VENDOR 0x0001
69 /* user -> kernel */
70/* SCSI_NL_SHOST_VENDOR msgtype is kernel->user and user->kernel */
71
72
73/*
74 * Message Structures :
75 */
76
77/* macro to round up message lengths to 8byte boundary */
78#define SCSI_NL_MSGALIGN(len) (((len) + 7) & ~7)
79
80
81/*
82 * SCSI HOST Vendor Unique messages :
83 * SCSI_NL_SHOST_VENDOR
84 *
85 * Note: The Vendor Unique message payload will begin directly after
86 * this structure, with the length of the payload per vmsg_datalen.
87 *
88 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
89 * formatting requirements specified below
90 */
91struct scsi_nl_host_vendor_msg {
92 struct scsi_nl_hdr snlh; /* must be 1st element ! */
93 uint64_t vendor_id;
94 uint16_t host_no;
95 uint16_t vmsg_datalen;
96} __attribute__((aligned(sizeof(uint64_t))));
97
98
99/*
100 * Vendor ID:
101 * If transports post vendor-unique events, they must pass a well-known
102 * 32-bit vendor identifier. This identifier consists of 8 bits indicating
103 * the "type" of identifier contained, and 24 bits of id data.
104 *
105 * Identifiers for each type:
106 * PCI : ID data is the 16 bit PCI Registered Vendor ID
107 */
108#define SCSI_NL_VID_TYPE_SHIFT 56
109#define SCSI_NL_VID_TYPE_MASK ((__u64)0xFF << SCSI_NL_VID_TYPE_SHIFT)
110#define SCSI_NL_VID_TYPE_PCI ((__u64)0x01 << SCSI_NL_VID_TYPE_SHIFT)
111#define SCSI_NL_VID_ID_MASK (~ SCSI_NL_VID_TYPE_MASK)
112
113
114#define INIT_SCSI_NL_HDR(hdr, t, mtype, mlen) \
115 { \
116 (hdr)->version = SCSI_NL_VERSION; \
117 (hdr)->transport = t; \
118 (hdr)->magic = SCSI_NL_MAGIC; \
119 (hdr)->msgtype = mtype; \
120 (hdr)->msglen = mlen; \
121 }
122
123#endif /* SCSI_NETLINK_H */
\ No newline at end of file
lib/libc/include/generic-musl/scsi/scsi_netlink_fc.h deleted-71
...@@ -1,71 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * FC Transport Netlink Interface
4 *
5 * Copyright (C) 2006 James Smart, Emulex Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22#ifndef SCSI_NETLINK_FC_H
23#define SCSI_NETLINK_FC_H
24
25#include <scsi/scsi_netlink.h>
26
27/*
28 * This file intended to be included by both kernel and user space
29 */
30
31/*
32 * FC Transport Message Types
33 */
34 /* kernel -> user */
35#define FC_NL_ASYNC_EVENT 0x0100
36 /* user -> kernel */
37/* none */
38
39
40/*
41 * Message Structures :
42 */
43
44/* macro to round up message lengths to 8byte boundary */
45#define FC_NL_MSGALIGN(len) (((len) + 7) & ~7)
46
47
48/*
49 * FC Transport Broadcast Event Message :
50 * FC_NL_ASYNC_EVENT
51 *
52 * Note: if Vendor Unique message, &event_data will be start of
53 * vendor unique payload, and the length of the payload is
54 * per event_datalen
55 *
56 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
57 * formatting requirements specified in scsi_netlink.h
58 */
59struct fc_nl_event {
60 struct scsi_nl_hdr snlh; /* must be 1st element ! */
61 uint64_t seconds;
62 uint64_t vendor_id;
63 uint16_t host_no;
64 uint16_t event_datalen;
65 uint32_t event_num;
66 uint32_t event_code;
67 uint32_t event_data;
68} __attribute__((aligned(sizeof(uint64_t))));
69
70
71#endif /* SCSI_NETLINK_FC_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/asequencer.h deleted-612
...@@ -1,612 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Main header file for the ALSA sequencer
4 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
5 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef __SOUND_ASEQUENCER_H
24#define __SOUND_ASEQUENCER_H
25
26#include <sound/asound.h>
27
28/** version of the sequencer */
29#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)
30
31/**
32 * definition of sequencer event types
33 */
34
35/** system messages
36 * event data type = #snd_seq_result
37 */
38#define SNDRV_SEQ_EVENT_SYSTEM 0
39#define SNDRV_SEQ_EVENT_RESULT 1
40
41/** note messages (channel specific)
42 * event data type = #snd_seq_ev_note
43 */
44#define SNDRV_SEQ_EVENT_NOTE 5
45#define SNDRV_SEQ_EVENT_NOTEON 6
46#define SNDRV_SEQ_EVENT_NOTEOFF 7
47#define SNDRV_SEQ_EVENT_KEYPRESS 8
48
49/** control messages (channel specific)
50 * event data type = #snd_seq_ev_ctrl
51 */
52#define SNDRV_SEQ_EVENT_CONTROLLER 10
53#define SNDRV_SEQ_EVENT_PGMCHANGE 11
54#define SNDRV_SEQ_EVENT_CHANPRESS 12
55#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
56#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
57#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
58#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
59
60/** synchronisation messages
61 * event data type = #snd_seq_ev_ctrl
62 */
63#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
64#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
65#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
66#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
67#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
68
69/** timer messages
70 * event data type = snd_seq_ev_queue_control
71 */
72#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
73#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
74#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
75#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
76#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
77#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
78#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
79#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
80#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
81
82/** others
83 * event data type = none
84 */
85#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
86#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
87#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
88
89/** echo back, kernel private messages
90 * event data type = any type
91 */
92#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
93#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
94
95/** system status messages (broadcast for subscribers)
96 * event data type = snd_seq_addr
97 */
98#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
99#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
100#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
101#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
102#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
103#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
104
105/** port connection changes
106 * event data type = snd_seq_connect
107 */
108#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
109#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
110
111/* 70-89: synthesizer events - obsoleted */
112
113/** user-defined events with fixed length
114 * event data type = any
115 */
116#define SNDRV_SEQ_EVENT_USR0 90
117#define SNDRV_SEQ_EVENT_USR1 91
118#define SNDRV_SEQ_EVENT_USR2 92
119#define SNDRV_SEQ_EVENT_USR3 93
120#define SNDRV_SEQ_EVENT_USR4 94
121#define SNDRV_SEQ_EVENT_USR5 95
122#define SNDRV_SEQ_EVENT_USR6 96
123#define SNDRV_SEQ_EVENT_USR7 97
124#define SNDRV_SEQ_EVENT_USR8 98
125#define SNDRV_SEQ_EVENT_USR9 99
126
127/* 100-118: instrument layer - obsoleted */
128/* 119-129: reserved */
129
130/* 130-139: variable length events
131 * event data type = snd_seq_ev_ext
132 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
133 */
134#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
135#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
136/* 132-134: reserved */
137#define SNDRV_SEQ_EVENT_USR_VAR0 135
138#define SNDRV_SEQ_EVENT_USR_VAR1 136
139#define SNDRV_SEQ_EVENT_USR_VAR2 137
140#define SNDRV_SEQ_EVENT_USR_VAR3 138
141#define SNDRV_SEQ_EVENT_USR_VAR4 139
142
143/* 150-151: kernel events with quote - DO NOT use in user clients */
144#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
145#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
146
147/* 152-191: reserved */
148
149/* 192-254: hardware specific events */
150
151/* 255: special event */
152#define SNDRV_SEQ_EVENT_NONE 255
153
154
155typedef unsigned char snd_seq_event_type_t;
156
157/** event address */
158struct snd_seq_addr {
159 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
160 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
161};
162
163/** port connection */
164struct snd_seq_connect {
165 struct snd_seq_addr sender;
166 struct snd_seq_addr dest;
167};
168
169
170#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
171#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
172#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
173#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
174
175 /* event mode flag - NOTE: only 8 bits available! */
176#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
177#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
178#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
179
180#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
181#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
182#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
183
184#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
185#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
186#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
187#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
188
189#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
190#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
191#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
192
193
194 /* note event */
195struct snd_seq_ev_note {
196 unsigned char channel;
197 unsigned char note;
198 unsigned char velocity;
199 unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
200 unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
201};
202
203 /* controller event */
204struct snd_seq_ev_ctrl {
205 unsigned char channel;
206 unsigned char unused1, unused2, unused3; /* pad */
207 unsigned int param;
208 signed int value;
209};
210
211 /* generic set of bytes (12x8 bit) */
212struct snd_seq_ev_raw8 {
213 unsigned char d[12]; /* 8 bit value */
214};
215
216 /* generic set of integers (3x32 bit) */
217struct snd_seq_ev_raw32 {
218 unsigned int d[3]; /* 32 bit value */
219};
220
221 /* external stored data */
222struct snd_seq_ev_ext {
223 unsigned int len; /* length of data */
224 void *ptr; /* pointer to data (note: maybe 64-bit) */
225} __attribute__((packed));
226
227struct snd_seq_result {
228 int event; /* processed event type */
229 int result;
230};
231
232
233struct snd_seq_real_time {
234 unsigned int tv_sec; /* seconds */
235 unsigned int tv_nsec; /* nanoseconds */
236};
237
238typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
239
240union snd_seq_timestamp {
241 snd_seq_tick_time_t tick;
242 struct snd_seq_real_time time;
243};
244
245struct snd_seq_queue_skew {
246 unsigned int value;
247 unsigned int base;
248};
249
250 /* queue timer control */
251struct snd_seq_ev_queue_control {
252 unsigned char queue; /* affected queue */
253 unsigned char pad[3]; /* reserved */
254 union {
255 signed int value; /* affected value (e.g. tempo) */
256 union snd_seq_timestamp time; /* time */
257 unsigned int position; /* sync position */
258 struct snd_seq_queue_skew skew;
259 unsigned int d32[2];
260 unsigned char d8[8];
261 } param;
262};
263
264 /* quoted event - inside the kernel only */
265struct snd_seq_ev_quote {
266 struct snd_seq_addr origin; /* original sender */
267 unsigned short value; /* optional data */
268 struct snd_seq_event *event; /* quoted event */
269} __attribute__((packed));
270
271
272 /* sequencer event */
273struct snd_seq_event {
274 snd_seq_event_type_t type; /* event type */
275 unsigned char flags; /* event flags */
276 char tag;
277
278 unsigned char queue; /* schedule queue */
279 union snd_seq_timestamp time; /* schedule time */
280
281
282 struct snd_seq_addr source; /* source address */
283 struct snd_seq_addr dest; /* destination address */
284
285 union { /* event data... */
286 struct snd_seq_ev_note note;
287 struct snd_seq_ev_ctrl control;
288 struct snd_seq_ev_raw8 raw8;
289 struct snd_seq_ev_raw32 raw32;
290 struct snd_seq_ev_ext ext;
291 struct snd_seq_ev_queue_control queue;
292 union snd_seq_timestamp time;
293 struct snd_seq_addr addr;
294 struct snd_seq_connect connect;
295 struct snd_seq_result result;
296 struct snd_seq_ev_quote quote;
297 } data;
298};
299
300
301/*
302 * bounce event - stored as variable size data
303 */
304struct snd_seq_event_bounce {
305 int err;
306 struct snd_seq_event event;
307 /* external data follows here. */
308};
309
310
311 /* system information */
312struct snd_seq_system_info {
313 int queues; /* maximum queues count */
314 int clients; /* maximum clients count */
315 int ports; /* maximum ports per client */
316 int channels; /* maximum channels per port */
317 int cur_clients; /* current clients */
318 int cur_queues; /* current queues */
319 char reserved[24];
320};
321
322
323 /* system running information */
324struct snd_seq_running_info {
325 unsigned char client; /* client id */
326 unsigned char big_endian; /* 1 = big-endian */
327 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
328 unsigned char pad; /* reserved */
329 unsigned char reserved[12];
330};
331
332
333 /* known client numbers */
334#define SNDRV_SEQ_CLIENT_SYSTEM 0
335 /* internal client numbers */
336#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
337#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
338
339
340 /* client types */
341typedef int __bitwise snd_seq_client_type_t;
342#define NO_CLIENT ((snd_seq_client_type_t) 0)
343#define USER_CLIENT ((snd_seq_client_type_t) 1)
344#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
345
346 /* event filter flags */
347#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
348#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
349#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
350#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
351
352struct snd_seq_client_info {
353 int client; /* client number to inquire */
354 snd_seq_client_type_t type; /* client type */
355 char name[64]; /* client name */
356 unsigned int filter; /* filter flags */
357 unsigned char multicast_filter[8]; /* multicast filter bitmap */
358 unsigned char event_filter[32]; /* event filter bitmap */
359 int num_ports; /* RO: number of ports */
360 int event_lost; /* number of lost events */
361 int card; /* RO: card number[kernel] */
362 int pid; /* RO: pid[user] */
363 char reserved[56]; /* for future use */
364};
365
366
367/* client pool size */
368struct snd_seq_client_pool {
369 int client; /* client number to inquire */
370 int output_pool; /* outgoing (write) pool size */
371 int input_pool; /* incoming (read) pool size */
372 int output_room; /* minimum free pool size for select/blocking mode */
373 int output_free; /* unused size */
374 int input_free; /* unused size */
375 char reserved[64];
376};
377
378
379/* Remove events by specified criteria */
380
381#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
382#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
383#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
384#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
385#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
386#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
387#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
388#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
389#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
390#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
391
392struct snd_seq_remove_events {
393 unsigned int remove_mode; /* Flags that determine what gets removed */
394
395 union snd_seq_timestamp time;
396
397 unsigned char queue; /* Queue for REMOVE_DEST */
398 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
399 unsigned char channel; /* Channel for REMOVE_DEST */
400
401 int type; /* For REMOVE_EVENT_TYPE */
402 char tag; /* Tag for REMOVE_TAG */
403
404 int reserved[10]; /* To allow for future binary compatibility */
405
406};
407
408
409 /* known port numbers */
410#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
411#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
412
413 /* port capabilities (32 bits) */
414#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
415#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
416
417#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
418#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
419
420#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
421
422#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
423#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
424#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
425
426 /* port type */
427#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
428#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
429#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
430#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
431#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
432#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
433#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
434
435/* other standards...*/
436#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
437#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
438#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
439/*...*/
440#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
441#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
442#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
443#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
444#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
445
446/* misc. conditioning flags */
447#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
448#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
449#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
450
451struct snd_seq_port_info {
452 struct snd_seq_addr addr; /* client/port numbers */
453 char name[64]; /* port name */
454
455 unsigned int capability; /* port capability bits */
456 unsigned int type; /* port type bits */
457 int midi_channels; /* channels per MIDI port */
458 int midi_voices; /* voices per MIDI port */
459 int synth_voices; /* voices per SYNTH port */
460
461 int read_use; /* R/O: subscribers for output (from this port) */
462 int write_use; /* R/O: subscribers for input (to this port) */
463
464 void *kernel; /* reserved for kernel use (must be NULL) */
465 unsigned int flags; /* misc. conditioning */
466 unsigned char time_queue; /* queue # for timestamping */
467 char reserved[59]; /* for future use */
468};
469
470
471/* queue flags */
472#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
473
474/* queue information */
475struct snd_seq_queue_info {
476 int queue; /* queue id */
477
478 /*
479 * security settings, only owner of this queue can start/stop timer
480 * etc. if the queue is locked for other clients
481 */
482 int owner; /* client id for owner of the queue */
483 unsigned locked:1; /* timing queue locked for other queues */
484 char name[64]; /* name of this queue */
485 unsigned int flags; /* flags */
486 char reserved[60]; /* for future use */
487
488};
489
490/* queue info/status */
491struct snd_seq_queue_status {
492 int queue; /* queue id */
493 int events; /* read-only - queue size */
494 snd_seq_tick_time_t tick; /* current tick */
495 struct snd_seq_real_time time; /* current time */
496 int running; /* running state of queue */
497 int flags; /* various flags */
498 char reserved[64]; /* for the future */
499};
500
501
502/* queue tempo */
503struct snd_seq_queue_tempo {
504 int queue; /* sequencer queue */
505 unsigned int tempo; /* current tempo, us/tick */
506 int ppq; /* time resolution, ticks/quarter */
507 unsigned int skew_value; /* queue skew */
508 unsigned int skew_base; /* queue skew base */
509 char reserved[24]; /* for the future */
510};
511
512
513/* sequencer timer sources */
514#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
515#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
516#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
517
518/* queue timer info */
519struct snd_seq_queue_timer {
520 int queue; /* sequencer queue */
521 int type; /* source timer type */
522 union {
523 struct {
524 struct snd_timer_id id; /* ALSA's timer ID */
525 unsigned int resolution; /* resolution in Hz */
526 } alsa;
527 } u;
528 char reserved[64]; /* for the future use */
529};
530
531
532struct snd_seq_queue_client {
533 int queue; /* sequencer queue */
534 int client; /* sequencer client */
535 int used; /* queue is used with this client
536 (must be set for accepting events) */
537 /* per client watermarks */
538 char reserved[64]; /* for future use */
539};
540
541
542#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
543#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
544#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
545
546struct snd_seq_port_subscribe {
547 struct snd_seq_addr sender; /* sender address */
548 struct snd_seq_addr dest; /* destination address */
549 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
550 unsigned int flags; /* modes */
551 unsigned char queue; /* input time-stamp queue (optional) */
552 unsigned char pad[3]; /* reserved */
553 char reserved[64];
554};
555
556/* type of query subscription */
557#define SNDRV_SEQ_QUERY_SUBS_READ 0
558#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
559
560struct snd_seq_query_subs {
561 struct snd_seq_addr root; /* client/port id to be searched */
562 int type; /* READ or WRITE */
563 int index; /* 0..N-1 */
564 int num_subs; /* R/O: number of subscriptions on this port */
565 struct snd_seq_addr addr; /* R/O: result */
566 unsigned char queue; /* R/O: result */
567 unsigned int flags; /* R/O: result */
568 char reserved[64]; /* for future use */
569};
570
571
572/*
573 * IOCTL commands
574 */
575
576#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
577#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
578#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
579#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
580
581#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
582#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
583
584#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
585#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
586#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
587#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
588
589#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
590#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
591
592#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
593#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
594#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
595#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
596#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
597#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
598#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
599#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
600#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
601#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
602#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
603#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
604#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
605#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
606#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
607#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
608#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
609#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
610#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
611
612#endif /* __SOUND_ASEQUENCER_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/asoc.h deleted-633
...@@ -1,633 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM
4 *
5 * Copyright (C) 2012 Texas Instruments Inc.
6 * Copyright (C) 2015 Intel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
13 * algorithms, equalisers, DAIs, widgets etc.
14*/
15
16#ifndef __LINUX_UAPI_SND_ASOC_H
17#define __LINUX_UAPI_SND_ASOC_H
18
19#include <linux/types.h>
20#include <sound/asound.h>
21
22/*
23 * Maximum number of channels topology kcontrol can represent.
24 */
25#define SND_SOC_TPLG_MAX_CHAN 8
26
27/*
28 * Maximum number of PCM formats capability
29 */
30#define SND_SOC_TPLG_MAX_FORMATS 16
31
32/*
33 * Maximum number of PCM stream configs
34 */
35#define SND_SOC_TPLG_STREAM_CONFIG_MAX 8
36
37/*
38 * Maximum number of physical link's hardware configs
39 */
40#define SND_SOC_TPLG_HW_CONFIG_MAX 8
41
42/* individual kcontrol info types - can be mixed with other types */
43#define SND_SOC_TPLG_CTL_VOLSW 1
44#define SND_SOC_TPLG_CTL_VOLSW_SX 2
45#define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3
46#define SND_SOC_TPLG_CTL_ENUM 4
47#define SND_SOC_TPLG_CTL_BYTES 5
48#define SND_SOC_TPLG_CTL_ENUM_VALUE 6
49#define SND_SOC_TPLG_CTL_RANGE 7
50#define SND_SOC_TPLG_CTL_STROBE 8
51
52
53/* individual widget kcontrol info types - can be mixed with other types */
54#define SND_SOC_TPLG_DAPM_CTL_VOLSW 64
55#define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65
56#define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66
57#define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67
58#define SND_SOC_TPLG_DAPM_CTL_PIN 68
59
60/* DAPM widget types - add new items to the end */
61#define SND_SOC_TPLG_DAPM_INPUT 0
62#define SND_SOC_TPLG_DAPM_OUTPUT 1
63#define SND_SOC_TPLG_DAPM_MUX 2
64#define SND_SOC_TPLG_DAPM_MIXER 3
65#define SND_SOC_TPLG_DAPM_PGA 4
66#define SND_SOC_TPLG_DAPM_OUT_DRV 5
67#define SND_SOC_TPLG_DAPM_ADC 6
68#define SND_SOC_TPLG_DAPM_DAC 7
69#define SND_SOC_TPLG_DAPM_SWITCH 8
70#define SND_SOC_TPLG_DAPM_PRE 9
71#define SND_SOC_TPLG_DAPM_POST 10
72#define SND_SOC_TPLG_DAPM_AIF_IN 11
73#define SND_SOC_TPLG_DAPM_AIF_OUT 12
74#define SND_SOC_TPLG_DAPM_DAI_IN 13
75#define SND_SOC_TPLG_DAPM_DAI_OUT 14
76#define SND_SOC_TPLG_DAPM_DAI_LINK 15
77#define SND_SOC_TPLG_DAPM_BUFFER 16
78#define SND_SOC_TPLG_DAPM_SCHEDULER 17
79#define SND_SOC_TPLG_DAPM_EFFECT 18
80#define SND_SOC_TPLG_DAPM_SIGGEN 19
81#define SND_SOC_TPLG_DAPM_SRC 20
82#define SND_SOC_TPLG_DAPM_ASRC 21
83#define SND_SOC_TPLG_DAPM_ENCODER 22
84#define SND_SOC_TPLG_DAPM_DECODER 23
85#define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER
86
87/* Header magic number and string sizes */
88#define SND_SOC_TPLG_MAGIC 0x41536F43 /* ASoC */
89
90/* string sizes */
91#define SND_SOC_TPLG_NUM_TEXTS 16
92
93/* ABI version */
94#define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */
95#define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */
96
97/* Max size of TLV data */
98#define SND_SOC_TPLG_TLV_SIZE 32
99
100/*
101 * File and Block header data types.
102 * Add new generic and vendor types to end of list.
103 * Generic types are handled by the core whilst vendors types are passed
104 * to the component drivers for handling.
105 */
106#define SND_SOC_TPLG_TYPE_MIXER 1
107#define SND_SOC_TPLG_TYPE_BYTES 2
108#define SND_SOC_TPLG_TYPE_ENUM 3
109#define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4
110#define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5
111#define SND_SOC_TPLG_TYPE_DAI_LINK 6
112#define SND_SOC_TPLG_TYPE_PCM 7
113#define SND_SOC_TPLG_TYPE_MANIFEST 8
114#define SND_SOC_TPLG_TYPE_CODEC_LINK 9
115#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
116#define SND_SOC_TPLG_TYPE_PDATA 11
117#define SND_SOC_TPLG_TYPE_DAI 12
118#define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI
119
120/* vendor block IDs - please add new vendor types to end */
121#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
122#define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001
123#define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002
124#define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003
125
126#define SND_SOC_TPLG_STREAM_PLAYBACK 0
127#define SND_SOC_TPLG_STREAM_CAPTURE 1
128
129/* vendor tuple types */
130#define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
131#define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
132#define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
133#define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
134#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
135#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
136
137/* DAI flags */
138#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
139#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
140#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
141
142/* DAI clock gating */
143#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0
144#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1
145#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2
146
147/* DAI mclk_direction */
148#define SND_SOC_TPLG_MCLK_CO 0 /* for codec, mclk is output */
149#define SND_SOC_TPLG_MCLK_CI 1 /* for codec, mclk is input */
150
151/* DAI physical PCM data formats.
152 * Add new formats to the end of the list.
153 */
154#define SND_SOC_DAI_FORMAT_I2S 1 /* I2S mode */
155#define SND_SOC_DAI_FORMAT_RIGHT_J 2 /* Right Justified mode */
156#define SND_SOC_DAI_FORMAT_LEFT_J 3 /* Left Justified mode */
157#define SND_SOC_DAI_FORMAT_DSP_A 4 /* L data MSB after FRM LRC */
158#define SND_SOC_DAI_FORMAT_DSP_B 5 /* L data MSB during FRM LRC */
159#define SND_SOC_DAI_FORMAT_AC97 6 /* AC97 */
160#define SND_SOC_DAI_FORMAT_PDM 7 /* Pulse density modulation */
161
162/* left and right justified also known as MSB and LSB respectively */
163#define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J
164#define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J
165
166/* DAI link flags */
167#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0)
168#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
169#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
170#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
171
172/* DAI topology BCLK parameter
173 * For the backwards capability, by default codec is bclk master
174 */
175#define SND_SOC_TPLG_BCLK_CM 0 /* codec is bclk master */
176#define SND_SOC_TPLG_BCLK_CS 1 /* codec is bclk slave */
177
178/* DAI topology FSYNC parameter
179 * For the backwards capability, by default codec is fsync master
180 */
181#define SND_SOC_TPLG_FSYNC_CM 0 /* codec is fsync master */
182#define SND_SOC_TPLG_FSYNC_CS 1 /* codec is fsync slave */
183
184/*
185 * Block Header.
186 * This header precedes all object and object arrays below.
187 */
188struct snd_soc_tplg_hdr {
189 __le32 magic; /* magic number */
190 __le32 abi; /* ABI version */
191 __le32 version; /* optional vendor specific version details */
192 __le32 type; /* SND_SOC_TPLG_TYPE_ */
193 __le32 size; /* size of this structure */
194 __le32 vendor_type; /* optional vendor specific type info */
195 __le32 payload_size; /* data bytes, excluding this header */
196 __le32 index; /* identifier for block */
197 __le32 count; /* number of elements in block */
198} __attribute__((packed));
199
200/* vendor tuple for uuid */
201struct snd_soc_tplg_vendor_uuid_elem {
202 __le32 token;
203 char uuid[16];
204} __attribute__((packed));
205
206/* vendor tuple for a bool/byte/short/word value */
207struct snd_soc_tplg_vendor_value_elem {
208 __le32 token;
209 __le32 value;
210} __attribute__((packed));
211
212/* vendor tuple for string */
213struct snd_soc_tplg_vendor_string_elem {
214 __le32 token;
215 char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
216} __attribute__((packed));
217
218struct snd_soc_tplg_vendor_array {
219 __le32 size; /* size in bytes of the array, including all elements */
220 __le32 type; /* SND_SOC_TPLG_TUPLE_TYPE_ */
221 __le32 num_elems; /* number of elements in array */
222 union {
223 struct snd_soc_tplg_vendor_uuid_elem uuid[0];
224 struct snd_soc_tplg_vendor_value_elem value[0];
225 struct snd_soc_tplg_vendor_string_elem string[0];
226 };
227} __attribute__((packed));
228
229/*
230 * Private data.
231 * All topology objects may have private data that can be used by the driver or
232 * firmware. Core will ignore this data.
233 */
234struct snd_soc_tplg_private {
235 __le32 size; /* in bytes of private data */
236 union {
237 char data[0];
238 struct snd_soc_tplg_vendor_array array[0];
239 };
240} __attribute__((packed));
241
242/*
243 * Kcontrol TLV data.
244 */
245struct snd_soc_tplg_tlv_dbscale {
246 __le32 min;
247 __le32 step;
248 __le32 mute;
249} __attribute__((packed));
250
251struct snd_soc_tplg_ctl_tlv {
252 __le32 size; /* in bytes of this structure */
253 __le32 type; /* SNDRV_CTL_TLVT_*, type of TLV */
254 union {
255 __le32 data[SND_SOC_TPLG_TLV_SIZE];
256 struct snd_soc_tplg_tlv_dbscale scale;
257 };
258} __attribute__((packed));
259
260/*
261 * Kcontrol channel data
262 */
263struct snd_soc_tplg_channel {
264 __le32 size; /* in bytes of this structure */
265 __le32 reg;
266 __le32 shift;
267 __le32 id; /* ID maps to Left, Right, LFE etc */
268} __attribute__((packed));
269
270/*
271 * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops
272 * Kcontrol ops need get/put/info.
273 * Bytes ext ops need get/put.
274 */
275struct snd_soc_tplg_io_ops {
276 __le32 get;
277 __le32 put;
278 __le32 info;
279} __attribute__((packed));
280
281/*
282 * kcontrol header
283 */
284struct snd_soc_tplg_ctl_hdr {
285 __le32 size; /* in bytes of this structure */
286 __le32 type;
287 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
288 __le32 access;
289 struct snd_soc_tplg_io_ops ops;
290 struct snd_soc_tplg_ctl_tlv tlv;
291} __attribute__((packed));
292
293/*
294 * Stream Capabilities
295 */
296struct snd_soc_tplg_stream_caps {
297 __le32 size; /* in bytes of this structure */
298 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
299 __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
300 __le32 rates; /* supported rates SNDRV_PCM_RATE_* */
301 __le32 rate_min; /* min rate */
302 __le32 rate_max; /* max rate */
303 __le32 channels_min; /* min channels */
304 __le32 channels_max; /* max channels */
305 __le32 periods_min; /* min number of periods */
306 __le32 periods_max; /* max number of periods */
307 __le32 period_size_min; /* min period size bytes */
308 __le32 period_size_max; /* max period size bytes */
309 __le32 buffer_size_min; /* min buffer size bytes */
310 __le32 buffer_size_max; /* max buffer size bytes */
311 __le32 sig_bits; /* number of bits of content */
312} __attribute__((packed));
313
314/*
315 * FE or BE Stream configuration supported by SW/FW
316 */
317struct snd_soc_tplg_stream {
318 __le32 size; /* in bytes of this structure */
319 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */
320 __le64 format; /* SNDRV_PCM_FMTBIT_* */
321 __le32 rate; /* SNDRV_PCM_RATE_* */
322 __le32 period_bytes; /* size of period in bytes */
323 __le32 buffer_bytes; /* size of buffer in bytes */
324 __le32 channels; /* channels */
325} __attribute__((packed));
326
327
328/*
329 * Describes a physical link's runtime supported hardware config,
330 * i.e. hardware audio formats.
331 */
332struct snd_soc_tplg_hw_config {
333 __le32 size; /* in bytes of this structure */
334 __le32 id; /* unique ID - - used to match */
335 __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
336 __u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
337 __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
338 __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
339 __u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */
340 __u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */
341 __u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */
342 __le16 reserved; /* for 32bit alignment */
343 __le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */
344 __le32 bclk_rate; /* BCLK freqency in Hz */
345 __le32 fsync_rate; /* frame clock in Hz */
346 __le32 tdm_slots; /* number of TDM slots in use */
347 __le32 tdm_slot_width; /* width in bits for each slot */
348 __le32 tx_slots; /* bit mask for active Tx slots */
349 __le32 rx_slots; /* bit mask for active Rx slots */
350 __le32 tx_channels; /* number of Tx channels */
351 __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
352 __le32 rx_channels; /* number of Rx channels */
353 __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */
354} __attribute__((packed));
355
356/*
357 * Manifest. List totals for each payload type. Not used in parsing, but will
358 * be passed to the component driver before any other objects in order for any
359 * global component resource allocations.
360 *
361 * File block representation for manifest :-
362 * +-----------------------------------+----+
363 * | struct snd_soc_tplg_hdr | 1 |
364 * +-----------------------------------+----+
365 * | struct snd_soc_tplg_manifest | 1 |
366 * +-----------------------------------+----+
367 */
368struct snd_soc_tplg_manifest {
369 __le32 size; /* in bytes of this structure */
370 __le32 control_elems; /* number of control elements */
371 __le32 widget_elems; /* number of widget elements */
372 __le32 graph_elems; /* number of graph elements */
373 __le32 pcm_elems; /* number of PCM elements */
374 __le32 dai_link_elems; /* number of DAI link elements */
375 __le32 dai_elems; /* number of physical DAI elements */
376 __le32 reserved[20]; /* reserved for new ABI element types */
377 struct snd_soc_tplg_private priv;
378} __attribute__((packed));
379
380/*
381 * Mixer kcontrol.
382 *
383 * File block representation for mixer kcontrol :-
384 * +-----------------------------------+----+
385 * | struct snd_soc_tplg_hdr | 1 |
386 * +-----------------------------------+----+
387 * | struct snd_soc_tplg_mixer_control | N |
388 * +-----------------------------------+----+
389 */
390struct snd_soc_tplg_mixer_control {
391 struct snd_soc_tplg_ctl_hdr hdr;
392 __le32 size; /* in bytes of this structure */
393 __le32 min;
394 __le32 max;
395 __le32 platform_max;
396 __le32 invert;
397 __le32 num_channels;
398 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
399 struct snd_soc_tplg_private priv;
400} __attribute__((packed));
401
402/*
403 * Enumerated kcontrol
404 *
405 * File block representation for enum kcontrol :-
406 * +-----------------------------------+----+
407 * | struct snd_soc_tplg_hdr | 1 |
408 * +-----------------------------------+----+
409 * | struct snd_soc_tplg_enum_control | N |
410 * +-----------------------------------+----+
411 */
412struct snd_soc_tplg_enum_control {
413 struct snd_soc_tplg_ctl_hdr hdr;
414 __le32 size; /* in bytes of this structure */
415 __le32 num_channels;
416 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
417 __le32 items;
418 __le32 mask;
419 __le32 count;
420 char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
421 __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];
422 struct snd_soc_tplg_private priv;
423} __attribute__((packed));
424
425/*
426 * Bytes kcontrol
427 *
428 * File block representation for bytes kcontrol :-
429 * +-----------------------------------+----+
430 * | struct snd_soc_tplg_hdr | 1 |
431 * +-----------------------------------+----+
432 * | struct snd_soc_tplg_bytes_control | N |
433 * +-----------------------------------+----+
434 */
435struct snd_soc_tplg_bytes_control {
436 struct snd_soc_tplg_ctl_hdr hdr;
437 __le32 size; /* in bytes of this structure */
438 __le32 max;
439 __le32 mask;
440 __le32 base;
441 __le32 num_regs;
442 struct snd_soc_tplg_io_ops ext_ops;
443 struct snd_soc_tplg_private priv;
444} __attribute__((packed));
445
446/*
447 * DAPM Graph Element
448 *
449 * File block representation for DAPM graph elements :-
450 * +-------------------------------------+----+
451 * | struct snd_soc_tplg_hdr | 1 |
452 * +-------------------------------------+----+
453 * | struct snd_soc_tplg_dapm_graph_elem | N |
454 * +-------------------------------------+----+
455 */
456struct snd_soc_tplg_dapm_graph_elem {
457 char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
458 char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
459 char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
460} __attribute__((packed));
461
462/*
463 * DAPM Widget.
464 *
465 * File block representation for DAPM widget :-
466 * +-------------------------------------+-----+
467 * | struct snd_soc_tplg_hdr | 1 |
468 * +-------------------------------------+-----+
469 * | struct snd_soc_tplg_dapm_widget | N |
470 * +-------------------------------------+-----+
471 * | struct snd_soc_tplg_enum_control | 0|1 |
472 * | struct snd_soc_tplg_mixer_control | 0|N |
473 * +-------------------------------------+-----+
474 *
475 * Optional enum or mixer control can be appended to the end of each widget
476 * in the block.
477 */
478struct snd_soc_tplg_dapm_widget {
479 __le32 size; /* in bytes of this structure */
480 __le32 id; /* SND_SOC_DAPM_CTL */
481 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
482 char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
483
484 __le32 reg; /* negative reg = no direct dapm */
485 __le32 shift; /* bits to shift */
486 __le32 mask; /* non-shifted mask */
487 __le32 subseq; /* sort within widget type */
488 __le32 invert; /* invert the power bit */
489 __le32 ignore_suspend; /* kept enabled over suspend */
490 __le16 event_flags;
491 __le16 event_type;
492 __le32 num_kcontrols;
493 struct snd_soc_tplg_private priv;
494 /*
495 * kcontrols that relate to this widget
496 * follow here after widget private data
497 */
498} __attribute__((packed));
499
500
501/*
502 * Describes SW/FW specific features of PCM (FE DAI & DAI link).
503 *
504 * File block representation for PCM :-
505 * +-----------------------------------+-----+
506 * | struct snd_soc_tplg_hdr | 1 |
507 * +-----------------------------------+-----+
508 * | struct snd_soc_tplg_pcm | N |
509 * +-----------------------------------+-----+
510 */
511struct snd_soc_tplg_pcm {
512 __le32 size; /* in bytes of this structure */
513 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
514 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
515 __le32 pcm_id; /* unique ID - used to match with DAI link */
516 __le32 dai_id; /* unique ID - used to match */
517 __le32 playback; /* supports playback mode */
518 __le32 capture; /* supports capture mode */
519 __le32 compress; /* 1 = compressed; 0 = PCM */
520 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
521 __le32 num_streams; /* number of streams */
522 struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
523 __le32 flag_mask; /* bitmask of flags to configure */
524 __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
525 struct snd_soc_tplg_private priv;
526} __attribute__((packed));
527
528
529/*
530 * Describes the physical link runtime supported configs or params
531 *
532 * File block representation for physical link config :-
533 * +-----------------------------------+-----+
534 * | struct snd_soc_tplg_hdr | 1 |
535 * +-----------------------------------+-----+
536 * | struct snd_soc_tplg_link_config | N |
537 * +-----------------------------------+-----+
538 */
539struct snd_soc_tplg_link_config {
540 __le32 size; /* in bytes of this structure */
541 __le32 id; /* unique ID - used to match */
542 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
543 char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* stream name - used to match */
544 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
545 __le32 num_streams; /* number of streams */
546 struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; /* hw configs */
547 __le32 num_hw_configs; /* number of hw configs */
548 __le32 default_hw_config_id; /* default hw config ID for init */
549 __le32 flag_mask; /* bitmask of flags to configure */
550 __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */
551 struct snd_soc_tplg_private priv;
552} __attribute__((packed));
553
554/*
555 * Describes SW/FW specific features of physical DAI.
556 * It can be used to configure backend DAIs for DPCM.
557 *
558 * File block representation for physical DAI :-
559 * +-----------------------------------+-----+
560 * | struct snd_soc_tplg_hdr | 1 |
561 * +-----------------------------------+-----+
562 * | struct snd_soc_tplg_dai | N |
563 * +-----------------------------------+-----+
564 */
565struct snd_soc_tplg_dai {
566 __le32 size; /* in bytes of this structure */
567 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
568 __le32 dai_id; /* unique ID - used to match */
569 __le32 playback; /* supports playback mode */
570 __le32 capture; /* supports capture mode */
571 struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
572 __le32 flag_mask; /* bitmask of flags to configure */
573 __le32 flags; /* SND_SOC_TPLG_DAI_FLGBIT_* */
574 struct snd_soc_tplg_private priv;
575} __attribute__((packed));
576
577/*
578 * Old version of ABI structs, supported for backward compatibility.
579 */
580
581/* Manifest v4 */
582struct snd_soc_tplg_manifest_v4 {
583 __le32 size; /* in bytes of this structure */
584 __le32 control_elems; /* number of control elements */
585 __le32 widget_elems; /* number of widget elements */
586 __le32 graph_elems; /* number of graph elements */
587 __le32 pcm_elems; /* number of PCM elements */
588 __le32 dai_link_elems; /* number of DAI link elements */
589 struct snd_soc_tplg_private priv;
590} __attribute__((packed));
591
592/* Stream Capabilities v4 */
593struct snd_soc_tplg_stream_caps_v4 {
594 __le32 size; /* in bytes of this structure */
595 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
596 __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
597 __le32 rates; /* supported rates SNDRV_PCM_RATE_* */
598 __le32 rate_min; /* min rate */
599 __le32 rate_max; /* max rate */
600 __le32 channels_min; /* min channels */
601 __le32 channels_max; /* max channels */
602 __le32 periods_min; /* min number of periods */
603 __le32 periods_max; /* max number of periods */
604 __le32 period_size_min; /* min period size bytes */
605 __le32 period_size_max; /* max period size bytes */
606 __le32 buffer_size_min; /* min buffer size bytes */
607 __le32 buffer_size_max; /* max buffer size bytes */
608} __attribute__((packed));
609
610/* PCM v4 */
611struct snd_soc_tplg_pcm_v4 {
612 __le32 size; /* in bytes of this structure */
613 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
614 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
615 __le32 pcm_id; /* unique ID - used to match with DAI link */
616 __le32 dai_id; /* unique ID - used to match */
617 __le32 playback; /* supports playback mode */
618 __le32 capture; /* supports capture mode */
619 __le32 compress; /* 1 = compressed; 0 = PCM */
620 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
621 __le32 num_streams; /* number of streams */
622 struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */
623} __attribute__((packed));
624
625/* Physical link config v4 */
626struct snd_soc_tplg_link_config_v4 {
627 __le32 size; /* in bytes of this structure */
628 __le32 id; /* unique ID - used to match */
629 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
630 __le32 num_streams; /* number of streams */
631} __attribute__((packed));
632
633#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/asound.h deleted-1035
...@@ -1,1035 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Advanced Linux Sound Architecture - ALSA - Driver
4 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
5 * Abramo Bagnara <abramo@alsa-project.org>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __SOUND_ASOUND_H
25#define __SOUND_ASOUND_H
26
27#if defined(__KERNEL__) || defined(__linux__)
28#include <linux/types.h>
29#else
30#include <sys/ioctl.h>
31#endif
32
33#include <stdlib.h>
34
35/*
36 * protocol version
37 */
38
39#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
40#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
41#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
42#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
43#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
44 (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
45 (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
46 SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
47
48/****************************************************************************
49 * *
50 * Digital audio interface *
51 * *
52 ****************************************************************************/
53
54struct snd_aes_iec958 {
55 unsigned char status[24]; /* AES/IEC958 channel status bits */
56 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
57 unsigned char pad; /* nothing */
58 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
59};
60
61/****************************************************************************
62 * *
63 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
64 * *
65 ****************************************************************************/
66
67struct snd_cea_861_aud_if {
68 unsigned char db1_ct_cc; /* coding type and channel count */
69 unsigned char db2_sf_ss; /* sample frequency and size */
70 unsigned char db3; /* not used, all zeros */
71 unsigned char db4_ca; /* channel allocation code */
72 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
73};
74
75/****************************************************************************
76 * *
77 * Section for driver hardware dependent interface - /dev/snd/hw? *
78 * *
79 ****************************************************************************/
80
81#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
82
83enum {
84 SNDRV_HWDEP_IFACE_OPL2 = 0,
85 SNDRV_HWDEP_IFACE_OPL3,
86 SNDRV_HWDEP_IFACE_OPL4,
87 SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
88 SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
89 SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
90 SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
91 SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
92 SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
93 SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
94 SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
95 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
96 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
97 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
98 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
99 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
100 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
101 SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
102 SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */
103 SNDRV_HWDEP_IFACE_FW_FIREWORKS, /* Echo Audio Fireworks based device */
104 SNDRV_HWDEP_IFACE_FW_BEBOB, /* BridgeCo BeBoB based device */
105 SNDRV_HWDEP_IFACE_FW_OXFW, /* Oxford OXFW970/971 based device */
106 SNDRV_HWDEP_IFACE_FW_DIGI00X, /* Digidesign Digi 002/003 family */
107 SNDRV_HWDEP_IFACE_FW_TASCAM, /* TASCAM FireWire series */
108 SNDRV_HWDEP_IFACE_LINE6, /* Line6 USB processors */
109 SNDRV_HWDEP_IFACE_FW_MOTU, /* MOTU FireWire series */
110 SNDRV_HWDEP_IFACE_FW_FIREFACE, /* RME Fireface series */
111
112 /* Don't forget to change the following: */
113 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_FIREFACE
114};
115
116struct snd_hwdep_info {
117 unsigned int device; /* WR: device number */
118 int card; /* R: card number */
119 unsigned char id[64]; /* ID (user selectable) */
120 unsigned char name[80]; /* hwdep name */
121 int iface; /* hwdep interface */
122 unsigned char reserved[64]; /* reserved for future */
123};
124
125/* generic DSP loader */
126struct snd_hwdep_dsp_status {
127 unsigned int version; /* R: driver-specific version */
128 unsigned char id[32]; /* R: driver-specific ID string */
129 unsigned int num_dsps; /* R: number of DSP images to transfer */
130 unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
131 unsigned int chip_ready; /* R: 1 = initialization finished */
132 unsigned char reserved[16]; /* reserved for future use */
133};
134
135struct snd_hwdep_dsp_image {
136 unsigned int index; /* W: DSP index */
137 unsigned char name[64]; /* W: ID (e.g. file name) */
138 unsigned char *image; /* W: binary image */
139 size_t length; /* W: size of image in bytes */
140 unsigned long driver_data; /* W: driver-specific data */
141};
142
143#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
144#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
145#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
146#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
147
148/*****************************************************************************
149 * *
150 * Digital Audio (PCM) interface - /dev/snd/pcm?? *
151 * *
152 *****************************************************************************/
153
154#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 14)
155
156typedef unsigned long snd_pcm_uframes_t;
157typedef signed long snd_pcm_sframes_t;
158
159enum {
160 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
161 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
162 SNDRV_PCM_CLASS_MODEM, /* software modem class */
163 SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
164 /* Don't forget to change the following: */
165 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
166};
167
168enum {
169 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
170 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
171 /* Don't forget to change the following: */
172 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
173};
174
175enum {
176 SNDRV_PCM_STREAM_PLAYBACK = 0,
177 SNDRV_PCM_STREAM_CAPTURE,
178 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
179};
180
181typedef int __bitwise snd_pcm_access_t;
182#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((snd_pcm_access_t) 0) /* interleaved mmap */
183#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((snd_pcm_access_t) 1) /* noninterleaved mmap */
184#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((snd_pcm_access_t) 2) /* complex mmap */
185#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((snd_pcm_access_t) 3) /* readi/writei */
186#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((snd_pcm_access_t) 4) /* readn/writen */
187#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
188
189typedef int __bitwise snd_pcm_format_t;
190#define SNDRV_PCM_FORMAT_S8 ((snd_pcm_format_t) 0)
191#define SNDRV_PCM_FORMAT_U8 ((snd_pcm_format_t) 1)
192#define SNDRV_PCM_FORMAT_S16_LE ((snd_pcm_format_t) 2)
193#define SNDRV_PCM_FORMAT_S16_BE ((snd_pcm_format_t) 3)
194#define SNDRV_PCM_FORMAT_U16_LE ((snd_pcm_format_t) 4)
195#define SNDRV_PCM_FORMAT_U16_BE ((snd_pcm_format_t) 5)
196#define SNDRV_PCM_FORMAT_S24_LE ((snd_pcm_format_t) 6) /* low three bytes */
197#define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7) /* low three bytes */
198#define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8) /* low three bytes */
199#define SNDRV_PCM_FORMAT_U24_BE ((snd_pcm_format_t) 9) /* low three bytes */
200#define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)
201#define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)
202#define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)
203#define SNDRV_PCM_FORMAT_U32_BE ((snd_pcm_format_t) 13)
204#define SNDRV_PCM_FORMAT_FLOAT_LE ((snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
205#define SNDRV_PCM_FORMAT_FLOAT_BE ((snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
206#define SNDRV_PCM_FORMAT_FLOAT64_LE ((snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
207#define SNDRV_PCM_FORMAT_FLOAT64_BE ((snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
208#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
209#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
210#define SNDRV_PCM_FORMAT_MU_LAW ((snd_pcm_format_t) 20)
211#define SNDRV_PCM_FORMAT_A_LAW ((snd_pcm_format_t) 21)
212#define SNDRV_PCM_FORMAT_IMA_ADPCM ((snd_pcm_format_t) 22)
213#define SNDRV_PCM_FORMAT_MPEG ((snd_pcm_format_t) 23)
214#define SNDRV_PCM_FORMAT_GSM ((snd_pcm_format_t) 24)
215#define SNDRV_PCM_FORMAT_S20_LE ((snd_pcm_format_t) 25) /* in four bytes, LSB justified */
216#define SNDRV_PCM_FORMAT_S20_BE ((snd_pcm_format_t) 26) /* in four bytes, LSB justified */
217#define SNDRV_PCM_FORMAT_U20_LE ((snd_pcm_format_t) 27) /* in four bytes, LSB justified */
218#define SNDRV_PCM_FORMAT_U20_BE ((snd_pcm_format_t) 28) /* in four bytes, LSB justified */
219/* gap in the numbering for a future standard linear format */
220#define SNDRV_PCM_FORMAT_SPECIAL ((snd_pcm_format_t) 31)
221#define SNDRV_PCM_FORMAT_S24_3LE ((snd_pcm_format_t) 32) /* in three bytes */
222#define SNDRV_PCM_FORMAT_S24_3BE ((snd_pcm_format_t) 33) /* in three bytes */
223#define SNDRV_PCM_FORMAT_U24_3LE ((snd_pcm_format_t) 34) /* in three bytes */
224#define SNDRV_PCM_FORMAT_U24_3BE ((snd_pcm_format_t) 35) /* in three bytes */
225#define SNDRV_PCM_FORMAT_S20_3LE ((snd_pcm_format_t) 36) /* in three bytes */
226#define SNDRV_PCM_FORMAT_S20_3BE ((snd_pcm_format_t) 37) /* in three bytes */
227#define SNDRV_PCM_FORMAT_U20_3LE ((snd_pcm_format_t) 38) /* in three bytes */
228#define SNDRV_PCM_FORMAT_U20_3BE ((snd_pcm_format_t) 39) /* in three bytes */
229#define SNDRV_PCM_FORMAT_S18_3LE ((snd_pcm_format_t) 40) /* in three bytes */
230#define SNDRV_PCM_FORMAT_S18_3BE ((snd_pcm_format_t) 41) /* in three bytes */
231#define SNDRV_PCM_FORMAT_U18_3LE ((snd_pcm_format_t) 42) /* in three bytes */
232#define SNDRV_PCM_FORMAT_U18_3BE ((snd_pcm_format_t) 43) /* in three bytes */
233#define SNDRV_PCM_FORMAT_G723_24 ((snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
234#define SNDRV_PCM_FORMAT_G723_24_1B ((snd_pcm_format_t) 45) /* 1 sample in 1 byte */
235#define SNDRV_PCM_FORMAT_G723_40 ((snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
236#define SNDRV_PCM_FORMAT_G723_40_1B ((snd_pcm_format_t) 47) /* 1 sample in 1 byte */
237#define SNDRV_PCM_FORMAT_DSD_U8 ((snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
238#define SNDRV_PCM_FORMAT_DSD_U16_LE ((snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
239#define SNDRV_PCM_FORMAT_DSD_U32_LE ((snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
240#define SNDRV_PCM_FORMAT_DSD_U16_BE ((snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */
241#define SNDRV_PCM_FORMAT_DSD_U32_BE ((snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */
242#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
243#define SNDRV_PCM_FORMAT_FIRST SNDRV_PCM_FORMAT_S8
244
245#ifdef SNDRV_LITTLE_ENDIAN
246#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
247#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
248#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
249#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
250#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
251#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
252#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
253#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
254#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
255#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_LE
256#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_LE
257#endif
258#ifdef SNDRV_BIG_ENDIAN
259#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
260#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
261#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
262#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
263#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
264#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
265#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
266#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
267#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
268#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_BE
269#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_BE
270#endif
271
272typedef int __bitwise snd_pcm_subformat_t;
273#define SNDRV_PCM_SUBFORMAT_STD ((snd_pcm_subformat_t) 0)
274#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
275
276#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
277#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
278#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
279#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
280#define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020 /* need the explicit sync of appl_ptr update */
281#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
282#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
283#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
284#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
285#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
286#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
287#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
288#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
289#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
290#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
291#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
292#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* (Deprecated)has audio wall clock for audio/system time sync */
293#define SNDRV_PCM_INFO_HAS_LINK_ATIME 0x01000000 /* report hardware link audio time, reset on startup */
294#define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000 /* report absolute hardware link audio time, not reset on startup */
295#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
296#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
297
298#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
299#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
300
301
302
303typedef int __bitwise snd_pcm_state_t;
304#define SNDRV_PCM_STATE_OPEN ((snd_pcm_state_t) 0) /* stream is open */
305#define SNDRV_PCM_STATE_SETUP ((snd_pcm_state_t) 1) /* stream has a setup */
306#define SNDRV_PCM_STATE_PREPARED ((snd_pcm_state_t) 2) /* stream is ready to start */
307#define SNDRV_PCM_STATE_RUNNING ((snd_pcm_state_t) 3) /* stream is running */
308#define SNDRV_PCM_STATE_XRUN ((snd_pcm_state_t) 4) /* stream reached an xrun */
309#define SNDRV_PCM_STATE_DRAINING ((snd_pcm_state_t) 5) /* stream is draining */
310#define SNDRV_PCM_STATE_PAUSED ((snd_pcm_state_t) 6) /* stream is paused */
311#define SNDRV_PCM_STATE_SUSPENDED ((snd_pcm_state_t) 7) /* hardware is suspended */
312#define SNDRV_PCM_STATE_DISCONNECTED ((snd_pcm_state_t) 8) /* hardware is disconnected */
313#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
314
315enum {
316 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
317 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
318 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
319};
320
321union snd_pcm_sync_id {
322 unsigned char id[16];
323 unsigned short id16[8];
324 unsigned int id32[4];
325};
326
327struct snd_pcm_info {
328 unsigned int device; /* RO/WR (control): device number */
329 unsigned int subdevice; /* RO/WR (control): subdevice number */
330 int stream; /* RO/WR (control): stream direction */
331 int card; /* R: card number */
332 unsigned char id[64]; /* ID (user selectable) */
333 unsigned char name[80]; /* name of this device */
334 unsigned char subname[32]; /* subdevice name */
335 int dev_class; /* SNDRV_PCM_CLASS_* */
336 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
337 unsigned int subdevices_count;
338 unsigned int subdevices_avail;
339 union snd_pcm_sync_id sync; /* hardware synchronization ID */
340 unsigned char reserved[64]; /* reserved for future... */
341};
342
343typedef int snd_pcm_hw_param_t;
344#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
345#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
346#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
347#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
348#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
349
350#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
351#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
352#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
353#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
354#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
355 * interrupts in us
356 */
357#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
358 * interrupts
359 */
360#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
361 * interrupts
362 */
363#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
364 * buffer
365 */
366#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
367 * in us
368 */
369#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
370#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
371#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
372#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
373#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
374
375#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
376#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
377#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
378
379struct snd_interval {
380 unsigned int min, max;
381 unsigned int openmin:1,
382 openmax:1,
383 integer:1,
384 empty:1;
385};
386
387#define SNDRV_MASK_MAX 256
388
389struct snd_mask {
390 __u32 bits[(SNDRV_MASK_MAX+31)/32];
391};
392
393struct snd_pcm_hw_params {
394 unsigned int flags;
395 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
396 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
397 struct snd_mask mres[5]; /* reserved masks */
398 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
399 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
400 struct snd_interval ires[9]; /* reserved intervals */
401 unsigned int rmask; /* W: requested masks */
402 unsigned int cmask; /* R: changed masks */
403 unsigned int info; /* R: Info flags for returned setup */
404 unsigned int msbits; /* R: used most significant bits */
405 unsigned int rate_num; /* R: rate numerator */
406 unsigned int rate_den; /* R: rate denominator */
407 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
408 unsigned char reserved[64]; /* reserved for future */
409};
410
411enum {
412 SNDRV_PCM_TSTAMP_NONE = 0,
413 SNDRV_PCM_TSTAMP_ENABLE,
414 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
415};
416
417struct snd_pcm_sw_params {
418 int tstamp_mode; /* timestamp mode */
419 unsigned int period_step;
420 unsigned int sleep_min; /* min ticks to sleep */
421 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
422 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
423 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
424 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
425 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
426 snd_pcm_uframes_t silence_size; /* silence block size */
427 snd_pcm_uframes_t boundary; /* pointers wrap point */
428 unsigned int proto; /* protocol version */
429 unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
430 unsigned char reserved[56]; /* reserved for future */
431};
432
433struct snd_pcm_channel_info {
434 unsigned int channel;
435 __kernel_off_t offset; /* mmap offset */
436 unsigned int first; /* offset to first sample in bits */
437 unsigned int step; /* samples distance in bits */
438};
439
440enum {
441 /*
442 * first definition for backwards compatibility only,
443 * maps to wallclock/link time for HDAudio playback and DEFAULT/DMA time for everything else
444 */
445 SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0,
446
447 /* timestamp definitions */
448 SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1, /* DMA time, reported as per hw_ptr */
449 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK = 2, /* link time reported by sample or wallclock counter, reset on startup */
450 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3, /* link time reported by sample or wallclock counter, not reset on startup */
451 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4, /* link time estimated indirectly */
452 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5, /* link time synchronized with system time */
453 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED
454};
455
456struct snd_pcm_status {
457 snd_pcm_state_t state; /* stream state */
458 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
459 struct timespec tstamp; /* reference timestamp */
460 snd_pcm_uframes_t appl_ptr; /* appl ptr */
461 snd_pcm_uframes_t hw_ptr; /* hw ptr */
462 snd_pcm_sframes_t delay; /* current delay in frames */
463 snd_pcm_uframes_t avail; /* number of frames available */
464 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
465 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
466 snd_pcm_state_t suspended_state; /* suspended stream state */
467 __u32 audio_tstamp_data; /* needed for 64-bit alignment, used for configs/report to/from userspace */
468 struct timespec audio_tstamp; /* sample counter, wall clock, PHC or on-demand sync'ed */
469 struct timespec driver_tstamp; /* useful in case reference system tstamp is reported with delay */
470 __u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */
471 unsigned char reserved[52-2*sizeof(struct timespec)]; /* must be filled with zero */
472};
473
474struct snd_pcm_mmap_status {
475 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
476 int pad1; /* Needed for 64 bit alignment */
477 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
478 struct timespec tstamp; /* Timestamp */
479 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
480 struct timespec audio_tstamp; /* from sample counter or wall clock */
481};
482
483struct snd_pcm_mmap_control {
484 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
485 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
486};
487
488#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
489#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
490#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
491
492struct snd_pcm_sync_ptr {
493 unsigned int flags;
494 union {
495 struct snd_pcm_mmap_status status;
496 unsigned char reserved[64];
497 } s;
498 union {
499 struct snd_pcm_mmap_control control;
500 unsigned char reserved[64];
501 } c;
502};
503
504struct snd_xferi {
505 snd_pcm_sframes_t result;
506 void *buf;
507 snd_pcm_uframes_t frames;
508};
509
510struct snd_xfern {
511 snd_pcm_sframes_t result;
512 void * *bufs;
513 snd_pcm_uframes_t frames;
514};
515
516enum {
517 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
518 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
519 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
520 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
521};
522
523/* channel positions */
524enum {
525 SNDRV_CHMAP_UNKNOWN = 0,
526 SNDRV_CHMAP_NA, /* N/A, silent */
527 SNDRV_CHMAP_MONO, /* mono stream */
528 /* this follows the alsa-lib mixer channel value + 3 */
529 SNDRV_CHMAP_FL, /* front left */
530 SNDRV_CHMAP_FR, /* front right */
531 SNDRV_CHMAP_RL, /* rear left */
532 SNDRV_CHMAP_RR, /* rear right */
533 SNDRV_CHMAP_FC, /* front center */
534 SNDRV_CHMAP_LFE, /* LFE */
535 SNDRV_CHMAP_SL, /* side left */
536 SNDRV_CHMAP_SR, /* side right */
537 SNDRV_CHMAP_RC, /* rear center */
538 /* new definitions */
539 SNDRV_CHMAP_FLC, /* front left center */
540 SNDRV_CHMAP_FRC, /* front right center */
541 SNDRV_CHMAP_RLC, /* rear left center */
542 SNDRV_CHMAP_RRC, /* rear right center */
543 SNDRV_CHMAP_FLW, /* front left wide */
544 SNDRV_CHMAP_FRW, /* front right wide */
545 SNDRV_CHMAP_FLH, /* front left high */
546 SNDRV_CHMAP_FCH, /* front center high */
547 SNDRV_CHMAP_FRH, /* front right high */
548 SNDRV_CHMAP_TC, /* top center */
549 SNDRV_CHMAP_TFL, /* top front left */
550 SNDRV_CHMAP_TFR, /* top front right */
551 SNDRV_CHMAP_TFC, /* top front center */
552 SNDRV_CHMAP_TRL, /* top rear left */
553 SNDRV_CHMAP_TRR, /* top rear right */
554 SNDRV_CHMAP_TRC, /* top rear center */
555 /* new definitions for UAC2 */
556 SNDRV_CHMAP_TFLC, /* top front left center */
557 SNDRV_CHMAP_TFRC, /* top front right center */
558 SNDRV_CHMAP_TSL, /* top side left */
559 SNDRV_CHMAP_TSR, /* top side right */
560 SNDRV_CHMAP_LLFE, /* left LFE */
561 SNDRV_CHMAP_RLFE, /* right LFE */
562 SNDRV_CHMAP_BC, /* bottom center */
563 SNDRV_CHMAP_BLC, /* bottom left center */
564 SNDRV_CHMAP_BRC, /* bottom right center */
565 SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
566};
567
568#define SNDRV_CHMAP_POSITION_MASK 0xffff
569#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
570#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
571
572#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
573#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
574#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
575#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
576#define SNDRV_PCM_IOCTL_USER_PVERSION _IOW('A', 0x04, int)
577#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
578#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
579#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
580#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
581#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
582#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
583#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
584#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
585#define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status)
586#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
587#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
588#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
589#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
590#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
591#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
592#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
593#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
594#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
595#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
596#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
597#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
598#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
599#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
600#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
601#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
602#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
603
604/*****************************************************************************
605 * *
606 * MIDI v1.0 interface *
607 * *
608 *****************************************************************************/
609
610/*
611 * Raw MIDI section - /dev/snd/midi??
612 */
613
614#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
615
616enum {
617 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
618 SNDRV_RAWMIDI_STREAM_INPUT,
619 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
620};
621
622#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
623#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
624#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
625
626struct snd_rawmidi_info {
627 unsigned int device; /* RO/WR (control): device number */
628 unsigned int subdevice; /* RO/WR (control): subdevice number */
629 int stream; /* WR: stream */
630 int card; /* R: card number */
631 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
632 unsigned char id[64]; /* ID (user selectable) */
633 unsigned char name[80]; /* name of device */
634 unsigned char subname[32]; /* name of active or selected subdevice */
635 unsigned int subdevices_count;
636 unsigned int subdevices_avail;
637 unsigned char reserved[64]; /* reserved for future use */
638};
639
640struct snd_rawmidi_params {
641 int stream;
642 size_t buffer_size; /* queue size in bytes */
643 size_t avail_min; /* minimum avail bytes for wakeup */
644 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
645 unsigned char reserved[16]; /* reserved for future use */
646};
647
648struct snd_rawmidi_status {
649 int stream;
650 struct timespec tstamp; /* Timestamp */
651 size_t avail; /* available bytes */
652 size_t xruns; /* count of overruns since last status (in bytes) */
653 unsigned char reserved[16]; /* reserved for future use */
654};
655
656#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
657#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
658#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
659#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
660#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
661#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
662
663/*
664 * Timer section - /dev/snd/timer
665 */
666
667#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
668
669enum {
670 SNDRV_TIMER_CLASS_NONE = -1,
671 SNDRV_TIMER_CLASS_SLAVE = 0,
672 SNDRV_TIMER_CLASS_GLOBAL,
673 SNDRV_TIMER_CLASS_CARD,
674 SNDRV_TIMER_CLASS_PCM,
675 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
676};
677
678/* slave timer classes */
679enum {
680 SNDRV_TIMER_SCLASS_NONE = 0,
681 SNDRV_TIMER_SCLASS_APPLICATION,
682 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
683 SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
684 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
685};
686
687/* global timers (device member) */
688#define SNDRV_TIMER_GLOBAL_SYSTEM 0
689#define SNDRV_TIMER_GLOBAL_RTC 1 /* unused */
690#define SNDRV_TIMER_GLOBAL_HPET 2
691#define SNDRV_TIMER_GLOBAL_HRTIMER 3
692
693/* info flags */
694#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
695
696struct snd_timer_id {
697 int dev_class;
698 int dev_sclass;
699 int card;
700 int device;
701 int subdevice;
702};
703
704struct snd_timer_ginfo {
705 struct snd_timer_id tid; /* requested timer ID */
706 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
707 int card; /* card number */
708 unsigned char id[64]; /* timer identification */
709 unsigned char name[80]; /* timer name */
710 unsigned long reserved0; /* reserved for future use */
711 unsigned long resolution; /* average period resolution in ns */
712 unsigned long resolution_min; /* minimal period resolution in ns */
713 unsigned long resolution_max; /* maximal period resolution in ns */
714 unsigned int clients; /* active timer clients */
715 unsigned char reserved[32];
716};
717
718struct snd_timer_gparams {
719 struct snd_timer_id tid; /* requested timer ID */
720 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
721 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
722 unsigned char reserved[32];
723};
724
725struct snd_timer_gstatus {
726 struct snd_timer_id tid; /* requested timer ID */
727 unsigned long resolution; /* current period resolution in ns */
728 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
729 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
730 unsigned char reserved[32];
731};
732
733struct snd_timer_select {
734 struct snd_timer_id id; /* bind to timer ID */
735 unsigned char reserved[32]; /* reserved */
736};
737
738struct snd_timer_info {
739 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
740 int card; /* card number */
741 unsigned char id[64]; /* timer identificator */
742 unsigned char name[80]; /* timer name */
743 unsigned long reserved0; /* reserved for future use */
744 unsigned long resolution; /* average period resolution in ns */
745 unsigned char reserved[64]; /* reserved */
746};
747
748#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
749#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
750#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
751
752struct snd_timer_params {
753 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
754 unsigned int ticks; /* requested resolution in ticks */
755 unsigned int queue_size; /* total size of queue (32-1024) */
756 unsigned int reserved0; /* reserved, was: failure locations */
757 unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
758 unsigned char reserved[60]; /* reserved */
759};
760
761struct snd_timer_status {
762 struct timespec tstamp; /* Timestamp - last update */
763 unsigned int resolution; /* current period resolution in ns */
764 unsigned int lost; /* counter of master tick lost */
765 unsigned int overrun; /* count of read queue overruns */
766 unsigned int queue; /* used queue size */
767 unsigned char reserved[64]; /* reserved */
768};
769
770#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
771#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
772#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
773#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
774#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
775#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
776#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
777#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
778#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
779#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
780/* The following four ioctls are changed since 1.0.9 due to confliction */
781#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
782#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
783#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
784#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
785
786struct snd_timer_read {
787 unsigned int resolution;
788 unsigned int ticks;
789};
790
791enum {
792 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
793 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
794 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
795 SNDRV_TIMER_EVENT_STOP, /* val = 0 */
796 SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
797 SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
798 SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
799 SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
800 SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
801 /* master timer events for slave timer instances */
802 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
803 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
804 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
805 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
806 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
807 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
808};
809
810struct snd_timer_tread {
811 int event;
812 struct timespec tstamp;
813 unsigned int val;
814};
815
816/****************************************************************************
817 * *
818 * Section for driver control interface - /dev/snd/control? *
819 * *
820 ****************************************************************************/
821
822#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
823
824struct snd_ctl_card_info {
825 int card; /* card number */
826 int pad; /* reserved for future (was type) */
827 unsigned char id[16]; /* ID of card (user selectable) */
828 unsigned char driver[16]; /* Driver name */
829 unsigned char name[32]; /* Short name of soundcard */
830 unsigned char longname[80]; /* name + info text about soundcard */
831 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
832 unsigned char mixername[80]; /* visual mixer identification */
833 unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
834};
835
836typedef int __bitwise snd_ctl_elem_type_t;
837#define SNDRV_CTL_ELEM_TYPE_NONE ((snd_ctl_elem_type_t) 0) /* invalid */
838#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((snd_ctl_elem_type_t) 1) /* boolean type */
839#define SNDRV_CTL_ELEM_TYPE_INTEGER ((snd_ctl_elem_type_t) 2) /* integer type */
840#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((snd_ctl_elem_type_t) 3) /* enumerated type */
841#define SNDRV_CTL_ELEM_TYPE_BYTES ((snd_ctl_elem_type_t) 4) /* byte array */
842#define SNDRV_CTL_ELEM_TYPE_IEC958 ((snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
843#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((snd_ctl_elem_type_t) 6) /* 64-bit integer type */
844#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
845
846typedef int __bitwise snd_ctl_elem_iface_t;
847#define SNDRV_CTL_ELEM_IFACE_CARD ((snd_ctl_elem_iface_t) 0) /* global control */
848#define SNDRV_CTL_ELEM_IFACE_HWDEP ((snd_ctl_elem_iface_t) 1) /* hardware dependent device */
849#define SNDRV_CTL_ELEM_IFACE_MIXER ((snd_ctl_elem_iface_t) 2) /* virtual mixer device */
850#define SNDRV_CTL_ELEM_IFACE_PCM ((snd_ctl_elem_iface_t) 3) /* PCM device */
851#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((snd_ctl_elem_iface_t) 4) /* RawMidi device */
852#define SNDRV_CTL_ELEM_IFACE_TIMER ((snd_ctl_elem_iface_t) 5) /* timer device */
853#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((snd_ctl_elem_iface_t) 6) /* sequencer client */
854#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
855
856#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
857#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
858#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
859#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
860#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
861#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
862#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
863#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
864#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
865#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
866#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
867#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
868#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
869#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
870/* bits 30 and 31 are obsoleted (for indirect access) */
871
872/* for further details see the ACPI and PCI power management specification */
873#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
874#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
875#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
876#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
877#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
878#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
879
880#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
881
882struct snd_ctl_elem_id {
883 unsigned int numid; /* numeric identifier, zero = invalid */
884 snd_ctl_elem_iface_t iface; /* interface identifier */
885 unsigned int device; /* device/client number */
886 unsigned int subdevice; /* subdevice (substream) number */
887 unsigned char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* ASCII name of item */
888 unsigned int index; /* index of item */
889};
890
891struct snd_ctl_elem_list {
892 unsigned int offset; /* W: first element ID to get */
893 unsigned int space; /* W: count of element IDs to get */
894 unsigned int used; /* R: count of element IDs set */
895 unsigned int count; /* R: count of all elements */
896 struct snd_ctl_elem_id *pids; /* R: IDs */
897 unsigned char reserved[50];
898};
899
900struct snd_ctl_elem_info {
901 struct snd_ctl_elem_id id; /* W: element ID */
902 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
903 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
904 unsigned int count; /* count of values */
905 __kernel_pid_t owner; /* owner's PID of this control */
906 union {
907 struct {
908 long min; /* R: minimum value */
909 long max; /* R: maximum value */
910 long step; /* R: step (0 variable) */
911 } integer;
912 struct {
913 long long min; /* R: minimum value */
914 long long max; /* R: maximum value */
915 long long step; /* R: step (0 variable) */
916 } integer64;
917 struct {
918 unsigned int items; /* R: number of items */
919 unsigned int item; /* W: item number */
920 char name[64]; /* R: value name */
921 __u64 names_ptr; /* W: names list (ELEM_ADD only) */
922 unsigned int names_length;
923 } enumerated;
924 unsigned char reserved[128];
925 } value;
926 union {
927 unsigned short d[4]; /* dimensions */
928 unsigned short *d_ptr; /* indirect - obsoleted */
929 } dimen;
930 unsigned char reserved[64-4*sizeof(unsigned short)];
931};
932
933struct snd_ctl_elem_value {
934 struct snd_ctl_elem_id id; /* W: element ID */
935 unsigned int indirect: 1; /* W: indirect access - obsoleted */
936 union {
937 union {
938 long value[128];
939 long *value_ptr; /* obsoleted */
940 } integer;
941 union {
942 long long value[64];
943 long long *value_ptr; /* obsoleted */
944 } integer64;
945 union {
946 unsigned int item[128];
947 unsigned int *item_ptr; /* obsoleted */
948 } enumerated;
949 union {
950 unsigned char data[512];
951 unsigned char *data_ptr; /* obsoleted */
952 } bytes;
953 struct snd_aes_iec958 iec958;
954 } value; /* RO */
955 struct timespec tstamp;
956 unsigned char reserved[128-sizeof(struct timespec)];
957};
958
959struct snd_ctl_tlv {
960 unsigned int numid; /* control element numeric identification */
961 unsigned int length; /* in bytes aligned to 4 */
962 unsigned int tlv[0]; /* first TLV */
963};
964
965#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
966#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
967#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
968#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
969#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
970#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
971#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
972#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
973#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
974#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
975#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
976#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
977#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
978#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
979#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
980#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
981#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
982#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
983#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
984#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
985#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
986#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
987#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
988#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
989#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
990
991/*
992 * Read interface.
993 */
994
995enum sndrv_ctl_event_type {
996 SNDRV_CTL_EVENT_ELEM = 0,
997 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
998};
999
1000#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
1001#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
1002#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
1003#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
1004#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
1005
1006struct snd_ctl_event {
1007 int type; /* event type - SNDRV_CTL_EVENT_* */
1008 union {
1009 struct {
1010 unsigned int mask;
1011 struct snd_ctl_elem_id id;
1012 } elem;
1013 unsigned char data8[60];
1014 } data;
1015};
1016
1017/*
1018 * Control names
1019 */
1020
1021#define SNDRV_CTL_NAME_NONE ""
1022#define SNDRV_CTL_NAME_PLAYBACK "Playback "
1023#define SNDRV_CTL_NAME_CAPTURE "Capture "
1024
1025#define SNDRV_CTL_NAME_IEC958_NONE ""
1026#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
1027#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
1028#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
1029#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
1030#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
1031#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
1032#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
1033#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
1034
1035#endif /* __SOUND_ASOUND_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/asound_fm.h deleted-135
...@@ -1,135 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_ASOUND_FM_H
3#define __SOUND_ASOUND_FM_H
4
5/*
6 * Advanced Linux Sound Architecture - ALSA
7 *
8 * Interface file between ALSA driver & user space
9 * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
10 * 4Front Technologies
11 *
12 * Direct FM control
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30#define SNDRV_DM_FM_MODE_OPL2 0x00
31#define SNDRV_DM_FM_MODE_OPL3 0x01
32
33struct snd_dm_fm_info {
34 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
35 unsigned char rhythm; /* percussion mode flag */
36};
37
38/*
39 * Data structure composing an FM "note" or sound event.
40 */
41
42struct snd_dm_fm_voice {
43 unsigned char op; /* operator cell (0 or 1) */
44 unsigned char voice; /* FM voice (0 to 17) */
45
46 unsigned char am; /* amplitude modulation */
47 unsigned char vibrato; /* vibrato effect */
48 unsigned char do_sustain; /* sustain phase */
49 unsigned char kbd_scale; /* keyboard scaling */
50 unsigned char harmonic; /* 4 bits: harmonic and multiplier */
51 unsigned char scale_level; /* 2 bits: decrease output freq rises */
52 unsigned char volume; /* 6 bits: volume */
53
54 unsigned char attack; /* 4 bits: attack rate */
55 unsigned char decay; /* 4 bits: decay rate */
56 unsigned char sustain; /* 4 bits: sustain level */
57 unsigned char release; /* 4 bits: release rate */
58
59 unsigned char feedback; /* 3 bits: feedback for op0 */
60 unsigned char connection; /* 0 for serial, 1 for parallel */
61 unsigned char left; /* stereo left */
62 unsigned char right; /* stereo right */
63 unsigned char waveform; /* 3 bits: waveform shape */
64};
65
66/*
67 * This describes an FM note by its voice, octave, frequency number (10bit)
68 * and key on/off.
69 */
70
71struct snd_dm_fm_note {
72 unsigned char voice; /* 0-17 voice channel */
73 unsigned char octave; /* 3 bits: what octave to play */
74 unsigned int fnum; /* 10 bits: frequency number */
75 unsigned char key_on; /* set for active, clear for silent */
76};
77
78/*
79 * FM parameters that apply globally to all voices, and thus are not "notes"
80 */
81
82struct snd_dm_fm_params {
83 unsigned char am_depth; /* amplitude modulation depth (1=hi) */
84 unsigned char vib_depth; /* vibrato depth (1=hi) */
85 unsigned char kbd_split; /* keyboard split */
86 unsigned char rhythm; /* percussion mode select */
87
88 /* This block is the percussion instrument data */
89 unsigned char bass;
90 unsigned char snare;
91 unsigned char tomtom;
92 unsigned char cymbal;
93 unsigned char hihat;
94};
95
96/*
97 * FM mode ioctl settings
98 */
99
100#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)
101#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
102#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)
103#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)
104#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)
105#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
106/* for OPL3 only */
107#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
108/* SBI patch management */
109#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
110
111#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
112#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
113#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22
114#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23
115#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
116#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
117
118/*
119 * Patch Record - fixed size for write
120 */
121
122#define FM_KEY_SBI "SBI\032"
123#define FM_KEY_2OP "2OP\032"
124#define FM_KEY_4OP "4OP\032"
125
126struct sbi_patch {
127 unsigned char prog;
128 unsigned char bank;
129 char key[4];
130 char name[25];
131 char extension[7];
132 unsigned char data[32];
133};
134
135#endif /* __SOUND_ASOUND_FM_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/compress_offload.h deleted-192
...@@ -1,192 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * compress_offload.h - compress offload header definations
4 *
5 * Copyright (C) 2011 Intel Corporation
6 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
7 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 *
23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 *
25 */
26#ifndef __COMPRESS_OFFLOAD_H
27#define __COMPRESS_OFFLOAD_H
28
29#include <linux/types.h>
30#include <sound/asound.h>
31#include <sound/compress_params.h>
32
33
34#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
35/**
36 * struct snd_compressed_buffer - compressed buffer
37 * @fragment_size: size of buffer fragment in bytes
38 * @fragments: number of such fragments
39 */
40struct snd_compressed_buffer {
41 __u32 fragment_size;
42 __u32 fragments;
43} __attribute__((packed, aligned(4)));
44
45/**
46 * struct snd_compr_params - compressed stream params
47 * @buffer: buffer description
48 * @codec: codec parameters
49 * @no_wake_mode: dont wake on fragment elapsed
50 */
51struct snd_compr_params {
52 struct snd_compressed_buffer buffer;
53 struct snd_codec codec;
54 __u8 no_wake_mode;
55} __attribute__((packed, aligned(4)));
56
57/**
58 * struct snd_compr_tstamp - timestamp descriptor
59 * @byte_offset: Byte offset in ring buffer to DSP
60 * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP
61 * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by
62 * large steps and should only be used to monitor encoding/decoding
63 * progress. It shall not be used for timing estimates.
64 * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio
65 * output/input. This field should be used for A/V sync or time estimates.
66 * @sampling_rate: sampling rate of audio
67 */
68struct snd_compr_tstamp {
69 __u32 byte_offset;
70 __u32 copied_total;
71 __u32 pcm_frames;
72 __u32 pcm_io_frames;
73 __u32 sampling_rate;
74} __attribute__((packed, aligned(4)));
75
76/**
77 * struct snd_compr_avail - avail descriptor
78 * @avail: Number of bytes available in ring buffer for writing/reading
79 * @tstamp: timestamp information
80 */
81struct snd_compr_avail {
82 __u64 avail;
83 struct snd_compr_tstamp tstamp;
84} __attribute__((packed, aligned(4)));
85
86enum snd_compr_direction {
87 SND_COMPRESS_PLAYBACK = 0,
88 SND_COMPRESS_CAPTURE
89};
90
91/**
92 * struct snd_compr_caps - caps descriptor
93 * @codecs: pointer to array of codecs
94 * @direction: direction supported. Of type snd_compr_direction
95 * @min_fragment_size: minimum fragment supported by DSP
96 * @max_fragment_size: maximum fragment supported by DSP
97 * @min_fragments: min fragments supported by DSP
98 * @max_fragments: max fragments supported by DSP
99 * @num_codecs: number of codecs supported
100 * @reserved: reserved field
101 */
102struct snd_compr_caps {
103 __u32 num_codecs;
104 __u32 direction;
105 __u32 min_fragment_size;
106 __u32 max_fragment_size;
107 __u32 min_fragments;
108 __u32 max_fragments;
109 __u32 codecs[MAX_NUM_CODECS];
110 __u32 reserved[11];
111} __attribute__((packed, aligned(4)));
112
113/**
114 * struct snd_compr_codec_caps - query capability of codec
115 * @codec: codec for which capability is queried
116 * @num_descriptors: number of codec descriptors
117 * @descriptor: array of codec capability descriptor
118 */
119struct snd_compr_codec_caps {
120 __u32 codec;
121 __u32 num_descriptors;
122 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
123} __attribute__((packed, aligned(4)));
124
125/**
126 * enum sndrv_compress_encoder
127 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
128 * end of the track
129 * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
130 * beginning of the track
131 */
132enum sndrv_compress_encoder {
133 SNDRV_COMPRESS_ENCODER_PADDING = 1,
134 SNDRV_COMPRESS_ENCODER_DELAY = 2,
135};
136
137/**
138 * struct snd_compr_metadata - compressed stream metadata
139 * @key: key id
140 * @value: key value
141 */
142struct snd_compr_metadata {
143 __u32 key;
144 __u32 value[8];
145} __attribute__((packed, aligned(4)));
146
147/**
148 * compress path ioctl definitions
149 * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
150 * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec
151 * SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters
152 * Note: only codec params can be changed runtime and stream params cant be
153 * SNDRV_COMPRESS_GET_PARAMS: Query codec params
154 * SNDRV_COMPRESS_TSTAMP: get the current timestamp value
155 * SNDRV_COMPRESS_AVAIL: get the current buffer avail value.
156 * This also queries the tstamp properties
157 * SNDRV_COMPRESS_PAUSE: Pause the running stream
158 * SNDRV_COMPRESS_RESUME: resume a paused stream
159 * SNDRV_COMPRESS_START: Start a stream
160 * SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content
161 * and the buffers currently with DSP
162 * SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that
163 * SNDRV_COMPRESS_IOCTL_VERSION: Query the API version
164 */
165#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
166#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
167#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\
168 struct snd_compr_codec_caps)
169#define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)
170#define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)
171#define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14,\
172 struct snd_compr_metadata)
173#define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15,\
174 struct snd_compr_metadata)
175#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
176#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
177#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
178#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
179#define SNDRV_COMPRESS_START _IO('C', 0x32)
180#define SNDRV_COMPRESS_STOP _IO('C', 0x33)
181#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
182#define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35)
183#define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36)
184/*
185 * TODO
186 * 1. add mmap support
187 *
188 */
189#define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */
190#define SND_COMPR_TRIGGER_NEXT_TRACK 8
191#define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9
192#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/compress_params.h deleted-406
...@@ -1,406 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) AND MIT) */
2/*
3 * compress_params.h - codec types and parameters for compressed data
4 * streaming interface
5 *
6 * Copyright (C) 2011 Intel Corporation
7 * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8 * Vinod Koul <vinod.koul@linux.intel.com>
9 *
10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2 of the License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *
25 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 *
27 * The definitions in this file are derived from the OpenMAX AL version 1.1
28 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
29 *
30 * Copyright (c) 2007-2010 The Khronos Group Inc.
31 *
32 * Permission is hereby granted, free of charge, to any person obtaining
33 * a copy of this software and/or associated documentation files (the
34 * "Materials "), to deal in the Materials without restriction, including
35 * without limitation the rights to use, copy, modify, merge, publish,
36 * distribute, sublicense, and/or sell copies of the Materials, and to
37 * permit persons to whom the Materials are furnished to do so, subject to
38 * the following conditions:
39 *
40 * The above copyright notice and this permission notice shall be included
41 * in all copies or substantial portions of the Materials.
42 *
43 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
44 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
46 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
47 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
48 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
49 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
50 *
51 */
52#ifndef __SND_COMPRESS_PARAMS_H
53#define __SND_COMPRESS_PARAMS_H
54
55#include <linux/types.h>
56
57/* AUDIO CODECS SUPPORTED */
58#define MAX_NUM_CODECS 32
59#define MAX_NUM_CODEC_DESCRIPTORS 32
60#define MAX_NUM_BITRATES 32
61#define MAX_NUM_SAMPLE_RATES 32
62
63/* Codecs are listed linearly to allow for extensibility */
64#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
65#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
66#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
67#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
68#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
69#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
70#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
71#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
72#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
73#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
74#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
75#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
76#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
77#define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
78#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_BESPOKE
79
80/*
81 * Profile and modes are listed with bit masks. This allows for a
82 * more compact representation of fields that will not evolve
83 * (in contrast to the list of codecs)
84 */
85
86#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
87
88/* MP3 modes are only useful for encoders */
89#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
90#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
91#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
92#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
93
94#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
95
96/* AMR modes are only useful for encoders */
97#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
98#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
99#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
100
101#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
102#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
103#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
104#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
105#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
106#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
107#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
108
109#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
110
111/* AMRWB modes are only useful for encoders */
112#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
113#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
114#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
115
116#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
117
118#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
119
120/* AAC modes are required for encoders and decoders */
121#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
122#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
123#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
124#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
125#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
126#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
127#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
128#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
129#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
130#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
131
132/* AAC formats are required for encoders and decoders */
133#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
134#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
135#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
136#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
137#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
138#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
139#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
140
141#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
142#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
143#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
144#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
145
146#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
147#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
148#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
149#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
150#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
151#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
152#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
153#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
154
155#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
156/*
157 * Some implementations strip the ASF header and only send ASF packets
158 * to the DSP
159 */
160#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
161
162#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
163
164#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
165#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
166#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
167#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
168
169#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
170
171#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
172
173#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
174
175/*
176 * Define quality levels for FLAC encoders, from LEVEL0 (fast)
177 * to LEVEL8 (best)
178 */
179#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
180#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
181#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
182#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
183#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
184#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
185#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
186#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
187#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
188
189#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
190#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
191
192/* IEC61937 payloads without CUVP and preambles */
193#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
194/* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
195#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
196
197/*
198 * IEC modes are mandatory for decoders. Format autodetection
199 * will only happen on the DSP side with mode 0. The PCM mode should
200 * not be used, the PCM codec should be used instead.
201 */
202#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
203#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
204#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
205#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
206#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
207#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
208#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
209#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
210#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
211#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
212#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
213#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
214#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
215#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
216#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
217#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
218#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
219#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
220#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
221
222#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
223
224#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
225#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
226#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
227
228#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
229
230#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
231#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
232
233/* <FIXME: multichannel encoders aren't supported for now. Would need
234 an additional definition of channel arrangement> */
235
236/* VBR/CBR definitions */
237#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
238#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
239
240/* Encoder options */
241
242struct snd_enc_wma {
243 __u32 super_block_align; /* WMA Type-specific data */
244};
245
246
247/**
248 * struct snd_enc_vorbis
249 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
250 * In the default mode of operation, the quality level is 3.
251 * Normal quality range is 0 - 10.
252 * @managed: Boolean. Set bitrate management mode. This turns off the
253 * normal VBR encoding, but allows hard or soft bitrate constraints to be
254 * enforced by the encoder. This mode can be slower, and may also be
255 * lower quality. It is primarily useful for streaming.
256 * @max_bit_rate: Enabled only if managed is TRUE
257 * @min_bit_rate: Enabled only if managed is TRUE
258 * @downmix: Boolean. Downmix input from stereo to mono (has no effect on
259 * non-stereo streams). Useful for lower-bitrate encoding.
260 *
261 * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
262 * properties
263 *
264 * For best quality users should specify VBR mode and set quality levels.
265 */
266
267struct snd_enc_vorbis {
268 __s32 quality;
269 __u32 managed;
270 __u32 max_bit_rate;
271 __u32 min_bit_rate;
272 __u32 downmix;
273} __attribute__((packed, aligned(4)));
274
275
276/**
277 * struct snd_enc_real
278 * @quant_bits: number of coupling quantization bits in the stream
279 * @start_region: coupling start region in the stream
280 * @num_regions: number of regions value
281 *
282 * These options were extracted from the OpenMAX IL spec
283 */
284
285struct snd_enc_real {
286 __u32 quant_bits;
287 __u32 start_region;
288 __u32 num_regions;
289} __attribute__((packed, aligned(4)));
290
291/**
292 * struct snd_enc_flac
293 * @num: serial number, valid only for OGG formats
294 * needs to be set by application
295 * @gain: Add replay gain tags
296 *
297 * These options were extracted from the FLAC online documentation
298 * at http://flac.sourceforge.net/documentation_tools_flac.html
299 *
300 * To make the API simpler, it is assumed that the user will select quality
301 * profiles. Additional options that affect encoding quality and speed can
302 * be added at a later stage if needed.
303 *
304 * By default the Subset format is used by encoders.
305 *
306 * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
307 * not supported in this API.
308 */
309
310struct snd_enc_flac {
311 __u32 num;
312 __u32 gain;
313} __attribute__((packed, aligned(4)));
314
315struct snd_enc_generic {
316 __u32 bw; /* encoder bandwidth */
317 __s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */
318} __attribute__((packed, aligned(4)));
319
320union snd_codec_options {
321 struct snd_enc_wma wma;
322 struct snd_enc_vorbis vorbis;
323 struct snd_enc_real real;
324 struct snd_enc_flac flac;
325 struct snd_enc_generic generic;
326} __attribute__((packed, aligned(4)));
327
328/** struct snd_codec_desc - description of codec capabilities
329 * @max_ch: Maximum number of audio channels
330 * @sample_rates: Sampling rates in Hz, use values like 48000 for this
331 * @num_sample_rates: Number of valid values in sample_rates array
332 * @bit_rate: Indexed array containing supported bit rates
333 * @num_bitrates: Number of valid values in bit_rate array
334 * @rate_control: value is specified by SND_RATECONTROLMODE defines.
335 * @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
336 * @modes: Supported modes. See SND_AUDIOMODE defines
337 * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
338 * @min_buffer: Minimum buffer size handled by codec implementation
339 * @reserved: reserved for future use
340 *
341 * This structure provides a scalar value for profiles, modes and stream
342 * format fields.
343 * If an implementation supports multiple combinations, they will be listed as
344 * codecs with different descriptors, for example there would be 2 descriptors
345 * for AAC-RAW and AAC-ADTS.
346 * This entails some redundancy but makes it easier to avoid invalid
347 * configurations.
348 *
349 */
350
351struct snd_codec_desc {
352 __u32 max_ch;
353 __u32 sample_rates[MAX_NUM_SAMPLE_RATES];
354 __u32 num_sample_rates;
355 __u32 bit_rate[MAX_NUM_BITRATES];
356 __u32 num_bitrates;
357 __u32 rate_control;
358 __u32 profiles;
359 __u32 modes;
360 __u32 formats;
361 __u32 min_buffer;
362 __u32 reserved[15];
363} __attribute__((packed, aligned(4)));
364
365/** struct snd_codec
366 * @id: Identifies the supported audio encoder/decoder.
367 * See SND_AUDIOCODEC macros.
368 * @ch_in: Number of input audio channels
369 * @ch_out: Number of output channels. In case of contradiction between
370 * this field and the channelMode field, the channelMode field
371 * overrides.
372 * @sample_rate: Audio sample rate of input data in Hz, use values like 48000
373 * for this.
374 * @bit_rate: Bitrate of encoded data. May be ignored by decoders
375 * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
376 * Encoders may rely on profiles for quality levels.
377 * May be ignored by decoders.
378 * @profile: Mandatory for encoders, can be mandatory for specific
379 * decoders as well. See SND_AUDIOPROFILE defines.
380 * @level: Supported level (Only used by WMA at the moment)
381 * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
382 * @format: Format of encoded bistream. Mandatory when defined.
383 * See SND_AUDIOSTREAMFORMAT defines.
384 * @align: Block alignment in bytes of an audio sample.
385 * Only required for PCM or IEC formats.
386 * @options: encoder-specific settings
387 * @reserved: reserved for future use
388 */
389
390struct snd_codec {
391 __u32 id;
392 __u32 ch_in;
393 __u32 ch_out;
394 __u32 sample_rate;
395 __u32 bit_rate;
396 __u32 rate_control;
397 __u32 profile;
398 __u32 level;
399 __u32 ch_mode;
400 __u32 format;
401 __u32 align;
402 union snd_codec_options options;
403 __u32 reserved[3];
404} __attribute__((packed, aligned(4)));
405
406#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/emu10k1.h deleted-379
...@@ -1,379 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
4 * Creative Labs, Inc.
5 * Definitions for EMU10K1 (SB Live!) chips
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef __SOUND_EMU10K1_H
24#define __SOUND_EMU10K1_H
25
26#include <linux/types.h>
27#include <sound/asound.h>
28
29/*
30 * ---- FX8010 ----
31 */
32
33#define EMU10K1_CARD_CREATIVE 0x00000000
34#define EMU10K1_CARD_EMUAPS 0x00000001
35
36#define EMU10K1_FX8010_PCM_COUNT 8
37
38/*
39 * Following definition is copied from linux/types.h to support compiling
40 * this header file in userspace since they are not generally available for
41 * uapi headers.
42 */
43#define __EMU10K1_DECLARE_BITMAP(name,bits) \
44 unsigned long name[(bits) / (sizeof(unsigned long) * 8)]
45
46/* instruction set */
47#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
48#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
49#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
50#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
51#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
52#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
53#define iACC3 0x06 /* R = A + X + Y ; saturation */
54#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
55#define iANDXOR 0x08 /* R = (A & X) ^ Y */
56#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
57#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
58#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
59#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
60#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
61#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
62#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
63
64/* GPRs */
65#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
66#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
67#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
68#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
69 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
70
71#define C_00000000 0x40
72#define C_00000001 0x41
73#define C_00000002 0x42
74#define C_00000003 0x43
75#define C_00000004 0x44
76#define C_00000008 0x45
77#define C_00000010 0x46
78#define C_00000020 0x47
79#define C_00000100 0x48
80#define C_00010000 0x49
81#define C_00080000 0x4a
82#define C_10000000 0x4b
83#define C_20000000 0x4c
84#define C_40000000 0x4d
85#define C_80000000 0x4e
86#define C_7fffffff 0x4f
87#define C_ffffffff 0x50
88#define C_fffffffe 0x51
89#define C_c0000000 0x52
90#define C_4f1bbcdc 0x53
91#define C_5a7ef9db 0x54
92#define C_00100000 0x55 /* ?? */
93#define GPR_ACCU 0x56 /* ACCUM, accumulator */
94#define GPR_COND 0x57 /* CCR, condition register */
95#define GPR_NOISE0 0x58 /* noise source */
96#define GPR_NOISE1 0x59 /* noise source */
97#define GPR_IRQ 0x5a /* IRQ register */
98#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
99#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
100#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
101#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
102#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
103#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
104
105#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
106#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
107#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
108#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
109#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
110#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
111
112#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
113#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
114#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
115#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
116#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
117#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
118#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
119#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
120#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
121#define A_GPR(x) (A_FXGPREGBASE + (x))
122
123/* cc_reg constants */
124#define CC_REG_NORMALIZED C_00000001
125#define CC_REG_BORROW C_00000002
126#define CC_REG_MINUS C_00000004
127#define CC_REG_ZERO C_00000008
128#define CC_REG_SATURATE C_00000010
129#define CC_REG_NONZERO C_00000100
130
131/* FX buses */
132#define FXBUS_PCM_LEFT 0x00
133#define FXBUS_PCM_RIGHT 0x01
134#define FXBUS_PCM_LEFT_REAR 0x02
135#define FXBUS_PCM_RIGHT_REAR 0x03
136#define FXBUS_MIDI_LEFT 0x04
137#define FXBUS_MIDI_RIGHT 0x05
138#define FXBUS_PCM_CENTER 0x06
139#define FXBUS_PCM_LFE 0x07
140#define FXBUS_PCM_LEFT_FRONT 0x08
141#define FXBUS_PCM_RIGHT_FRONT 0x09
142#define FXBUS_MIDI_REVERB 0x0c
143#define FXBUS_MIDI_CHORUS 0x0d
144#define FXBUS_PCM_LEFT_SIDE 0x0e
145#define FXBUS_PCM_RIGHT_SIDE 0x0f
146#define FXBUS_PT_LEFT 0x14
147#define FXBUS_PT_RIGHT 0x15
148
149/* Inputs */
150#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
151#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
152#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
153#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
154#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
155#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
156#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
157#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
158#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
159#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
160#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
161#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
162#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
163#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
164
165/* Outputs */
166#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
167#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
168#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
169#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
170#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
171#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
172#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
173#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
174#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
175#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
176#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
177#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
178#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
179#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
180#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
181#define EXTOUT_ACENTER 0x11 /* Analog Center */
182#define EXTOUT_ALFE 0x12 /* Analog LFE */
183
184/* Audigy Inputs */
185#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
186#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
187#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
188#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
189#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
190#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
191#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
192#define A_EXTIN_LINE2_R 0x09 /* right */
193#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
194#define A_EXTIN_ADC_R 0x0b /* right */
195#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
196#define A_EXTIN_AUX2_R 0x0d /* - right */
197
198/* Audigiy Outputs */
199#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
200#define A_EXTOUT_FRONT_R 0x01 /* right */
201#define A_EXTOUT_CENTER 0x02 /* digital front center */
202#define A_EXTOUT_LFE 0x03 /* digital front lfe */
203#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
204#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
205#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
206#define A_EXTOUT_REAR_R 0x07 /* right */
207#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
208#define A_EXTOUT_AFRONT_R 0x09 /* right */
209#define A_EXTOUT_ACENTER 0x0a /* analog center */
210#define A_EXTOUT_ALFE 0x0b /* analog LFE */
211#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
212#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
213#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
214#define A_EXTOUT_AREAR_R 0x0f /* right */
215#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
216#define A_EXTOUT_AC97_R 0x11 /* right */
217#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
218#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
219#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
220
221/* Audigy constants */
222#define A_C_00000000 0xc0
223#define A_C_00000001 0xc1
224#define A_C_00000002 0xc2
225#define A_C_00000003 0xc3
226#define A_C_00000004 0xc4
227#define A_C_00000008 0xc5
228#define A_C_00000010 0xc6
229#define A_C_00000020 0xc7
230#define A_C_00000100 0xc8
231#define A_C_00010000 0xc9
232#define A_C_00000800 0xca
233#define A_C_10000000 0xcb
234#define A_C_20000000 0xcc
235#define A_C_40000000 0xcd
236#define A_C_80000000 0xce
237#define A_C_7fffffff 0xcf
238#define A_C_ffffffff 0xd0
239#define A_C_fffffffe 0xd1
240#define A_C_c0000000 0xd2
241#define A_C_4f1bbcdc 0xd3
242#define A_C_5a7ef9db 0xd4
243#define A_C_00100000 0xd5
244#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
245#define A_GPR_COND 0xd7 /* CCR, condition register */
246#define A_GPR_NOISE0 0xd8 /* noise source */
247#define A_GPR_NOISE1 0xd9 /* noise source */
248#define A_GPR_IRQ 0xda /* IRQ register */
249#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
250#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
251
252/* definitions for debug register */
253#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
254#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
255#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
256#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
257#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
258#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
259#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
260
261/* tank memory address line */
262#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
263#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
264#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
265#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
266#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
267
268struct snd_emu10k1_fx8010_info {
269 unsigned int internal_tram_size; /* in samples */
270 unsigned int external_tram_size; /* in samples */
271 char fxbus_names[16][32]; /* names of FXBUSes */
272 char extin_names[16][32]; /* names of external inputs */
273 char extout_names[32][32]; /* names of external outputs */
274 unsigned int gpr_controls; /* count of GPR controls */
275};
276
277#define EMU10K1_GPR_TRANSLATION_NONE 0
278#define EMU10K1_GPR_TRANSLATION_TABLE100 1
279#define EMU10K1_GPR_TRANSLATION_BASS 2
280#define EMU10K1_GPR_TRANSLATION_TREBLE 3
281#define EMU10K1_GPR_TRANSLATION_ONOFF 4
282
283struct snd_emu10k1_fx8010_control_gpr {
284 struct snd_ctl_elem_id id; /* full control ID definition */
285 unsigned int vcount; /* visible count */
286 unsigned int count; /* count of GPR (1..16) */
287 unsigned short gpr[32]; /* GPR number(s) */
288 unsigned int value[32]; /* initial values */
289 unsigned int min; /* minimum range */
290 unsigned int max; /* maximum range */
291 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
292 const unsigned int *tlv;
293};
294
295/* old ABI without TLV support */
296struct snd_emu10k1_fx8010_control_old_gpr {
297 struct snd_ctl_elem_id id;
298 unsigned int vcount;
299 unsigned int count;
300 unsigned short gpr[32];
301 unsigned int value[32];
302 unsigned int min;
303 unsigned int max;
304 unsigned int translation;
305};
306
307struct snd_emu10k1_fx8010_code {
308 char name[128];
309
310 __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
311 __u32 *gpr_map; /* initializers */
312
313 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
314 struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */
315
316 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
317 struct snd_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */
318
319 unsigned int gpr_list_control_count; /* count of GPR controls to list */
320 unsigned int gpr_list_control_total; /* total count of GPR controls */
321 struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */
322
323 __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
324 __u32 *tram_data_map; /* data initializers */
325 __u32 *tram_addr_map; /* map initializers */
326
327 __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
328 __u32 *code; /* one instruction - 64 bits */
329};
330
331struct snd_emu10k1_fx8010_tram {
332 unsigned int address; /* 31.bit == 1 -> external TRAM */
333 unsigned int size; /* size in samples (4 bytes) */
334 unsigned int *samples; /* pointer to samples (20-bit) */
335 /* NULL->clear memory */
336};
337
338struct snd_emu10k1_fx8010_pcm_rec {
339 unsigned int substream; /* substream number */
340 unsigned int res1; /* reserved */
341 unsigned int channels; /* 16-bit channels count, zero = remove this substream */
342 unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
343 unsigned int buffer_size; /* count of buffered samples */
344 unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
345 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
346 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
347 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
348 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
349 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
350 unsigned char pad; /* reserved */
351 unsigned char etram[32]; /* external TRAM address & data (one per channel) */
352 unsigned int res2; /* reserved */
353};
354
355#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
356
357#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
358#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
359#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
360#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
361#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
362#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
363#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
364#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
365#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
366#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
367#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
368#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
369#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
370#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
371
372/* typedefs for compatibility to user-space */
373typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
374typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
375typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
376typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
377typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
378
379#endif /* __SOUND_EMU10K1_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/firewire.h deleted-91
...@@ -1,91 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SOUND_FIREWIRE_H_INCLUDED
3#define _SOUND_FIREWIRE_H_INCLUDED
4
5#include <linux/ioctl.h>
6#include <linux/types.h>
7
8/* events can be read() from the hwdep device */
9
10#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
11#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
12#define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
13#define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
14#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
15
16struct snd_firewire_event_common {
17 unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
18};
19
20struct snd_firewire_event_lock_status {
21 unsigned int type;
22 unsigned int status; /* 0/1 = unlocked/locked */
23};
24
25struct snd_firewire_event_dice_notification {
26 unsigned int type;
27 unsigned int notification; /* DICE-specific bits */
28};
29
30#define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
31/* each field should be in big endian */
32struct snd_efw_transaction {
33 __be32 length;
34 __be32 version;
35 __be32 seqnum;
36 __be32 category;
37 __be32 command;
38 __be32 status;
39 __be32 params[0];
40};
41struct snd_firewire_event_efw_response {
42 unsigned int type;
43 __be32 response[0]; /* some responses */
44};
45
46struct snd_firewire_event_digi00x_message {
47 unsigned int type;
48 __u32 message; /* Digi00x-specific message */
49};
50
51struct snd_firewire_event_motu_notification {
52 unsigned int type;
53 __u32 message; /* MOTU-specific bits. */
54};
55
56union snd_firewire_event {
57 struct snd_firewire_event_common common;
58 struct snd_firewire_event_lock_status lock_status;
59 struct snd_firewire_event_dice_notification dice_notification;
60 struct snd_firewire_event_efw_response efw_response;
61 struct snd_firewire_event_digi00x_message digi00x_message;
62 struct snd_firewire_event_motu_notification motu_notification;
63};
64
65
66#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
67#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
68#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
69
70#define SNDRV_FIREWIRE_TYPE_DICE 1
71#define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
72#define SNDRV_FIREWIRE_TYPE_BEBOB 3
73#define SNDRV_FIREWIRE_TYPE_OXFW 4
74#define SNDRV_FIREWIRE_TYPE_DIGI00X 5
75#define SNDRV_FIREWIRE_TYPE_TASCAM 6
76#define SNDRV_FIREWIRE_TYPE_MOTU 7
77#define SNDRV_FIREWIRE_TYPE_FIREFACE 8
78
79struct snd_firewire_get_info {
80 unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
81 unsigned int card; /* same as fw_cdev_get_info.card */
82 unsigned char guid[8];
83 char device_name[16]; /* device node in /dev */
84};
85
86/*
87 * SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
88 * Returns -EBUSY if the driver is already streaming.
89 */
90
91#endif /* _SOUND_FIREWIRE_H_INCLUDED */
\ No newline at end of file
lib/libc/include/generic-musl/sound/hdsp.h deleted-111
...@@ -1,111 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_HDSP_H
3#define __SOUND_HDSP_H
4
5/*
6 * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include <linux/types.h>
24
25#define HDSP_MATRIX_MIXER_SIZE 2048
26
27enum HDSP_IO_Type {
28 Digiface,
29 Multiface,
30 H9652,
31 H9632,
32 RPM,
33 Undefined,
34};
35
36struct hdsp_peak_rms {
37 __u32 input_peaks[26];
38 __u32 playback_peaks[26];
39 __u32 output_peaks[28];
40 __u64 input_rms[26];
41 __u64 playback_rms[26];
42 /* These are only used for H96xx cards */
43 __u64 output_rms[26];
44};
45
46#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
47
48struct hdsp_config_info {
49 unsigned char pref_sync_ref;
50 unsigned char wordclock_sync_check;
51 unsigned char spdif_sync_check;
52 unsigned char adatsync_sync_check;
53 unsigned char adat_sync_check[3];
54 unsigned char spdif_in;
55 unsigned char spdif_out;
56 unsigned char spdif_professional;
57 unsigned char spdif_emphasis;
58 unsigned char spdif_nonaudio;
59 unsigned int spdif_sample_rate;
60 unsigned int system_sample_rate;
61 unsigned int autosync_sample_rate;
62 unsigned char system_clock_mode;
63 unsigned char clock_source;
64 unsigned char autosync_ref;
65 unsigned char line_out;
66 unsigned char passthru;
67 unsigned char da_gain;
68 unsigned char ad_gain;
69 unsigned char phone_gain;
70 unsigned char xlr_breakout_cable;
71 unsigned char analog_extension_board;
72};
73
74#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
75
76struct hdsp_firmware {
77 void *firmware_data; /* 24413 x 4 bytes */
78};
79
80#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
81
82struct hdsp_version {
83 enum HDSP_IO_Type io_type;
84 unsigned short firmware_rev;
85};
86
87#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
88
89struct hdsp_mixer {
90 unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
91};
92
93#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
94
95struct hdsp_9632_aeb {
96 int aebi;
97 int aebo;
98};
99
100#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
101
102/* typedefs for compatibility to user-space */
103typedef enum HDSP_IO_Type HDSP_IO_Type;
104typedef struct hdsp_peak_rms hdsp_peak_rms_t;
105typedef struct hdsp_config_info hdsp_config_info_t;
106typedef struct hdsp_firmware hdsp_firmware_t;
107typedef struct hdsp_version hdsp_version_t;
108typedef struct hdsp_mixer hdsp_mixer_t;
109typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
110
111#endif /* __SOUND_HDSP_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/hdspm.h deleted-232
...@@ -1,232 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_HDSPM_H
3#define __SOUND_HDSPM_H
4/*
5 * Copyright (C) 2003 Winfried Ritsch (IEM)
6 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24#include <linux/types.h>
25
26/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
27#define HDSPM_MAX_CHANNELS 64
28
29enum hdspm_io_type {
30 MADI,
31 MADIface,
32 AIO,
33 AES32,
34 RayDAT
35};
36
37enum hdspm_speed {
38 ss,
39 ds,
40 qs
41};
42
43/* -------------------- IOCTL Peak/RMS Meters -------------------- */
44
45struct hdspm_peak_rms {
46 __u32 input_peaks[64];
47 __u32 playback_peaks[64];
48 __u32 output_peaks[64];
49
50 __u64 input_rms[64];
51 __u64 playback_rms[64];
52 __u64 output_rms[64];
53
54 __u8 speed; /* enum {ss, ds, qs} */
55 int status2;
56};
57
58#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
59 _IOR('H', 0x42, struct hdspm_peak_rms)
60
61/* ------------ CONFIG block IOCTL ---------------------- */
62
63struct hdspm_config {
64 unsigned char pref_sync_ref;
65 unsigned char wordclock_sync_check;
66 unsigned char madi_sync_check;
67 unsigned int system_sample_rate;
68 unsigned int autosync_sample_rate;
69 unsigned char system_clock_mode;
70 unsigned char clock_source;
71 unsigned char autosync_ref;
72 unsigned char line_out;
73 unsigned int passthru;
74 unsigned int analog_out;
75};
76
77#define SNDRV_HDSPM_IOCTL_GET_CONFIG \
78 _IOR('H', 0x41, struct hdspm_config)
79
80/*
81 * If there's a TCO (TimeCode Option) board installed,
82 * there are further options and status data available.
83 * The hdspm_ltc structure contains the current SMPTE
84 * timecode and some status information and can be
85 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
86 * hdspm_status struct.
87 */
88
89enum hdspm_ltc_format {
90 format_invalid,
91 fps_24,
92 fps_25,
93 fps_2997,
94 fps_30
95};
96
97enum hdspm_ltc_frame {
98 frame_invalid,
99 drop_frame,
100 full_frame
101};
102
103enum hdspm_ltc_input_format {
104 ntsc,
105 pal,
106 no_video
107};
108
109struct hdspm_ltc {
110 unsigned int ltc;
111
112 enum hdspm_ltc_format format;
113 enum hdspm_ltc_frame frame;
114 enum hdspm_ltc_input_format input_format;
115};
116
117#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
118
119/*
120 * The status data reflects the device's current state
121 * as determined by the card's configuration and
122 * connection status.
123 */
124
125enum hdspm_sync {
126 hdspm_sync_no_lock = 0,
127 hdspm_sync_lock = 1,
128 hdspm_sync_sync = 2
129};
130
131enum hdspm_madi_input {
132 hdspm_input_optical = 0,
133 hdspm_input_coax = 1
134};
135
136enum hdspm_madi_channel_format {
137 hdspm_format_ch_64 = 0,
138 hdspm_format_ch_56 = 1
139};
140
141enum hdspm_madi_frame_format {
142 hdspm_frame_48 = 0,
143 hdspm_frame_96 = 1
144};
145
146enum hdspm_syncsource {
147 syncsource_wc = 0,
148 syncsource_madi = 1,
149 syncsource_tco = 2,
150 syncsource_sync = 3,
151 syncsource_none = 4
152};
153
154struct hdspm_status {
155 __u8 card_type; /* enum hdspm_io_type */
156 enum hdspm_syncsource autosync_source;
157
158 __u64 card_clock;
159 __u32 master_period;
160
161 union {
162 struct {
163 __u8 sync_wc; /* enum hdspm_sync */
164 __u8 sync_madi; /* enum hdspm_sync */
165 __u8 sync_tco; /* enum hdspm_sync */
166 __u8 sync_in; /* enum hdspm_sync */
167 __u8 madi_input; /* enum hdspm_madi_input */
168 __u8 channel_format; /* enum hdspm_madi_channel_format */
169 __u8 frame_format; /* enum hdspm_madi_frame_format */
170 } madi;
171 } card_specific;
172};
173
174#define SNDRV_HDSPM_IOCTL_GET_STATUS \
175 _IOR('H', 0x47, struct hdspm_status)
176
177/*
178 * Get information about the card and its add-ons.
179 */
180
181#define HDSPM_ADDON_TCO 1
182
183struct hdspm_version {
184 __u8 card_type; /* enum hdspm_io_type */
185 char cardname[20];
186 unsigned int serial;
187 unsigned short firmware_rev;
188 int addons;
189};
190
191#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
192
193/* ------------- get Matrix Mixer IOCTL --------------- */
194
195/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
196 * 32768 Bytes
197 */
198
199/* organisation is 64 channelfader in a continuous memory block */
200/* equivalent to hardware definition, maybe for future feature of mmap of
201 * them
202 */
203/* each of 64 outputs has 64 infader and 64 outfader:
204 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
205
206#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
207
208struct hdspm_channelfader {
209 unsigned int in[HDSPM_MIXER_CHANNELS];
210 unsigned int pb[HDSPM_MIXER_CHANNELS];
211};
212
213struct hdspm_mixer {
214 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
215};
216
217struct hdspm_mixer_ioctl {
218 struct hdspm_mixer *mixer;
219};
220
221/* use indirect access due to the limit of ioctl bit size */
222#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
223
224/* typedefs for compatibility to user-space */
225typedef struct hdspm_peak_rms hdspm_peak_rms_t;
226typedef struct hdspm_config_info hdspm_config_info_t;
227typedef struct hdspm_version hdspm_version_t;
228typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
229typedef struct hdspm_mixer hdspm_mixer_t;
230
231
232#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/sb16_csp.h deleted-123
...@@ -1,123 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
4 * Takashi Iwai <tiwai@suse.de>
5 *
6 * SB16ASP/AWE32 CSP control
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef __SOUND_SB16_CSP_H
24#define __SOUND_SB16_CSP_H
25
26
27/* CSP modes */
28#define SNDRV_SB_CSP_MODE_NONE 0x00
29#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
30#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
31#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
32
33/* CSP load flags */
34#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
35#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
36
37/* CSP sample width */
38#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
39#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
40
41/* CSP channels */
42#define SNDRV_SB_CSP_MONO 0x01
43#define SNDRV_SB_CSP_STEREO 0x02
44
45/* CSP rates */
46#define SNDRV_SB_CSP_RATE_8000 0x01
47#define SNDRV_SB_CSP_RATE_11025 0x02
48#define SNDRV_SB_CSP_RATE_22050 0x04
49#define SNDRV_SB_CSP_RATE_44100 0x08
50#define SNDRV_SB_CSP_RATE_ALL 0x0f
51
52/* CSP running state */
53#define SNDRV_SB_CSP_ST_IDLE 0x00
54#define SNDRV_SB_CSP_ST_LOADED 0x01
55#define SNDRV_SB_CSP_ST_RUNNING 0x02
56#define SNDRV_SB_CSP_ST_PAUSED 0x04
57#define SNDRV_SB_CSP_ST_AUTO 0x08
58#define SNDRV_SB_CSP_ST_QSOUND 0x10
59
60/* maximum QSound value (180 degrees right) */
61#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
62
63/* maximum microcode RIFF file size */
64#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
65
66/* microcode header */
67struct snd_sb_csp_mc_header {
68 char codec_name[16]; /* id name of codec */
69 unsigned short func_req; /* requested function */
70};
71
72/* microcode to be loaded */
73struct snd_sb_csp_microcode {
74 struct snd_sb_csp_mc_header info;
75 unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
76};
77
78/* start CSP with sample_width in mono/stereo */
79struct snd_sb_csp_start {
80 int sample_width; /* sample width, look above */
81 int channels; /* channels, look above */
82};
83
84/* CSP information */
85struct snd_sb_csp_info {
86 char codec_name[16]; /* id name of codec */
87 unsigned short func_nr; /* function number */
88 unsigned int acc_format; /* accepted PCM formats */
89 unsigned short acc_channels; /* accepted channels */
90 unsigned short acc_width; /* accepted sample width */
91 unsigned short acc_rates; /* accepted sample rates */
92 unsigned short csp_mode; /* CSP mode, see above */
93 unsigned short run_channels; /* current channels */
94 unsigned short run_width; /* current sample width */
95 unsigned short version; /* version id: 0x10 - 0x1f */
96 unsigned short state; /* state bits */
97};
98
99/* HWDEP controls */
100/* get CSP information */
101#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
102/* load microcode to CSP */
103/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
104 * defined for some architectures like MIPS, and it leads to build errors.
105 * (x86 and co have 14-bit size, thus it's valid, though.)
106 * As a workaround for skipping the size-limit check, here we don't use the
107 * normal _IOW() macro but _IOC() with the manual argument.
108 */
109#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
110 _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
111/* unload microcode from CSP */
112#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
113/* start CSP */
114#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
115/* stop CSP */
116#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
117/* pause CSP and DMA transfer */
118#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
119/* restart CSP and DMA transfer */
120#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
121
122
123#endif /* __SOUND_SB16_CSP_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/sfnt_info.h deleted-213
...@@ -1,213 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef __SOUND_SFNT_INFO_H
3#define __SOUND_SFNT_INFO_H
4
5/*
6 * Patch record compatible with AWE driver on OSS
7 *
8 * Copyright (C) 1999-2000 Takashi Iwai
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#include <sound/asound.h>
27
28/*
29 * patch information record
30 */
31
32#ifdef SNDRV_BIG_ENDIAN
33#define SNDRV_OSS_PATCHKEY(id) (0xfd00|id)
34#else
35#define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd)
36#endif
37
38/* patch interface header: 16 bytes */
39struct soundfont_patch_info {
40 unsigned short key; /* use the key below */
41#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
42
43 short device_no; /* synthesizer number */
44 unsigned short sf_id; /* file id (should be zero) */
45 short optarg; /* optional argument */
46 int len; /* data length (without this header) */
47
48 short type; /* patch operation type */
49#define SNDRV_SFNT_LOAD_INFO 0 /* awe_voice_rec */
50#define SNDRV_SFNT_LOAD_DATA 1 /* awe_sample_info */
51#define SNDRV_SFNT_OPEN_PATCH 2 /* awe_open_parm */
52#define SNDRV_SFNT_CLOSE_PATCH 3 /* none */
53 /* 4 is obsolete */
54#define SNDRV_SFNT_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/
55#define SNDRV_SFNT_MAP_PRESET 6 /* awe_voice_map */
56 /* 7 is not used */
57#define SNDRV_SFNT_PROBE_DATA 8 /* optarg=sample */
58#define SNDRV_SFNT_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */
59
60 short reserved; /* word alignment data */
61
62 /* the actual patch data begins after this */
63};
64
65
66/*
67 * open patch
68 */
69
70#define SNDRV_SFNT_PATCH_NAME_LEN 32
71
72struct soundfont_open_parm {
73 unsigned short type; /* sample type */
74#define SNDRV_SFNT_PAT_TYPE_MISC 0
75#define SNDRV_SFNT_PAT_TYPE_GUS 6
76#define SNDRV_SFNT_PAT_TYPE_MAP 7
77#define SNDRV_SFNT_PAT_LOCKED 0x100 /* lock the samples */
78#define SNDRV_SFNT_PAT_SHARED 0x200 /* sample is shared */
79
80 short reserved;
81 char name[SNDRV_SFNT_PATCH_NAME_LEN];
82};
83
84
85/*
86 * raw voice information record
87 */
88
89/* wave table envelope & effect parameters to control EMU8000 */
90struct soundfont_voice_parm {
91 unsigned short moddelay; /* modulation delay (0x8000) */
92 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
93 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
94 unsigned short modrelease; /* modulation release time (0x807f) */
95 short modkeyhold, modkeydecay; /* envelope change per key (not used) */
96 unsigned short voldelay; /* volume delay (0x8000) */
97 unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */
98 unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */
99 unsigned short volrelease; /* volume release time (0x807f) */
100 short volkeyhold, volkeydecay; /* envelope change per key (not used) */
101 unsigned short lfo1delay; /* LFO1 delay (0x8000) */
102 unsigned short lfo2delay; /* LFO2 delay (0x8000) */
103 unsigned short pefe; /* modulation pitch & cutoff (0x0000) */
104 unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */
105 unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */
106 unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */
107 unsigned char cutoff; /* initial cutoff (0xff) */
108 unsigned char filterQ; /* initial filter Q [0-15] (0x0) */
109 unsigned char chorus; /* chorus send (0x00) */
110 unsigned char reverb; /* reverb send (0x00) */
111 unsigned short reserved[4]; /* not used */
112};
113
114
115/* wave table parameters: 92 bytes */
116struct soundfont_voice_info {
117 unsigned short sf_id; /* file id (should be zero) */
118 unsigned short sample; /* sample id */
119 int start, end; /* sample offset correction */
120 int loopstart, loopend; /* loop offset correction */
121 short rate_offset; /* sample rate pitch offset */
122 unsigned short mode; /* sample mode */
123#define SNDRV_SFNT_MODE_ROMSOUND 0x8000
124#define SNDRV_SFNT_MODE_STEREO 1
125#define SNDRV_SFNT_MODE_LOOPING 2
126#define SNDRV_SFNT_MODE_NORELEASE 4 /* obsolete */
127#define SNDRV_SFNT_MODE_INIT_PARM 8
128
129 short root; /* midi root key */
130 short tune; /* pitch tuning (in cents) */
131 unsigned char low, high; /* key note range */
132 unsigned char vellow, velhigh; /* velocity range */
133 signed char fixkey, fixvel; /* fixed key, velocity */
134 signed char pan, fixpan; /* panning, fixed panning */
135 short exclusiveClass; /* exclusive class (0 = none) */
136 unsigned char amplitude; /* sample volume (127 max) */
137 unsigned char attenuation; /* attenuation (0.375dB) */
138 short scaleTuning; /* pitch scale tuning(%), normally 100 */
139 struct soundfont_voice_parm parm; /* voice envelope parameters */
140 unsigned short sample_mode; /* sample mode_flag (set by driver) */
141};
142
143
144/* instrument info header: 4 bytes */
145struct soundfont_voice_rec_hdr {
146 unsigned char bank; /* midi bank number */
147 unsigned char instr; /* midi preset number */
148 char nvoices; /* number of voices */
149 char write_mode; /* write mode; normally 0 */
150#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
151#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
152#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
153};
154
155
156/*
157 * sample wave information
158 */
159
160/* wave table sample header: 32 bytes */
161struct soundfont_sample_info {
162 unsigned short sf_id; /* file id (should be zero) */
163 unsigned short sample; /* sample id */
164 int start, end; /* start & end offset */
165 int loopstart, loopend; /* loop start & end offset */
166 int size; /* size (0 = ROM) */
167 short dummy; /* not used */
168 unsigned short mode_flags; /* mode flags */
169#define SNDRV_SFNT_SAMPLE_8BITS 1 /* wave data is 8bits */
170#define SNDRV_SFNT_SAMPLE_UNSIGNED 2 /* wave data is unsigned */
171#define SNDRV_SFNT_SAMPLE_NO_BLANK 4 /* no blank loop is attached */
172#define SNDRV_SFNT_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */
173#define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */
174#define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32 /* stereo left sound */
175#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
176#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
177 unsigned int truesize; /* used memory size (set by driver) */
178};
179
180
181/*
182 * voice preset mapping (aliasing)
183 */
184
185struct soundfont_voice_map {
186 int map_bank, map_instr, map_key; /* key = -1 means all keys */
187 int src_bank, src_instr, src_key;
188};
189
190
191/*
192 * ioctls for hwdep
193 */
194
195#define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable"
196
197#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
198
199struct snd_emux_misc_mode {
200 int port; /* -1 = all */
201 int mode;
202 int value;
203 int value2; /* reserved */
204};
205
206#define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int)
207#define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info)
208#define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82)
209#define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83)
210#define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int)
211#define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode)
212
213#endif /* __SOUND_SFNT_INFO_H */
\ No newline at end of file
lib/libc/include/generic-musl/sound/skl-tplg-interface.h deleted-239
...@@ -1,239 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * skl-tplg-interface.h - Intel DSP FW private data interface
4 *
5 * Copyright (C) 2015 Intel Corp
6 * Author: Jeeja KP <jeeja.kp@intel.com>
7 * Nilofer, Samreen <samreen.nilofer@intel.com>
8 */
9
10#ifndef __HDA_TPLG_INTERFACE_H__
11#define __HDA_TPLG_INTERFACE_H__
12
13#include <linux/types.h>
14
15/*
16 * Default types range from 0~12. type can range from 0 to 0xff
17 * SST types start at higher to avoid any overlapping in future
18 */
19#define SKL_CONTROL_TYPE_BYTE_TLV 0x100
20#define SKL_CONTROL_TYPE_MIC_SELECT 0x102
21
22#define HDA_SST_CFG_MAX 900 /* size of copier cfg*/
23#define MAX_IN_QUEUE 8
24#define MAX_OUT_QUEUE 8
25
26#define SKL_UUID_STR_SZ 40
27/* Event types goes here */
28/* Reserve event type 0 for no event handlers */
29enum skl_event_types {
30 SKL_EVENT_NONE = 0,
31 SKL_MIXER_EVENT,
32 SKL_MUX_EVENT,
33 SKL_VMIXER_EVENT,
34 SKL_PGA_EVENT
35};
36
37/**
38 * enum skl_ch_cfg - channel configuration
39 *
40 * @SKL_CH_CFG_MONO: One channel only
41 * @SKL_CH_CFG_STEREO: L & R
42 * @SKL_CH_CFG_2_1: L, R & LFE
43 * @SKL_CH_CFG_3_0: L, C & R
44 * @SKL_CH_CFG_3_1: L, C, R & LFE
45 * @SKL_CH_CFG_QUATRO: L, R, Ls & Rs
46 * @SKL_CH_CFG_4_0: L, C, R & Cs
47 * @SKL_CH_CFG_5_0: L, C, R, Ls & Rs
48 * @SKL_CH_CFG_5_1: L, C, R, Ls, Rs & LFE
49 * @SKL_CH_CFG_DUAL_MONO: One channel replicated in two
50 * @SKL_CH_CFG_I2S_DUAL_STEREO_0: Stereo(L,R) in 4 slots, 1st stream:[ L, R, -, - ]
51 * @SKL_CH_CFG_I2S_DUAL_STEREO_1: Stereo(L,R) in 4 slots, 2nd stream:[ -, -, L, R ]
52 * @SKL_CH_CFG_INVALID: Invalid
53 */
54enum skl_ch_cfg {
55 SKL_CH_CFG_MONO = 0,
56 SKL_CH_CFG_STEREO = 1,
57 SKL_CH_CFG_2_1 = 2,
58 SKL_CH_CFG_3_0 = 3,
59 SKL_CH_CFG_3_1 = 4,
60 SKL_CH_CFG_QUATRO = 5,
61 SKL_CH_CFG_4_0 = 6,
62 SKL_CH_CFG_5_0 = 7,
63 SKL_CH_CFG_5_1 = 8,
64 SKL_CH_CFG_DUAL_MONO = 9,
65 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
66 SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
67 SKL_CH_CFG_4_CHANNEL = 12,
68 SKL_CH_CFG_INVALID
69};
70
71enum skl_module_type {
72 SKL_MODULE_TYPE_MIXER = 0,
73 SKL_MODULE_TYPE_COPIER,
74 SKL_MODULE_TYPE_UPDWMIX,
75 SKL_MODULE_TYPE_SRCINT,
76 SKL_MODULE_TYPE_ALGO,
77 SKL_MODULE_TYPE_BASE_OUTFMT,
78 SKL_MODULE_TYPE_KPB,
79 SKL_MODULE_TYPE_MIC_SELECT,
80};
81
82enum skl_core_affinity {
83 SKL_AFFINITY_CORE_0 = 0,
84 SKL_AFFINITY_CORE_1,
85 SKL_AFFINITY_CORE_MAX
86};
87
88enum skl_pipe_conn_type {
89 SKL_PIPE_CONN_TYPE_NONE = 0,
90 SKL_PIPE_CONN_TYPE_FE,
91 SKL_PIPE_CONN_TYPE_BE
92};
93
94enum skl_hw_conn_type {
95 SKL_CONN_NONE = 0,
96 SKL_CONN_SOURCE = 1,
97 SKL_CONN_SINK = 2
98};
99
100enum skl_dev_type {
101 SKL_DEVICE_BT = 0x0,
102 SKL_DEVICE_DMIC = 0x1,
103 SKL_DEVICE_I2S = 0x2,
104 SKL_DEVICE_SLIMBUS = 0x3,
105 SKL_DEVICE_HDALINK = 0x4,
106 SKL_DEVICE_HDAHOST = 0x5,
107 SKL_DEVICE_NONE
108};
109
110/**
111 * enum skl_interleaving - interleaving style
112 *
113 * @SKL_INTERLEAVING_PER_CHANNEL: [s1_ch1...s1_chN,...,sM_ch1...sM_chN]
114 * @SKL_INTERLEAVING_PER_SAMPLE: [s1_ch1...sM_ch1,...,s1_chN...sM_chN]
115 */
116enum skl_interleaving {
117 SKL_INTERLEAVING_PER_CHANNEL = 0,
118 SKL_INTERLEAVING_PER_SAMPLE = 1,
119};
120
121enum skl_sample_type {
122 SKL_SAMPLE_TYPE_INT_MSB = 0,
123 SKL_SAMPLE_TYPE_INT_LSB = 1,
124 SKL_SAMPLE_TYPE_INT_SIGNED = 2,
125 SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
126 SKL_SAMPLE_TYPE_FLOAT = 4
127};
128
129enum module_pin_type {
130 /* All pins of the module takes same PCM inputs or outputs
131 * e.g. mixout
132 */
133 SKL_PIN_TYPE_HOMOGENEOUS,
134 /* All pins of the module takes different PCM inputs or outputs
135 * e.g mux
136 */
137 SKL_PIN_TYPE_HETEROGENEOUS,
138};
139
140enum skl_module_param_type {
141 SKL_PARAM_DEFAULT = 0,
142 SKL_PARAM_INIT,
143 SKL_PARAM_SET,
144 SKL_PARAM_BIND
145};
146
147struct skl_dfw_algo_data {
148 __u32 set_params:2;
149 __u32 rsvd:30;
150 __u32 param_id;
151 __u32 max;
152 char params[0];
153} __attribute__((packed));
154
155enum skl_tkn_dir {
156 SKL_DIR_IN,
157 SKL_DIR_OUT
158};
159
160enum skl_tuple_type {
161 SKL_TYPE_TUPLE,
162 SKL_TYPE_DATA
163};
164
165/* v4 configuration data */
166
167struct skl_dfw_v4_module_pin {
168 __u16 module_id;
169 __u16 instance_id;
170} __attribute__((packed));
171
172struct skl_dfw_v4_module_fmt {
173 __u32 channels;
174 __u32 freq;
175 __u32 bit_depth;
176 __u32 valid_bit_depth;
177 __u32 ch_cfg;
178 __u32 interleaving_style;
179 __u32 sample_type;
180 __u32 ch_map;
181} __attribute__((packed));
182
183struct skl_dfw_v4_module_caps {
184 __u32 set_params:2;
185 __u32 rsvd:30;
186 __u32 param_id;
187 __u32 caps_size;
188 __u32 caps[HDA_SST_CFG_MAX];
189} __attribute__((packed));
190
191struct skl_dfw_v4_pipe {
192 __u8 pipe_id;
193 __u8 pipe_priority;
194 __u16 conn_type:4;
195 __u16 rsvd:4;
196 __u16 memory_pages:8;
197} __attribute__((packed));
198
199struct skl_dfw_v4_module {
200 char uuid[SKL_UUID_STR_SZ];
201
202 __u16 module_id;
203 __u16 instance_id;
204 __u32 max_mcps;
205 __u32 mem_pages;
206 __u32 obs;
207 __u32 ibs;
208 __u32 vbus_id;
209
210 __u32 max_in_queue:8;
211 __u32 max_out_queue:8;
212 __u32 time_slot:8;
213 __u32 core_id:4;
214 __u32 rsvd1:4;
215
216 __u32 module_type:8;
217 __u32 conn_type:4;
218 __u32 dev_type:4;
219 __u32 hw_conn_type:4;
220 __u32 rsvd2:12;
221
222 __u32 params_fixup:8;
223 __u32 converter:8;
224 __u32 input_pin_type:1;
225 __u32 output_pin_type:1;
226 __u32 is_dynamic_in_pin:1;
227 __u32 is_dynamic_out_pin:1;
228 __u32 is_loadable:1;
229 __u32 rsvd3:11;
230
231 struct skl_dfw_v4_pipe pipe;
232 struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];
233 struct skl_dfw_v4_module_fmt out_fmt[MAX_OUT_QUEUE];
234 struct skl_dfw_v4_module_pin in_pin[MAX_IN_QUEUE];
235 struct skl_dfw_v4_module_pin out_pin[MAX_OUT_QUEUE];
236 struct skl_dfw_v4_module_caps caps;
237} __attribute__((packed));
238
239#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/snd_sst_tokens.h deleted-330
...@@ -1,330 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * snd_sst_tokens.h - Intel SST tokens definition
4 *
5 * Copyright (C) 2016 Intel Corp
6 * Author: Shreyas NC <shreyas.nc@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18#ifndef __SND_SST_TOKENS_H__
19#define __SND_SST_TOKENS_H__
20
21/**
22 * %SKL_TKN_UUID: Module UUID
23 *
24 * %SKL_TKN_U8_BLOCK_TYPE: Type of the private data block.Can be:
25 * tuples, bytes, short and words
26 *
27 * %SKL_TKN_U8_IN_PIN_TYPE: Input pin type,
28 * homogenous=0, heterogenous=1
29 *
30 * %SKL_TKN_U8_OUT_PIN_TYPE: Output pin type,
31 * homogenous=0, heterogenous=1
32 * %SKL_TKN_U8_DYN_IN_PIN: Configure Input pin dynamically
33 * if true
34 *
35 * %SKL_TKN_U8_DYN_OUT_PIN: Configure Output pin dynamically
36 * if true
37 *
38 * %SKL_TKN_U8_IN_QUEUE_COUNT: Store the number of Input pins
39 *
40 * %SKL_TKN_U8_OUT_QUEUE_COUNT: Store the number of Output pins
41 *
42 * %SKL_TKN_U8_TIME_SLOT: TDM slot number
43 *
44 * %SKL_TKN_U8_CORE_ID: Stores module affinity value.Can take
45 * the values:
46 * SKL_AFFINITY_CORE_0 = 0,
47 * SKL_AFFINITY_CORE_1,
48 * SKL_AFFINITY_CORE_MAX
49 *
50 * %SKL_TKN_U8_MOD_TYPE: Module type value.
51 *
52 * %SKL_TKN_U8_CONN_TYPE: Module connection type can be a FE,
53 * BE or NONE as defined :
54 * SKL_PIPE_CONN_TYPE_NONE = 0,
55 * SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA)
56 * SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA)
57 *
58 * %SKL_TKN_U8_DEV_TYPE: Type of device to which the module is
59 * connected
60 * Can take the values:
61 * SKL_DEVICE_BT = 0x0,
62 * SKL_DEVICE_DMIC = 0x1,
63 * SKL_DEVICE_I2S = 0x2,
64 * SKL_DEVICE_SLIMBUS = 0x3,
65 * SKL_DEVICE_HDALINK = 0x4,
66 * SKL_DEVICE_HDAHOST = 0x5,
67 * SKL_DEVICE_NONE
68 *
69 * %SKL_TKN_U8_HW_CONN_TYPE: Connection type of the HW to which the
70 * module is connected
71 * SKL_CONN_NONE = 0,
72 * SKL_CONN_SOURCE = 1,
73 * SKL_CONN_SINK = 2
74 *
75 * %SKL_TKN_U16_PIN_INST_ID: Stores the pin instance id
76 *
77 * %SKL_TKN_U16_MOD_INST_ID: Stores the mdule instance id
78 *
79 * %SKL_TKN_U32_MAX_MCPS: Module max mcps value
80 *
81 * %SKL_TKN_U32_MEM_PAGES: Module resource pages
82 *
83 * %SKL_TKN_U32_OBS: Stores Output Buffer size
84 *
85 * %SKL_TKN_U32_IBS: Stores input buffer size
86 *
87 * %SKL_TKN_U32_VBUS_ID: Module VBUS_ID. PDM=0, SSP0=0,
88 * SSP1=1,SSP2=2,
89 * SSP3=3, SSP4=4,
90 * SSP5=5, SSP6=6,INVALID
91 *
92 * %SKL_TKN_U32_PARAMS_FIXUP: Module Params fixup mask
93 * %SKL_TKN_U32_CONVERTER: Module params converter mask
94 * %SKL_TKN_U32_PIPE_ID: Stores the pipe id
95 *
96 * %SKL_TKN_U32_PIPE_CONN_TYPE: Type of the token to which the pipe is
97 * connected to. It can be
98 * SKL_PIPE_CONN_TYPE_NONE = 0,
99 * SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA),
100 * SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA),
101 *
102 * %SKL_TKN_U32_PIPE_PRIORITY: Pipe priority value
103 * %SKL_TKN_U32_PIPE_MEM_PGS: Pipe resource pages
104 *
105 * %SKL_TKN_U32_DIR_PIN_COUNT: Value for the direction to set input/output
106 * formats and the pin count.
107 * The first 4 bits have the direction
108 * value and the next 4 have
109 * the pin count value.
110 * SKL_DIR_IN = 0, SKL_DIR_OUT = 1.
111 * The input and output formats
112 * share the same set of tokens
113 * with the distinction between input
114 * and output made by reading direction
115 * token.
116 *
117 * %SKL_TKN_U32_FMT_CH: Supported channel count
118 *
119 * %SKL_TKN_U32_FMT_FREQ: Supported frequency/sample rate
120 *
121 * %SKL_TKN_U32_FMT_BIT_DEPTH: Supported container size
122 *
123 * %SKL_TKN_U32_FMT_SAMPLE_SIZE:Number of samples in the container
124 *
125 * %SKL_TKN_U32_FMT_CH_CONFIG: Supported channel configurations for the
126 * input/output.
127 *
128 * %SKL_TKN_U32_FMT_INTERLEAVE: Interleaving style which can be per
129 * channel or per sample. The values can be :
130 * SKL_INTERLEAVING_PER_CHANNEL = 0,
131 * SKL_INTERLEAVING_PER_SAMPLE = 1,
132 *
133 * %SKL_TKN_U32_FMT_SAMPLE_TYPE:
134 * Specifies the sample type. Can take the
135 * values: SKL_SAMPLE_TYPE_INT_MSB = 0,
136 * SKL_SAMPLE_TYPE_INT_LSB = 1,
137 * SKL_SAMPLE_TYPE_INT_SIGNED = 2,
138 * SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
139 * SKL_SAMPLE_TYPE_FLOAT = 4
140 *
141 * %SKL_TKN_U32_CH_MAP: Channel map values
142 * %SKL_TKN_U32_MOD_SET_PARAMS: It can take these values:
143 * SKL_PARAM_DEFAULT, SKL_PARAM_INIT,
144 * SKL_PARAM_SET, SKL_PARAM_BIND
145 *
146 * %SKL_TKN_U32_MOD_PARAM_ID: ID of the module params
147 *
148 * %SKL_TKN_U32_CAPS_SET_PARAMS:
149 * Set params value
150 *
151 * %SKL_TKN_U32_CAPS_PARAMS_ID: Params ID
152 *
153 * %SKL_TKN_U32_CAPS_SIZE: Caps size
154 *
155 * %SKL_TKN_U32_PROC_DOMAIN: Specify processing domain
156 *
157 * %SKL_TKN_U32_LIB_COUNT: Specifies the number of libraries
158 *
159 * %SKL_TKN_STR_LIB_NAME: Specifies the library name
160 *
161 * %SKL_TKN_U32_PMODE: Specifies the power mode for pipe
162 *
163 * %SKL_TKL_U32_D0I3_CAPS: Specifies the D0i3 capability for module
164 *
165 * %SKL_TKN_U32_DMA_BUF_SIZE: DMA buffer size in millisec
166 *
167 * %SKL_TKN_U32_PIPE_DIR: Specifies pipe direction. Can be
168 * playback/capture.
169 *
170 * %SKL_TKN_U32_NUM_CONFIGS: Number of pipe configs
171 *
172 * %SKL_TKN_U32_PATH_MEM_PGS: Size of memory (in pages) required for pipeline
173 * and its data
174 *
175 * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
176 * and PCM params supported by that pipe
177 * config. This is used as index to fill
178 * up the pipe config and module config
179 * structure.
180 *
181 * %SKL_TKN_U32_CFG_FREQ:
182 * %SKL_TKN_U8_CFG_CHAN:
183 * %SKL_TKN_U8_CFG_BPS: PCM params (freq, channels, bits per sample)
184 * supported for each of the pipe configs.
185 *
186 * %SKL_TKN_CFG_MOD_RES_ID: Module's resource index for each of the
187 * pipe config
188 *
189 * %SKL_TKN_CFG_MOD_FMT_ID: Module's interface index for each of the
190 * pipe config
191 *
192 * %SKL_TKN_U8_NUM_MOD: Number of modules in the manifest
193 *
194 * %SKL_TKN_MM_U8_MOD_IDX: Current index of the module in the manifest
195 *
196 * %SKL_TKN_MM_U8_NUM_RES: Number of resources for the module
197 *
198 * %SKL_TKN_MM_U8_NUM_INTF: Number of interfaces for the module
199 *
200 * %SKL_TKN_MM_U32_RES_ID: Resource index for the resource info to
201 * be filled into.
202 * A module can support multiple resource
203 * configuration and is represnted as a
204 * resource table. This index is used to
205 * fill information into appropriate index.
206 *
207 * %SKL_TKN_MM_U32_CPS: DSP cycles per second
208 *
209 * %SKL_TKN_MM_U32_DMA_SIZE: Allocated buffer size for gateway DMA
210 *
211 * %SKL_TKN_MM_U32_CPC: DSP cycles allocated per frame
212 *
213 * %SKL_TKN_MM_U32_RES_PIN_ID: Resource pin index in the module
214 *
215 * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
216 *
217 * %SKL_TKN_MM_U32_PIN_BUF: Buffer size of the module pin
218 *
219 * %SKL_TKN_MM_U32_FMT_ID: Format index for each of the interface/
220 * format information to be filled into.
221 *
222 * %SKL_TKN_MM_U32_NUM_IN_FMT: Number of input formats
223 * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
224 *
225 * %SKL_TKN_U32_ASTATE_IDX: Table Index for the A-State entry to be filled
226 * with kcps and clock source
227 *
228 * %SKL_TKN_U32_ASTATE_COUNT: Number of valid entries in A-State table
229 *
230 * %SKL_TKN_U32_ASTATE_KCPS: Specifies the core load threshold (in kilo
231 * cycles per second) below which DSP is clocked
232 * from source specified by clock source.
233 *
234 * %SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
235 *
236 * module_id and loadable flags dont have tokens as these values will be
237 * read from the DSP FW manifest
238 *
239 * Tokens defined can be used either in the manifest or widget private data.
240 *
241 * SKL_TKN_MM is used as a suffix for all tokens that represent
242 * module data in the manifest.
243 */
244enum SKL_TKNS {
245 SKL_TKN_UUID = 1,
246 SKL_TKN_U8_NUM_BLOCKS,
247 SKL_TKN_U8_BLOCK_TYPE,
248 SKL_TKN_U8_IN_PIN_TYPE,
249 SKL_TKN_U8_OUT_PIN_TYPE,
250 SKL_TKN_U8_DYN_IN_PIN,
251 SKL_TKN_U8_DYN_OUT_PIN,
252 SKL_TKN_U8_IN_QUEUE_COUNT,
253 SKL_TKN_U8_OUT_QUEUE_COUNT,
254 SKL_TKN_U8_TIME_SLOT,
255 SKL_TKN_U8_CORE_ID,
256 SKL_TKN_U8_MOD_TYPE,
257 SKL_TKN_U8_CONN_TYPE,
258 SKL_TKN_U8_DEV_TYPE,
259 SKL_TKN_U8_HW_CONN_TYPE,
260 SKL_TKN_U16_MOD_INST_ID,
261 SKL_TKN_U16_BLOCK_SIZE,
262 SKL_TKN_U32_MAX_MCPS,
263 SKL_TKN_U32_MEM_PAGES,
264 SKL_TKN_U32_OBS,
265 SKL_TKN_U32_IBS,
266 SKL_TKN_U32_VBUS_ID,
267 SKL_TKN_U32_PARAMS_FIXUP,
268 SKL_TKN_U32_CONVERTER,
269 SKL_TKN_U32_PIPE_ID,
270 SKL_TKN_U32_PIPE_CONN_TYPE,
271 SKL_TKN_U32_PIPE_PRIORITY,
272 SKL_TKN_U32_PIPE_MEM_PGS,
273 SKL_TKN_U32_DIR_PIN_COUNT,
274 SKL_TKN_U32_FMT_CH,
275 SKL_TKN_U32_FMT_FREQ,
276 SKL_TKN_U32_FMT_BIT_DEPTH,
277 SKL_TKN_U32_FMT_SAMPLE_SIZE,
278 SKL_TKN_U32_FMT_CH_CONFIG,
279 SKL_TKN_U32_FMT_INTERLEAVE,
280 SKL_TKN_U32_FMT_SAMPLE_TYPE,
281 SKL_TKN_U32_FMT_CH_MAP,
282 SKL_TKN_U32_PIN_MOD_ID,
283 SKL_TKN_U32_PIN_INST_ID,
284 SKL_TKN_U32_MOD_SET_PARAMS,
285 SKL_TKN_U32_MOD_PARAM_ID,
286 SKL_TKN_U32_CAPS_SET_PARAMS,
287 SKL_TKN_U32_CAPS_PARAMS_ID,
288 SKL_TKN_U32_CAPS_SIZE,
289 SKL_TKN_U32_PROC_DOMAIN,
290 SKL_TKN_U32_LIB_COUNT,
291 SKL_TKN_STR_LIB_NAME,
292 SKL_TKN_U32_PMODE,
293 SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
294 SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
295 SKL_TKN_U32_DMA_BUF_SIZE,
296
297 SKL_TKN_U32_PIPE_DIRECTION,
298 SKL_TKN_U32_PIPE_CONFIG_ID,
299 SKL_TKN_U32_NUM_CONFIGS,
300 SKL_TKN_U32_PATH_MEM_PGS,
301
302 SKL_TKN_U32_CFG_FREQ,
303 SKL_TKN_U8_CFG_CHAN,
304 SKL_TKN_U8_CFG_BPS,
305 SKL_TKN_CFG_MOD_RES_ID,
306 SKL_TKN_CFG_MOD_FMT_ID,
307 SKL_TKN_U8_NUM_MOD,
308
309 SKL_TKN_MM_U8_MOD_IDX,
310 SKL_TKN_MM_U8_NUM_RES,
311 SKL_TKN_MM_U8_NUM_INTF,
312 SKL_TKN_MM_U32_RES_ID,
313 SKL_TKN_MM_U32_CPS,
314 SKL_TKN_MM_U32_DMA_SIZE,
315 SKL_TKN_MM_U32_CPC,
316 SKL_TKN_MM_U32_RES_PIN_ID,
317 SKL_TKN_MM_U32_INTF_PIN_ID,
318 SKL_TKN_MM_U32_PIN_BUF,
319 SKL_TKN_MM_U32_FMT_ID,
320 SKL_TKN_MM_U32_NUM_IN_FMT,
321 SKL_TKN_MM_U32_NUM_OUT_FMT,
322
323 SKL_TKN_U32_ASTATE_IDX,
324 SKL_TKN_U32_ASTATE_COUNT,
325 SKL_TKN_U32_ASTATE_KCPS,
326 SKL_TKN_U32_ASTATE_CLK_SRC,
327 SKL_TKN_MAX = SKL_TKN_U32_ASTATE_CLK_SRC,
328};
329
330#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/tlv.h deleted-117
...@@ -1,117 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __UAPI_SOUND_TLV_H
15#define __UAPI_SOUND_TLV_H
16
17#define SNDRV_CTL_TLVT_CONTAINER 0 /* one level down - group of TLVs */
18#define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */
19#define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */
20#define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */
21#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */
22#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */
23
24/*
25 * channel-mapping TLV items
26 * TLV length must match with num_channels
27 */
28#define SNDRV_CTL_TLVT_CHMAP_FIXED 0x101 /* fixed channel position */
29#define SNDRV_CTL_TLVT_CHMAP_VAR 0x102 /* channels freely swappable */
30#define SNDRV_CTL_TLVT_CHMAP_PAIRED 0x103 /* pair-wise swappable */
31
32/*
33 * TLV structure is right behind the struct snd_ctl_tlv:
34 * unsigned int type - see SNDRV_CTL_TLVT_*
35 * unsigned int length
36 * .... data aligned to sizeof(unsigned int), use
37 * block_length = (length + (sizeof(unsigned int) - 1)) &
38 * ~(sizeof(unsigned int) - 1)) ....
39 */
40#define SNDRV_CTL_TLVD_ITEM(type, ...) \
41 (type), SNDRV_CTL_TLVD_LENGTH(__VA_ARGS__), __VA_ARGS__
42#define SNDRV_CTL_TLVD_LENGTH(...) \
43 ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
44
45/* Accessor offsets for TLV data items */
46#define SNDRV_CTL_TLVO_TYPE 0
47#define SNDRV_CTL_TLVO_LEN 1
48
49#define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \
50 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
51#define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \
52 unsigned int name[] = { \
53 SNDRV_CTL_TLVD_CONTAINER_ITEM(__VA_ARGS__) \
54 }
55
56#define SNDRV_CTL_TLVD_DB_SCALE_MASK 0xffff
57#define SNDRV_CTL_TLVD_DB_SCALE_MUTE 0x10000
58#define SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
59 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \
60 (min), \
61 ((step) & SNDRV_CTL_TLVD_DB_SCALE_MASK) | \
62 ((mute) ? SNDRV_CTL_TLVD_DB_SCALE_MUTE : 0))
63#define SNDRV_CTL_TLVD_DECLARE_DB_SCALE(name, min, step, mute) \
64 unsigned int name[] = { \
65 SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
66 }
67
68/* Accessor offsets for min, mute and step items in dB scale type TLV */
69#define SNDRV_CTL_TLVO_DB_SCALE_MIN 2
70#define SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP 3
71
72/* dB scale specified with min/max values instead of step */
73#define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
74 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))
75#define SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
76 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB))
77#define SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(name, min_dB, max_dB) \
78 unsigned int name[] = { \
79 SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
80 }
81#define SNDRV_CTL_TLVD_DECLARE_DB_MINMAX_MUTE(name, min_dB, max_dB) \
82 unsigned int name[] = { \
83 SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
84 }
85
86/* Accessor offsets for min, max items in db-minmax types of TLV. */
87#define SNDRV_CTL_TLVO_DB_MINMAX_MIN 2
88#define SNDRV_CTL_TLVO_DB_MINMAX_MAX 3
89
90/* linear volume between min_dB and max_dB (.01dB unit) */
91#define SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \
92 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB))
93#define SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(name, min_dB, max_dB) \
94 unsigned int name[] = { \
95 SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \
96 }
97
98/* Accessor offsets for min, max items in db-linear type of TLV. */
99#define SNDRV_CTL_TLVO_DB_LINEAR_MIN 2
100#define SNDRV_CTL_TLVO_DB_LINEAR_MAX 3
101
102/* dB range container:
103 * Items in dB range container must be ordered by their values and by their
104 * dB values. This implies that larger values must correspond with larger
105 * dB values (which is also required for all other mixer controls).
106 */
107/* Each item is: <min> <max> <TLV> */
108#define SNDRV_CTL_TLVD_DB_RANGE_ITEM(...) \
109 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__)
110#define SNDRV_CTL_TLVD_DECLARE_DB_RANGE(name, ...) \
111 unsigned int name[] = { \
112 SNDRV_CTL_TLVD_DB_RANGE_ITEM(__VA_ARGS__) \
113 }
114
115#define SNDRV_CTL_TLVD_DB_GAIN_MUTE -9999999
116
117#endif
\ No newline at end of file
lib/libc/include/generic-musl/sound/usb_stream.h deleted-77
...@@ -1,77 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef __SOUND_USB_STREAM_H
21#define __SOUND_USB_STREAM_H
22
23#define USB_STREAM_INTERFACE_VERSION 2
24
25#define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \
26 _IOW('H', 0x90, struct usb_stream_config)
27
28struct usb_stream_packet {
29 unsigned offset;
30 unsigned length;
31};
32
33
34struct usb_stream_config {
35 unsigned version;
36 unsigned sample_rate;
37 unsigned period_frames;
38 unsigned frame_size;
39};
40
41struct usb_stream {
42 struct usb_stream_config cfg;
43 unsigned read_size;
44 unsigned write_size;
45
46 int period_size;
47
48 unsigned state;
49
50 int idle_insize;
51 int idle_outsize;
52 int sync_packet;
53 unsigned insize_done;
54 unsigned periods_done;
55 unsigned periods_polled;
56
57 struct usb_stream_packet outpacket[2];
58 unsigned inpackets;
59 unsigned inpacket_head;
60 unsigned inpacket_split;
61 unsigned inpacket_split_at;
62 unsigned next_inpacket_split;
63 unsigned next_inpacket_split_at;
64 struct usb_stream_packet inpacket[0];
65};
66
67enum usb_stream_state {
68 usb_stream_invalid,
69 usb_stream_stopped,
70 usb_stream_sync0,
71 usb_stream_sync1,
72 usb_stream_ready,
73 usb_stream_running,
74 usb_stream_xrun,
75};
76
77#endif /* __SOUND_USB_STREAM_H */
\ No newline at end of file
lib/libc/include/generic-musl/stdio.h+4
...@@ -11,6 +11,10 @@ extern "C" {...@@ -11,6 +11,10 @@ extern "C" {
11#define __NEED___isoc_va_list11#define __NEED___isoc_va_list
12#define __NEED_size_t12#define __NEED_size_t
1313
14#if __STDC_VERSION__ < 201112L
15#define __NEED_struct__IO_FILE
16#endif
17
14#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \18#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
15 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \19 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
16 || defined(_BSD_SOURCE)20 || defined(_BSD_SOURCE)
lib/libc/include/generic-musl/symcat.h deleted-55
...@@ -1,55 +0,0 @@
1/* Symbol concatenation utilities.
2
3 Copyright (C) 1998-2019 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
18
19#ifndef SYM_CAT_H
20#define SYM_CAT_H
21
22#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
23#define CONCAT2(a,b) a##b
24#define CONCAT3(a,b,c) a##b##c
25#define CONCAT4(a,b,c,d) a##b##c##d
26#define CONCAT5(a,b,c,d,e) a##b##c##d##e
27#define CONCAT6(a,b,c,d,e,f) a##b##c##d##e##f
28#define STRINGX(s) #s
29#else
30/* Note one should never pass extra whitespace to the CONCATn macros,
31 e.g. CONCAT2(foo, bar) because traditonal C will keep the space between
32 the two labels instead of concatenating them. Instead, make sure to
33 write CONCAT2(foo,bar). */
34#define CONCAT2(a,b) a/**/b
35#define CONCAT3(a,b,c) a/**/b/**/c
36#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
37#define CONCAT5(a,b,c,d,e) a/**/b/**/c/**/d/**/e
38#define CONCAT6(a,b,c,d,e,f) a/**/b/**/c/**/d/**/e/**/f
39#define STRINGX(s) "s"
40#endif
41
42#define XCONCAT2(a,b) CONCAT2(a,b)
43#define XCONCAT3(a,b,c) CONCAT3(a,b,c)
44#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)
45#define XCONCAT5(a,b,c,d,e) CONCAT5(a,b,c,d,e)
46#define XCONCAT6(a,b,c,d,e,f) CONCAT6(a,b,c,d,e,f)
47
48/* Note the layer of indirection here is typically used to allow
49 stringification of the expansion of macros. I.e. "#define foo
50 bar", "XSTRING(foo)", to yield "bar". Be aware that this only
51 works for __STDC__, not for traditional C which will still resolve
52 to "foo". */
53#define XSTRING(s) STRINGX(s)
54
55#endif /* SYM_CAT_H */
\ No newline at end of file
lib/libc/include/generic-musl/sys/fanotify.h+33-1
...@@ -5,6 +5,8 @@...@@ -5,6 +5,8 @@
5extern "C" {5extern "C" {
6#endif6#endif
77
8#include <sys/statfs.h>
9
8struct fanotify_event_metadata {10struct fanotify_event_metadata {
9 unsigned event_len;11 unsigned event_len;
10 unsigned char vers;12 unsigned char vers;
...@@ -19,6 +21,18 @@ struct fanotify_event_metadata {...@@ -19,6 +21,18 @@ struct fanotify_event_metadata {
19 int pid;21 int pid;
20};22};
2123
24struct fanotify_event_info_header {
25 unsigned char info_type;
26 unsigned char pad;
27 unsigned short len;
28};
29
30struct fanotify_event_info_fid {
31 struct fanotify_event_info_header hdr;
32 fsid_t fsid;
33 unsigned char handle[];
34};
35
22struct fanotify_response {36struct fanotify_response {
23 int fd;37 int fd;
24 unsigned response;38 unsigned response;
...@@ -26,15 +40,25 @@ struct fanotify_response {...@@ -26,15 +40,25 @@ struct fanotify_response {
2640
27#define FAN_ACCESS 0x0141#define FAN_ACCESS 0x01
28#define FAN_MODIFY 0x0242#define FAN_MODIFY 0x02
43#define FAN_ATTRIB 0x04
29#define FAN_CLOSE_WRITE 0x0844#define FAN_CLOSE_WRITE 0x08
30#define FAN_CLOSE_NOWRITE 0x1045#define FAN_CLOSE_NOWRITE 0x10
31#define FAN_OPEN 0x2046#define FAN_OPEN 0x20
47#define FAN_MOVED_FROM 0x40
48#define FAN_MOVED_TO 0x80
49#define FAN_CREATE 0x100
50#define FAN_DELETE 0x200
51#define FAN_DELETE_SELF 0x400
52#define FAN_MOVE_SELF 0x800
53#define FAN_OPEN_EXEC 0x1000
32#define FAN_Q_OVERFLOW 0x400054#define FAN_Q_OVERFLOW 0x4000
33#define FAN_OPEN_PERM 0x1000055#define FAN_OPEN_PERM 0x10000
34#define FAN_ACCESS_PERM 0x2000056#define FAN_ACCESS_PERM 0x20000
57#define FAN_OPEN_EXEC_PERM 0x40000
35#define FAN_ONDIR 0x4000000058#define FAN_ONDIR 0x40000000
36#define FAN_EVENT_ON_CHILD 0x0800000059#define FAN_EVENT_ON_CHILD 0x08000000
37#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE)60#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE)
61#define FAN_MOVE (FAN_MOVED_FROM | FAN_MOVED_TO)
38#define FAN_CLOEXEC 0x0162#define FAN_CLOEXEC 0x01
39#define FAN_NONBLOCK 0x0263#define FAN_NONBLOCK 0x02
40#define FAN_CLASS_NOTIF 064#define FAN_CLASS_NOTIF 0
...@@ -43,22 +67,30 @@ struct fanotify_response {...@@ -43,22 +67,30 @@ struct fanotify_response {
43#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)67#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)
44#define FAN_UNLIMITED_QUEUE 0x1068#define FAN_UNLIMITED_QUEUE 0x10
45#define FAN_UNLIMITED_MARKS 0x2069#define FAN_UNLIMITED_MARKS 0x20
70#define FAN_ENABLE_AUDIT 0x40
71#define FAN_REPORT_TID 0x100
72#define FAN_REPORT_FID 0x200
46#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)73#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)
47#define FAN_MARK_ADD 0x0174#define FAN_MARK_ADD 0x01
48#define FAN_MARK_REMOVE 0x0275#define FAN_MARK_REMOVE 0x02
49#define FAN_MARK_DONT_FOLLOW 0x0476#define FAN_MARK_DONT_FOLLOW 0x04
50#define FAN_MARK_ONLYDIR 0x0877#define FAN_MARK_ONLYDIR 0x08
51#define FAN_MARK_MOUNT 0x10
52#define FAN_MARK_IGNORED_MASK 0x2078#define FAN_MARK_IGNORED_MASK 0x20
53#define FAN_MARK_IGNORED_SURV_MODIFY 0x4079#define FAN_MARK_IGNORED_SURV_MODIFY 0x40
54#define FAN_MARK_FLUSH 0x8080#define FAN_MARK_FLUSH 0x80
81#define FAN_MARK_INODE 0x00
82#define FAN_MARK_MOUNT 0x10
83#define FAN_MARK_FILESYSTEM 0x100
84#define FAN_MARK_TYPE_MASK (FAN_MARK_INODE | FAN_MARK_MOUNT | FAN_MARK_FILESYSTEM)
55#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_DONT_FOLLOW | FAN_MARK_ONLYDIR | FAN_MARK_MOUNT | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY | FAN_MARK_FLUSH)85#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_DONT_FOLLOW | FAN_MARK_ONLYDIR | FAN_MARK_MOUNT | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY | FAN_MARK_FLUSH)
56#define FAN_ALL_EVENTS (FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN)86#define FAN_ALL_EVENTS (FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN)
57#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_ACCESS_PERM)87#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_ACCESS_PERM)
58#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_Q_OVERFLOW)88#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_Q_OVERFLOW)
59#define FANOTIFY_METADATA_VERSION 389#define FANOTIFY_METADATA_VERSION 3
90#define FAN_EVENT_INFO_TYPE_FID 1
60#define FAN_ALLOW 0x0191#define FAN_ALLOW 0x01
61#define FAN_DENY 0x0292#define FAN_DENY 0x02
93#define FAN_AUDIT 0x10
62#define FAN_NOFD -194#define FAN_NOFD -1
63#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))95#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
64#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, (struct fanotify_event_metadata*)(((char *)(meta)) + (meta)->event_len))96#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, (struct fanotify_event_metadata*)(((char *)(meta)) + (meta)->event_len))
lib/libc/include/generic-musl/sys/inotify.h+1
...@@ -40,6 +40,7 @@ struct inotify_event {...@@ -40,6 +40,7 @@ struct inotify_event {
40#define IN_ONLYDIR 0x0100000040#define IN_ONLYDIR 0x01000000
41#define IN_DONT_FOLLOW 0x0200000041#define IN_DONT_FOLLOW 0x02000000
42#define IN_EXCL_UNLINK 0x0400000042#define IN_EXCL_UNLINK 0x04000000
43#define IN_MASK_CREATE 0x10000000
43#define IN_MASK_ADD 0x2000000044#define IN_MASK_ADD 0x20000000
4445
45#define IN_ISDIR 0x4000000046#define IN_ISDIR 0x40000000
lib/libc/include/generic-musl/sys/ioctl.h+110
...@@ -6,6 +6,116 @@ extern "C" {...@@ -6,6 +6,116 @@ extern "C" {
66
7#include <bits/ioctl.h>7#include <bits/ioctl.h>
88
9#define N_TTY 0
10#define N_SLIP 1
11#define N_MOUSE 2
12#define N_PPP 3
13#define N_STRIP 4
14#define N_AX25 5
15#define N_X25 6
16#define N_6PACK 7
17#define N_MASC 8
18#define N_R3964 9
19#define N_PROFIBUS_FDL 10
20#define N_IRDA 11
21#define N_SMSBLOCK 12
22#define N_HDLC 13
23#define N_SYNC_PPP 14
24#define N_HCI 15
25#define N_GIGASET_M101 16
26#define N_SLCAN 17
27#define N_PPS 18
28#define N_V253 19
29#define N_CAIF 20
30#define N_GSM0710 21
31#define N_TI_WL 22
32#define N_TRACESINK 23
33#define N_TRACEROUTER 24
34#define N_NCI 25
35#define N_SPEAKUP 26
36#define N_NULL 27
37
38#define TIOCPKT_DATA 0
39#define TIOCPKT_FLUSHREAD 1
40#define TIOCPKT_FLUSHWRITE 2
41#define TIOCPKT_STOP 4
42#define TIOCPKT_START 8
43#define TIOCPKT_NOSTOP 16
44#define TIOCPKT_DOSTOP 32
45#define TIOCPKT_IOCTL 64
46
47#define TIOCSER_TEMT 1
48
49struct winsize {
50 unsigned short ws_row;
51 unsigned short ws_col;
52 unsigned short ws_xpixel;
53 unsigned short ws_ypixel;
54};
55
56#define SIOCADDRT 0x890B
57#define SIOCDELRT 0x890C
58#define SIOCRTMSG 0x890D
59
60#define SIOCGIFNAME 0x8910
61#define SIOCSIFLINK 0x8911
62#define SIOCGIFCONF 0x8912
63#define SIOCGIFFLAGS 0x8913
64#define SIOCSIFFLAGS 0x8914
65#define SIOCGIFADDR 0x8915
66#define SIOCSIFADDR 0x8916
67#define SIOCGIFDSTADDR 0x8917
68#define SIOCSIFDSTADDR 0x8918
69#define SIOCGIFBRDADDR 0x8919
70#define SIOCSIFBRDADDR 0x891a
71#define SIOCGIFNETMASK 0x891b
72#define SIOCSIFNETMASK 0x891c
73#define SIOCGIFMETRIC 0x891d
74#define SIOCSIFMETRIC 0x891e
75#define SIOCGIFMEM 0x891f
76#define SIOCSIFMEM 0x8920
77#define SIOCGIFMTU 0x8921
78#define SIOCSIFMTU 0x8922
79#define SIOCSIFNAME 0x8923
80#define SIOCSIFHWADDR 0x8924
81#define SIOCGIFENCAP 0x8925
82#define SIOCSIFENCAP 0x8926
83#define SIOCGIFHWADDR 0x8927
84#define SIOCGIFSLAVE 0x8929
85#define SIOCSIFSLAVE 0x8930
86#define SIOCADDMULTI 0x8931
87#define SIOCDELMULTI 0x8932
88#define SIOCGIFINDEX 0x8933
89#define SIOGIFINDEX SIOCGIFINDEX
90#define SIOCSIFPFLAGS 0x8934
91#define SIOCGIFPFLAGS 0x8935
92#define SIOCDIFADDR 0x8936
93#define SIOCSIFHWBROADCAST 0x8937
94#define SIOCGIFCOUNT 0x8938
95
96#define SIOCGIFBR 0x8940
97#define SIOCSIFBR 0x8941
98
99#define SIOCGIFTXQLEN 0x8942
100#define SIOCSIFTXQLEN 0x8943
101
102#define SIOCDARP 0x8953
103#define SIOCGARP 0x8954
104#define SIOCSARP 0x8955
105
106#define SIOCDRARP 0x8960
107#define SIOCGRARP 0x8961
108#define SIOCSRARP 0x8962
109
110#define SIOCGIFMAP 0x8970
111#define SIOCSIFMAP 0x8971
112
113#define SIOCADDDLCI 0x8980
114#define SIOCDELDLCI 0x8981
115
116#define SIOCDEVPRIVATE 0x89F0
117#define SIOCPROTOPRIVATE 0x89E0
118
9int ioctl (int, int, ...);119int ioctl (int, int, ...);
10120
11#ifdef __cplusplus121#ifdef __cplusplus
lib/libc/include/generic-musl/sys/membarrier.h created+17
...@@ -0,0 +1,17 @@
1#ifndef _SYS_MEMBARRIER_H
2#define _SYS_MEMBARRIER_H
3
4#define MEMBARRIER_CMD_QUERY 0
5#define MEMBARRIER_CMD_GLOBAL 1
6#define MEMBARRIER_CMD_GLOBAL_EXPEDITED 2
7#define MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED 4
8#define MEMBARRIER_CMD_PRIVATE_EXPEDITED 8
9#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 16
10#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 32
11#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 64
12
13#define MEMBARRIER_CMD_SHARED MEMBARRIER_CMD_GLOBAL
14
15int membarrier(int, int);
16
17#endif
\ No newline at end of file
lib/libc/include/generic-musl/sys/mman.h+2
...@@ -46,7 +46,9 @@ extern "C" {...@@ -46,7 +46,9 @@ extern "C" {
46#define MAP_HUGE_2MB (21 << 26)46#define MAP_HUGE_2MB (21 << 26)
47#define MAP_HUGE_8MB (23 << 26)47#define MAP_HUGE_8MB (23 << 26)
48#define MAP_HUGE_16MB (24 << 26)48#define MAP_HUGE_16MB (24 << 26)
49#define MAP_HUGE_32MB (25 << 26)
49#define MAP_HUGE_256MB (28 << 26)50#define MAP_HUGE_256MB (28 << 26)
51#define MAP_HUGE_512MB (29 << 26)
50#define MAP_HUGE_1GB (30 << 26)52#define MAP_HUGE_1GB (30 << 26)
51#define MAP_HUGE_2GB (31 << 26)53#define MAP_HUGE_2GB (31 << 26)
52#define MAP_HUGE_16GB (34U << 26)54#define MAP_HUGE_16GB (34U << 26)
lib/libc/include/generic-musl/sys/prctl.h+9
...@@ -139,11 +139,20 @@ struct prctl_mm_map {...@@ -139,11 +139,20 @@ struct prctl_mm_map {
139#define PR_GET_SPECULATION_CTRL 52139#define PR_GET_SPECULATION_CTRL 52
140#define PR_SET_SPECULATION_CTRL 53140#define PR_SET_SPECULATION_CTRL 53
141#define PR_SPEC_STORE_BYPASS 0141#define PR_SPEC_STORE_BYPASS 0
142#define PR_SPEC_INDIRECT_BRANCH 1
142#define PR_SPEC_NOT_AFFECTED 0143#define PR_SPEC_NOT_AFFECTED 0
143#define PR_SPEC_PRCTL (1UL << 0)144#define PR_SPEC_PRCTL (1UL << 0)
144#define PR_SPEC_ENABLE (1UL << 1)145#define PR_SPEC_ENABLE (1UL << 1)
145#define PR_SPEC_DISABLE (1UL << 2)146#define PR_SPEC_DISABLE (1UL << 2)
146#define PR_SPEC_FORCE_DISABLE (1UL << 3)147#define PR_SPEC_FORCE_DISABLE (1UL << 3)
148#define PR_SPEC_DISABLE_NOEXEC (1UL << 4)
149
150#define PR_PAC_RESET_KEYS 54
151#define PR_PAC_APIAKEY (1UL << 0)
152#define PR_PAC_APIBKEY (1UL << 1)
153#define PR_PAC_APDAKEY (1UL << 2)
154#define PR_PAC_APDBKEY (1UL << 3)
155#define PR_PAC_APGAKEY (1UL << 4)
147156
148int prctl (int, ...);157int prctl (int, ...);
149158
lib/libc/include/generic-musl/sys/shm.h+2
...@@ -49,7 +49,9 @@ extern "C" {...@@ -49,7 +49,9 @@ extern "C" {
49#define SHM_HUGE_2MB (21 << 26)49#define SHM_HUGE_2MB (21 << 26)
50#define SHM_HUGE_8MB (23 << 26)50#define SHM_HUGE_8MB (23 << 26)
51#define SHM_HUGE_16MB (24 << 26)51#define SHM_HUGE_16MB (24 << 26)
52#define SHM_HUGE_32MB (25 << 26)
52#define SHM_HUGE_256MB (28 << 26)53#define SHM_HUGE_256MB (28 << 26)
54#define SHM_HUGE_512MB (29 << 26)
53#define SHM_HUGE_1GB (30 << 26)55#define SHM_HUGE_1GB (30 << 26)
54#define SHM_HUGE_2GB (31 << 26)56#define SHM_HUGE_2GB (31 << 26)
55#define SHM_HUGE_16GB (34U << 26)57#define SHM_HUGE_16GB (34U << 26)
lib/libc/include/generic-musl/sys/socket.h+3
...@@ -235,6 +235,9 @@ struct linger {...@@ -235,6 +235,9 @@ struct linger {
235#define SCM_TIMESTAMPING_PKTINFO 58235#define SCM_TIMESTAMPING_PKTINFO 58
236#define SO_PEERGROUPS 59236#define SO_PEERGROUPS 59
237#define SO_ZEROCOPY 60237#define SO_ZEROCOPY 60
238#define SO_TXTIME 61
239#define SCM_TXTIME SO_TXTIME
240#define SO_BINDTOIFINDEX 62
238241
239#ifndef SOL_SOCKET242#ifndef SOL_SOCKET
240#define SOL_SOCKET 1243#define SOL_SOCKET 1
lib/libc/include/generic-musl/sys/types.h-1
...@@ -69,7 +69,6 @@ typedef long long quad_t;...@@ -69,7 +69,6 @@ typedef long long quad_t;
69typedef unsigned long long u_quad_t;69typedef unsigned long long u_quad_t;
70#include <endian.h>70#include <endian.h>
71#include <sys/select.h>71#include <sys/select.h>
72#include <sys/sysmacros.h>
73#endif72#endif
7473
75#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)74#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
lib/libc/include/generic-musl/tar.h-4
...@@ -1,13 +1,9 @@...@@ -1,13 +1,9 @@
1#ifndef _TAR_H1#ifndef _TAR_H
2#define _TAR_H2#define _TAR_H
33
4#include <features.h>
5
6#define TSUID 040004#define TSUID 04000
7#define TSGID 020005#define TSGID 02000
8#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
9#define TSVTX 010006#define TSVTX 01000
10#endif
11#define TUREAD 004007#define TUREAD 00400
12#define TUWRITE 002008#define TUWRITE 00200
13#define TUEXEC 001009#define TUEXEC 00100
lib/libc/include/generic-musl/ucontext.h+1-1
...@@ -15,7 +15,7 @@ extern "C" {...@@ -15,7 +15,7 @@ extern "C" {
15struct __ucontext;15struct __ucontext;
1616
17int getcontext(struct __ucontext *);17int getcontext(struct __ucontext *);
18void makecontext(struct __ucontext *, void (*)(void), int, ...);18void makecontext(struct __ucontext *, void (*)(), int, ...);
19int setcontext(const struct __ucontext *);19int setcontext(const struct __ucontext *);
20int swapcontext(struct __ucontext *, const struct __ucontext *);20int swapcontext(struct __ucontext *, const struct __ucontext *);
2121
lib/libc/include/generic-musl/video/edid.h deleted-10
...@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __linux_video_edid_h__
3#define __linux_video_edid_h__
4
5struct edid_info {
6 unsigned char dummy[128];
7};
8
9
10#endif /* __linux_video_edid_h__ */
\ No newline at end of file
lib/libc/include/generic-musl/video/sisfb.h deleted-210
...@@ -1,210 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * sisfb.h - definitions for the SiS framebuffer driver
4 *
5 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the named License,
10 * or any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20 */
21
22#ifndef _LINUX_SISFB_H_
23#define _LINUX_SISFB_H_
24
25#include <linux/types.h>
26#include <asm/ioctl.h>
27
28/**********************************************/
29/* PUBLIC */
30/**********************************************/
31
32/* vbflags, public (others in sis.h) */
33#define CRT2_DEFAULT 0x00000001
34#define CRT2_LCD 0x00000002
35#define CRT2_TV 0x00000004
36#define CRT2_VGA 0x00000008
37#define TV_NTSC 0x00000010
38#define TV_PAL 0x00000020
39#define TV_HIVISION 0x00000040
40#define TV_YPBPR 0x00000080
41#define TV_AVIDEO 0x00000100
42#define TV_SVIDEO 0x00000200
43#define TV_SCART 0x00000400
44#define TV_PALM 0x00001000
45#define TV_PALN 0x00002000
46#define TV_NTSCJ 0x00001000
47#define TV_CHSCART 0x00008000
48#define TV_CHYPBPR525I 0x00010000
49#define CRT1_VGA 0x00000000
50#define CRT1_LCDA 0x00020000
51#define VGA2_CONNECTED 0x00040000
52#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */
53#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
54#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
55#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
56
57/* Aliases: */
58#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
59#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
60#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
61
62/* Only if TV_YPBPR is set: */
63#define TV_YPBPR525I TV_NTSC
64#define TV_YPBPR525P TV_PAL
65#define TV_YPBPR750P TV_PALM
66#define TV_YPBPR1080I TV_PALN
67#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
68
69#define VB_DISPTYPE_DISP2 CRT2_ENABLE
70#define VB_DISPTYPE_CRT2 CRT2_ENABLE
71#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
72#define VB_DISPMODE_SINGLE VB_SINGLE_MODE
73#define VB_DISPMODE_MIRROR VB_MIRROR_MODE
74#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
75#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
76
77/* Structure argument for SISFB_GET_INFO ioctl */
78struct sisfb_info {
79 __u32 sisfb_id; /* for identifying sisfb */
80#ifndef SISFB_ID
81#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
82#endif
83 __u32 chip_id; /* PCI-ID of detected chip */
84 __u32 memory; /* total video memory in KB */
85 __u32 heapstart; /* heap start offset in KB */
86 __u8 fbvidmode; /* current sisfb mode */
87
88 __u8 sisfb_version;
89 __u8 sisfb_revision;
90 __u8 sisfb_patchlevel;
91
92 __u8 sisfb_caps; /* sisfb capabilities */
93
94 __u32 sisfb_tqlen; /* turbo queue length (in KB) */
95
96 __u32 sisfb_pcibus; /* The card's PCI ID */
97 __u32 sisfb_pcislot;
98 __u32 sisfb_pcifunc;
99
100 __u8 sisfb_lcdpdc; /* PanelDelayCompensation */
101
102 __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */
103
104 __u32 sisfb_vbflags;
105 __u32 sisfb_currentvbflags;
106
107 __u32 sisfb_scalelcd;
108 __u32 sisfb_specialtiming;
109
110 __u8 sisfb_haveemi;
111 __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
112 __u8 sisfb_haveemilcd;
113
114 __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */
115
116 __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
117
118 __u32 sisfb_heapsize; /* heap size (in KB) */
119 __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */
120
121 __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */
122 __u32 sisfb_curdstn;
123
124 __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */
125
126 __u32 sisfb_vbflags2; /* ivideo->vbflags2 */
127
128 __u8 sisfb_can_post; /* sisfb can POST this card */
129 __u8 sisfb_card_posted; /* card is POSTED */
130 __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */
131
132 __u8 reserved[183]; /* for future use */
133};
134
135#define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */
136#define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */
137/* more to come */
138
139#define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */
140#define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */
141#define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */
142#define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */
143#define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */
144/* more to come */
145#define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */
146#define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */
147
148/* Argument for SISFB_CMD ioctl */
149struct sisfb_cmd {
150 __u32 sisfb_cmd;
151 __u32 sisfb_arg[16];
152 __u32 sisfb_result[4];
153};
154
155/* Additional IOCTLs for communication sisfb <> X driver */
156/* If changing this, vgatypes.h must also be changed (for X driver) */
157
158/* ioctl for identifying and giving some info (esp. memory heap start) */
159#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
160#define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info)
161
162/* ioctrl to get current vertical retrace status */
163#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
164
165/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
166#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
167#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
168
169/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
170#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
171#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
172
173/* ioctl for internal sisfb commands (sisfbctrl) */
174#define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd)
175
176/* ioctl for locking sisfb (no register access during lock) */
177/* As of now, only used to avoid register access during
178 * the ioctls listed above.
179 */
180#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
181
182/* ioctls 0xF3 up to 0x3F reserved for sisfb */
183
184/****************************************************************/
185/* The following are deprecated and should not be used anymore: */
186/****************************************************************/
187/* ioctl for identifying and giving some info (esp. memory heap start) */
188#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
189/* ioctrl to get current vertical retrace status */
190#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
191/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
192#define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
193#define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
194/****************************************************************/
195/* End of deprecated ioctl numbers */
196/****************************************************************/
197
198/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
199struct sis_memreq {
200 __u32 offset;
201 __u32 size;
202};
203
204/**********************************************/
205/* PRIVATE */
206/* (for IN-KERNEL usage only) */
207/**********************************************/
208
209
210#endif /* _LINUX_SISFB_H_ */
\ No newline at end of file
lib/libc/include/generic-musl/video/uvesafb.h deleted-61
...@@ -1,61 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UVESAFB_H
3#define _UVESAFB_H
4
5#include <linux/types.h>
6
7struct v86_regs {
8 __u32 ebx;
9 __u32 ecx;
10 __u32 edx;
11 __u32 esi;
12 __u32 edi;
13 __u32 ebp;
14 __u32 eax;
15 __u32 eip;
16 __u32 eflags;
17 __u32 esp;
18 __u16 cs;
19 __u16 ss;
20 __u16 es;
21 __u16 ds;
22 __u16 fs;
23 __u16 gs;
24};
25
26/* Task flags */
27#define TF_VBEIB 0x01
28#define TF_BUF_ESDI 0x02
29#define TF_BUF_ESBX 0x04
30#define TF_BUF_RET 0x08
31#define TF_EXIT 0x10
32
33struct uvesafb_task {
34 __u8 flags;
35 int buf_len;
36 struct v86_regs regs;
37};
38
39/* Constants for the capabilities field
40 * in vbe_ib */
41#define VBE_CAP_CAN_SWITCH_DAC 0x01
42#define VBE_CAP_VGACOMPAT 0x02
43
44/* The VBE Info Block */
45struct vbe_ib {
46 char vbe_signature[4];
47 __u16 vbe_version;
48 __u32 oem_string_ptr;
49 __u32 capabilities;
50 __u32 mode_list_ptr;
51 __u16 total_memory;
52 __u16 oem_software_rev;
53 __u32 oem_vendor_name_ptr;
54 __u32 oem_product_name_ptr;
55 __u32 oem_product_rev_ptr;
56 __u8 reserved[222];
57 char oem_data[256];
58 char misc_data[512];
59} __attribute__ ((packed));
60
61#endif /* _UVESAFB_H */
\ No newline at end of file
lib/libc/include/generic-musl/wchar.h+4
...@@ -14,6 +14,10 @@ extern "C" {...@@ -14,6 +14,10 @@ extern "C" {
14#define __NEED_wint_t14#define __NEED_wint_t
15#define __NEED_mbstate_t15#define __NEED_mbstate_t
1616
17#if __STDC_VERSION__ < 201112L
18#define __NEED_struct__IO_FILE
19#endif
20
17#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \21#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
18 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)22 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
19#define __NEED_locale_t23#define __NEED_locale_t
lib/libc/include/generic-musl/xen/evtchn.h deleted-104
...@@ -1,104 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
2/******************************************************************************
3 * evtchn.h
4 *
5 * Interface to /dev/xen/evtchn.
6 *
7 * Copyright (c) 2003-2005, K A Fraser
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef __LINUX_PUBLIC_EVTCHN_H__
35#define __LINUX_PUBLIC_EVTCHN_H__
36
37/*
38 * Bind a fresh port to VIRQ @virq.
39 * Return allocated port.
40 */
41#define IOCTL_EVTCHN_BIND_VIRQ \
42 _IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq))
43struct ioctl_evtchn_bind_virq {
44 unsigned int virq;
45};
46
47/*
48 * Bind a fresh port to remote <@remote_domain, @remote_port>.
49 * Return allocated port.
50 */
51#define IOCTL_EVTCHN_BIND_INTERDOMAIN \
52 _IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain))
53struct ioctl_evtchn_bind_interdomain {
54 unsigned int remote_domain, remote_port;
55};
56
57/*
58 * Allocate a fresh port for binding to @remote_domain.
59 * Return allocated port.
60 */
61#define IOCTL_EVTCHN_BIND_UNBOUND_PORT \
62 _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port))
63struct ioctl_evtchn_bind_unbound_port {
64 unsigned int remote_domain;
65};
66
67/*
68 * Unbind previously allocated @port.
69 */
70#define IOCTL_EVTCHN_UNBIND \
71 _IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind))
72struct ioctl_evtchn_unbind {
73 unsigned int port;
74};
75
76/*
77 * Unbind previously allocated @port.
78 */
79#define IOCTL_EVTCHN_NOTIFY \
80 _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify))
81struct ioctl_evtchn_notify {
82 unsigned int port;
83};
84
85/* Clear and reinitialise the event buffer. Clear error condition. */
86#define IOCTL_EVTCHN_RESET \
87 _IOC(_IOC_NONE, 'E', 5, 0)
88
89/*
90 * Restrict this file descriptor so that it can only be used to bind
91 * new interdomain events from one domain.
92 *
93 * Once a file descriptor has been restricted it cannot be
94 * de-restricted, and must be closed and re-opened. Event channels
95 * which were bound before restricting remain bound afterwards, and
96 * can be notified as usual.
97 */
98#define IOCTL_EVTCHN_RESTRICT_DOMID \
99 _IOC(_IOC_NONE, 'E', 6, sizeof(struct ioctl_evtchn_restrict_domid))
100struct ioctl_evtchn_restrict_domid {
101 domid_t domid;
102};
103
104#endif /* __LINUX_PUBLIC_EVTCHN_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/xen/gntalloc.h deleted-84
...@@ -1,84 +0,0 @@
1/******************************************************************************
2 * gntalloc.h
3 *
4 * Interface to /dev/xen/gntalloc.
5 *
6 * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
7 *
8 * This file is in the public domain.
9 */
10
11#ifndef __LINUX_PUBLIC_GNTALLOC_H__
12#define __LINUX_PUBLIC_GNTALLOC_H__
13
14#include <linux/types.h>
15
16/*
17 * Allocates a new page and creates a new grant reference.
18 */
19#define IOCTL_GNTALLOC_ALLOC_GREF \
20_IOC(_IOC_NONE, 'G', 5, sizeof(struct ioctl_gntalloc_alloc_gref))
21struct ioctl_gntalloc_alloc_gref {
22 /* IN parameters */
23 /* The ID of the domain to be given access to the grants. */
24 __u16 domid;
25 /* Flags for this mapping */
26 __u16 flags;
27 /* Number of pages to map */
28 __u32 count;
29 /* OUT parameters */
30 /* The offset to be used on a subsequent call to mmap(). */
31 __u64 index;
32 /* The grant references of the newly created grant, one per page */
33 /* Variable size, depending on count */
34 __u32 gref_ids[1];
35};
36
37#define GNTALLOC_FLAG_WRITABLE 1
38
39/*
40 * Deallocates the grant reference, allowing the associated page to be freed if
41 * no other domains are using it.
42 */
43#define IOCTL_GNTALLOC_DEALLOC_GREF \
44_IOC(_IOC_NONE, 'G', 6, sizeof(struct ioctl_gntalloc_dealloc_gref))
45struct ioctl_gntalloc_dealloc_gref {
46 /* IN parameters */
47 /* The offset returned in the map operation */
48 __u64 index;
49 /* Number of references to unmap */
50 __u32 count;
51};
52
53/*
54 * Sets up an unmap notification within the page, so that the other side can do
55 * cleanup if this side crashes. Required to implement cross-domain robust
56 * mutexes or close notification on communication channels.
57 *
58 * Each mapped page only supports one notification; multiple calls referring to
59 * the same page overwrite the previous notification. You must clear the
60 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
61 * to occur.
62 */
63#define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \
64_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify))
65struct ioctl_gntalloc_unmap_notify {
66 /* IN parameters */
67 /* Offset in the file descriptor for a byte within the page (same as
68 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
69 * be cleared. Otherwise, it can be any byte in the page whose
70 * notification we are adjusting.
71 */
72 __u64 index;
73 /* Action(s) to take on unmap */
74 __u32 action;
75 /* Event channel to notify */
76 __u32 event_channel_port;
77};
78
79/* Clear (set to zero) the byte specified by index */
80#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
81/* Send an interrupt on the indicated event channel */
82#define UNMAP_NOTIFY_SEND_EVENT 0x2
83
84#endif /* __LINUX_PUBLIC_GNTALLOC_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/xen/gntdev.h deleted-309
...@@ -1,309 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
2/******************************************************************************
3 * gntdev.h
4 *
5 * Interface to /dev/xen/gntdev.
6 *
7 * Copyright (c) 2007, D G Murray
8 * Copyright (c) 2018, Oleksandr Andrushchenko, EPAM Systems Inc.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation; or, when distributed
13 * separately from the Linux kernel or incorporated into other
14 * software packages, subject to the following license:
15 *
16 * Permission is hereby granted, free of charge, to any person obtaining a copy
17 * of this source file (the "Software"), to deal in the Software without
18 * restriction, including without limitation the rights to use, copy, modify,
19 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
20 * and to permit persons to whom the Software is furnished to do so, subject to
21 * the following conditions:
22 *
23 * The above copyright notice and this permission notice shall be included in
24 * all copies or substantial portions of the Software.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
31 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
32 * IN THE SOFTWARE.
33 */
34
35#ifndef __LINUX_PUBLIC_GNTDEV_H__
36#define __LINUX_PUBLIC_GNTDEV_H__
37
38#include <linux/types.h>
39
40struct ioctl_gntdev_grant_ref {
41 /* The domain ID of the grant to be mapped. */
42 __u32 domid;
43 /* The grant reference of the grant to be mapped. */
44 __u32 ref;
45};
46
47/*
48 * Inserts the grant references into the mapping table of an instance
49 * of gntdev. N.B. This does not perform the mapping, which is deferred
50 * until mmap() is called with @index as the offset.
51 */
52#define IOCTL_GNTDEV_MAP_GRANT_REF \
53_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
54struct ioctl_gntdev_map_grant_ref {
55 /* IN parameters */
56 /* The number of grants to be mapped. */
57 __u32 count;
58 __u32 pad;
59 /* OUT parameters */
60 /* The offset to be used on a subsequent call to mmap(). */
61 __u64 index;
62 /* Variable IN parameter. */
63 /* Array of grant references, of size @count. */
64 struct ioctl_gntdev_grant_ref refs[1];
65};
66
67/*
68 * Removes the grant references from the mapping table of an instance of
69 * of gntdev. N.B. munmap() must be called on the relevant virtual address(es)
70 * before this ioctl is called, or an error will result.
71 */
72#define IOCTL_GNTDEV_UNMAP_GRANT_REF \
73_IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))
74struct ioctl_gntdev_unmap_grant_ref {
75 /* IN parameters */
76 /* The offset was returned by the corresponding map operation. */
77 __u64 index;
78 /* The number of pages to be unmapped. */
79 __u32 count;
80 __u32 pad;
81};
82
83/*
84 * Returns the offset in the driver's address space that corresponds
85 * to @vaddr. This can be used to perform a munmap(), followed by an
86 * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by
87 * the caller. The number of pages that were allocated at the same time as
88 * @vaddr is returned in @count.
89 *
90 * N.B. Where more than one page has been mapped into a contiguous range, the
91 * supplied @vaddr must correspond to the start of the range; otherwise
92 * an error will result. It is only possible to munmap() the entire
93 * contiguously-allocated range at once, and not any subrange thereof.
94 */
95#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \
96_IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
97struct ioctl_gntdev_get_offset_for_vaddr {
98 /* IN parameters */
99 /* The virtual address of the first mapped page in a range. */
100 __u64 vaddr;
101 /* OUT parameters */
102 /* The offset that was used in the initial mmap() operation. */
103 __u64 offset;
104 /* The number of pages mapped in the VM area that begins at @vaddr. */
105 __u32 count;
106 __u32 pad;
107};
108
109/*
110 * Sets the maximum number of grants that may mapped at once by this gntdev
111 * instance.
112 *
113 * N.B. This must be called before any other ioctl is performed on the device.
114 */
115#define IOCTL_GNTDEV_SET_MAX_GRANTS \
116_IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants))
117struct ioctl_gntdev_set_max_grants {
118 /* IN parameter */
119 /* The maximum number of grants that may be mapped at once. */
120 __u32 count;
121};
122
123/*
124 * Sets up an unmap notification within the page, so that the other side can do
125 * cleanup if this side crashes. Required to implement cross-domain robust
126 * mutexes or close notification on communication channels.
127 *
128 * Each mapped page only supports one notification; multiple calls referring to
129 * the same page overwrite the previous notification. You must clear the
130 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
131 * to occur.
132 */
133#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \
134_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
135struct ioctl_gntdev_unmap_notify {
136 /* IN parameters */
137 /* Offset in the file descriptor for a byte within the page (same as
138 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
139 * be cleared. Otherwise, it can be any byte in the page whose
140 * notification we are adjusting.
141 */
142 __u64 index;
143 /* Action(s) to take on unmap */
144 __u32 action;
145 /* Event channel to notify */
146 __u32 event_channel_port;
147};
148
149struct gntdev_grant_copy_segment {
150 union {
151 void *virt;
152 struct {
153 grant_ref_t ref;
154 __u16 offset;
155 domid_t domid;
156 } foreign;
157 } source, dest;
158 __u16 len;
159
160 __u16 flags; /* GNTCOPY_* */
161 __s16 status; /* GNTST_* */
162};
163
164/*
165 * Copy between grant references and local buffers.
166 *
167 * The copy is split into @count @segments, each of which can copy
168 * to/from one grant reference.
169 *
170 * Each segment is similar to struct gnttab_copy in the hypervisor ABI
171 * except the local buffer is specified using a virtual address
172 * (instead of a GFN and offset).
173 *
174 * The local buffer may cross a Xen page boundary -- the driver will
175 * split segments into multiple ops if required.
176 *
177 * Returns 0 if all segments have been processed and @status in each
178 * segment is valid. Note that one or more segments may have failed
179 * (status != GNTST_okay).
180 *
181 * If the driver had to split a segment into two or more ops, @status
182 * includes the status of the first failed op for that segment (or
183 * GNTST_okay if all ops were successful).
184 *
185 * If -1 is returned, the status of all segments is undefined.
186 *
187 * EINVAL: A segment has local buffers for both source and
188 * destination.
189 * EINVAL: A segment crosses the boundary of a foreign page.
190 * EFAULT: A segment's local buffer is not accessible.
191 */
192#define IOCTL_GNTDEV_GRANT_COPY \
193 _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
194struct ioctl_gntdev_grant_copy {
195 unsigned int count;
196 struct gntdev_grant_copy_segment *segments;
197};
198
199/* Clear (set to zero) the byte specified by index */
200#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
201/* Send an interrupt on the indicated event channel */
202#define UNMAP_NOTIFY_SEND_EVENT 0x2
203
204/*
205 * Flags to be used while requesting memory mapping's backing storage
206 * to be allocated with DMA API.
207 */
208
209/*
210 * The buffer is backed with memory allocated with dma_alloc_wc.
211 */
212#define GNTDEV_DMA_FLAG_WC (1 << 0)
213
214/*
215 * The buffer is backed with memory allocated with dma_alloc_coherent.
216 */
217#define GNTDEV_DMA_FLAG_COHERENT (1 << 1)
218
219/*
220 * Create a dma-buf [1] from grant references @refs of count @count provided
221 * by the foreign domain @domid with flags @flags.
222 *
223 * By default dma-buf is backed by system memory pages, but by providing
224 * one of the GNTDEV_DMA_FLAG_XXX flags it can also be created as
225 * a DMA write-combine or coherent buffer, e.g. allocated with dma_alloc_wc/
226 * dma_alloc_coherent.
227 *
228 * Returns 0 if dma-buf was successfully created and the corresponding
229 * dma-buf's file descriptor is returned in @fd.
230 *
231 * [1] Documentation/driver-api/dma-buf.rst
232 */
233
234#define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS \
235 _IOC(_IOC_NONE, 'G', 9, \
236 sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs))
237struct ioctl_gntdev_dmabuf_exp_from_refs {
238 /* IN parameters. */
239 /* Specific options for this dma-buf: see GNTDEV_DMA_FLAG_XXX. */
240 __u32 flags;
241 /* Number of grant references in @refs array. */
242 __u32 count;
243 /* OUT parameters. */
244 /* File descriptor of the dma-buf. */
245 __u32 fd;
246 /* The domain ID of the grant references to be mapped. */
247 __u32 domid;
248 /* Variable IN parameter. */
249 /* Array of grant references of size @count. */
250 __u32 refs[1];
251};
252
253/*
254 * This will block until the dma-buf with the file descriptor @fd is
255 * released. This is only valid for buffers created with
256 * IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS.
257 *
258 * If within @wait_to_ms milliseconds the buffer is not released
259 * then -ETIMEDOUT error is returned.
260 * If the buffer with the file descriptor @fd does not exist or has already
261 * been released, then -ENOENT is returned. For valid file descriptors
262 * this must not be treated as error.
263 */
264#define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED \
265 _IOC(_IOC_NONE, 'G', 10, \
266 sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released))
267struct ioctl_gntdev_dmabuf_exp_wait_released {
268 /* IN parameters */
269 __u32 fd;
270 __u32 wait_to_ms;
271};
272
273/*
274 * Import a dma-buf with file descriptor @fd and export granted references
275 * to the pages of that dma-buf into array @refs of size @count.
276 */
277#define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS \
278 _IOC(_IOC_NONE, 'G', 11, \
279 sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs))
280struct ioctl_gntdev_dmabuf_imp_to_refs {
281 /* IN parameters. */
282 /* File descriptor of the dma-buf. */
283 __u32 fd;
284 /* Number of grant references in @refs array. */
285 __u32 count;
286 /* The domain ID for which references to be granted. */
287 __u32 domid;
288 /* Reserved - must be zero. */
289 __u32 reserved;
290 /* OUT parameters. */
291 /* Array of grant references of size @count. */
292 __u32 refs[1];
293};
294
295/*
296 * This will close all references to the imported buffer with file descriptor
297 * @fd, so it can be released by the owner. This is only valid for buffers
298 * created with IOCTL_GNTDEV_DMABUF_IMP_TO_REFS.
299 */
300#define IOCTL_GNTDEV_DMABUF_IMP_RELEASE \
301 _IOC(_IOC_NONE, 'G', 12, \
302 sizeof(struct ioctl_gntdev_dmabuf_imp_release))
303struct ioctl_gntdev_dmabuf_imp_release {
304 /* IN parameters */
305 __u32 fd;
306 __u32 reserved;
307};
308
309#endif /* __LINUX_PUBLIC_GNTDEV_H__ */
\ No newline at end of file
lib/libc/include/generic-musl/xen/privcmd.h deleted-129
...@@ -1,129 +0,0 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
2/******************************************************************************
3 * privcmd.h
4 *
5 * Interface to /proc/xen/privcmd.
6 *
7 * Copyright (c) 2003-2005, K A Fraser
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef __LINUX_PUBLIC_PRIVCMD_H__
35#define __LINUX_PUBLIC_PRIVCMD_H__
36
37#include <linux/types.h>
38
39#include <xen/interface/xen.h>
40
41struct privcmd_hypercall {
42 __u64 op;
43 __u64 arg[5];
44};
45
46struct privcmd_mmap_entry {
47 __u64 va;
48 /*
49 * This should be a GFN. It's not possible to change the name because
50 * it's exposed to the user-space.
51 */
52 __u64 mfn;
53 __u64 npages;
54};
55
56struct privcmd_mmap {
57 int num;
58 domid_t dom; /* target domain */
59 struct privcmd_mmap_entry *entry;
60};
61
62struct privcmd_mmapbatch {
63 int num; /* number of pages to populate */
64 domid_t dom; /* target domain */
65 __u64 addr; /* virtual address */
66 xen_pfn_t *arr; /* array of mfns - or'd with
67 PRIVCMD_MMAPBATCH_*_ERROR on err */
68};
69
70#define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U
71#define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U
72
73struct privcmd_mmapbatch_v2 {
74 unsigned int num; /* number of pages to populate */
75 domid_t dom; /* target domain */
76 __u64 addr; /* virtual address */
77 const xen_pfn_t *arr; /* array of mfns */
78 int *err; /* array of error codes */
79};
80
81struct privcmd_dm_op_buf {
82 void *uptr;
83 size_t size;
84};
85
86struct privcmd_dm_op {
87 domid_t dom;
88 __u16 num;
89 const struct privcmd_dm_op_buf *ubufs;
90};
91
92struct privcmd_mmap_resource {
93 domid_t dom;
94 __u32 type;
95 __u32 id;
96 __u32 idx;
97 __u64 num;
98 __u64 addr;
99};
100
101/*
102 * @cmd: IOCTL_PRIVCMD_HYPERCALL
103 * @arg: &privcmd_hypercall_t
104 * Return: Value returned from execution of the specified hypercall.
105 *
106 * @cmd: IOCTL_PRIVCMD_MMAPBATCH_V2
107 * @arg: &struct privcmd_mmapbatch_v2
108 * Return: 0 on success (i.e., arg->err contains valid error codes for
109 * each frame). On an error other than a failed frame remap, -1 is
110 * returned and errno is set to EINVAL, EFAULT etc. As an exception,
111 * if the operation was otherwise successful but any frame failed with
112 * -ENOENT, then -1 is returned and errno is set to ENOENT.
113 */
114#define IOCTL_PRIVCMD_HYPERCALL \
115 _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
116#define IOCTL_PRIVCMD_MMAP \
117 _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
118#define IOCTL_PRIVCMD_MMAPBATCH \
119 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
120#define IOCTL_PRIVCMD_MMAPBATCH_V2 \
121 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
122#define IOCTL_PRIVCMD_DM_OP \
123 _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
124#define IOCTL_PRIVCMD_RESTRICT \
125 _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
126#define IOCTL_PRIVCMD_MMAP_RESOURCE \
127 _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
128
129#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
\ No newline at end of file
lib/libc/include/i386-linux-musl/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 32
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/i386-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for i686-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/alltypes.h deleted-433
...@@ -1,433 +0,0 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg int
4
5#if __GNUC__ >= 3
6#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
7typedef __builtin_va_list va_list;
8#define __DEFINED_va_list
9#endif
10
11#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
12typedef __builtin_va_list __isoc_va_list;
13#define __DEFINED___isoc_va_list
14#endif
15
16#else
17#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
18typedef struct __va_list * va_list;
19#define __DEFINED_va_list
20#endif
21
22#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
23typedef struct __va_list * __isoc_va_list;
24#define __DEFINED___isoc_va_list
25#endif
26
27#endif
28
29#ifndef __cplusplus
30#ifdef __WCHAR_TYPE__
31#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
32typedef __WCHAR_TYPE__ wchar_t;
33#define __DEFINED_wchar_t
34#endif
35
36#else
37#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
38typedef long wchar_t;
39#define __DEFINED_wchar_t
40#endif
41
42#endif
43#endif
44
45#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0
46#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
47typedef float float_t;
48#define __DEFINED_float_t
49#endif
50
51#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
52typedef double double_t;
53#define __DEFINED_double_t
54#endif
55
56#else
57#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
58typedef long double float_t;
59#define __DEFINED_float_t
60#endif
61
62#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
63typedef long double double_t;
64#define __DEFINED_double_t
65#endif
66
67#endif
68
69#if !defined(__cplusplus)
70#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
71typedef struct { _Alignas(8) long long __ll; long double __ld; } max_align_t;
72#define __DEFINED_max_align_t
73#endif
74
75#elif defined(__GNUC__)
76#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
77typedef struct { __attribute__((__aligned__(8))) long long __ll; long double __ld; } max_align_t;
78#define __DEFINED_max_align_t
79#endif
80
81#else
82#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
83typedef struct { alignas(8) long long __ll; long double __ld; } max_align_t;
84#define __DEFINED_max_align_t
85#endif
86
87#endif
88
89#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
90typedef long time_t;
91#define __DEFINED_time_t
92#endif
93
94#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
95typedef long suseconds_t;
96#define __DEFINED_suseconds_t
97#endif
98
99
100#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
101typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
102#define __DEFINED_pthread_attr_t
103#endif
104
105#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
106typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
107#define __DEFINED_pthread_mutex_t
108#endif
109
110#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
111typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
112#define __DEFINED_mtx_t
113#endif
114
115#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
116typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
117#define __DEFINED_pthread_cond_t
118#endif
119
120#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
121typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
122#define __DEFINED_cnd_t
123#endif
124
125#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
126typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
127#define __DEFINED_pthread_rwlock_t
128#endif
129
130#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
131typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
132#define __DEFINED_pthread_barrier_t
133#endif
134
135#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
136typedef unsigned _Addr size_t;
137#define __DEFINED_size_t
138#endif
139
140#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
141typedef unsigned _Addr uintptr_t;
142#define __DEFINED_uintptr_t
143#endif
144
145#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
146typedef _Addr ptrdiff_t;
147#define __DEFINED_ptrdiff_t
148#endif
149
150#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
151typedef _Addr ssize_t;
152#define __DEFINED_ssize_t
153#endif
154
155#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
156typedef _Addr intptr_t;
157#define __DEFINED_intptr_t
158#endif
159
160#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
161typedef _Addr regoff_t;
162#define __DEFINED_regoff_t
163#endif
164
165#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
166typedef _Reg register_t;
167#define __DEFINED_register_t
168#endif
169
170
171#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
172typedef signed char int8_t;
173#define __DEFINED_int8_t
174#endif
175
176#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
177typedef signed short int16_t;
178#define __DEFINED_int16_t
179#endif
180
181#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
182typedef signed int int32_t;
183#define __DEFINED_int32_t
184#endif
185
186#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
187typedef signed _Int64 int64_t;
188#define __DEFINED_int64_t
189#endif
190
191#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
192typedef signed _Int64 intmax_t;
193#define __DEFINED_intmax_t
194#endif
195
196#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
197typedef unsigned char uint8_t;
198#define __DEFINED_uint8_t
199#endif
200
201#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
202typedef unsigned short uint16_t;
203#define __DEFINED_uint16_t
204#endif
205
206#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
207typedef unsigned int uint32_t;
208#define __DEFINED_uint32_t
209#endif
210
211#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
212typedef unsigned _Int64 uint64_t;
213#define __DEFINED_uint64_t
214#endif
215
216#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
217typedef unsigned _Int64 u_int64_t;
218#define __DEFINED_u_int64_t
219#endif
220
221#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
222typedef unsigned _Int64 uintmax_t;
223#define __DEFINED_uintmax_t
224#endif
225
226
227#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
228typedef unsigned mode_t;
229#define __DEFINED_mode_t
230#endif
231
232#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
233typedef unsigned _Reg nlink_t;
234#define __DEFINED_nlink_t
235#endif
236
237#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
238typedef _Int64 off_t;
239#define __DEFINED_off_t
240#endif
241
242#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
243typedef unsigned _Int64 ino_t;
244#define __DEFINED_ino_t
245#endif
246
247#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
248typedef unsigned _Int64 dev_t;
249#define __DEFINED_dev_t
250#endif
251
252#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
253typedef long blksize_t;
254#define __DEFINED_blksize_t
255#endif
256
257#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
258typedef _Int64 blkcnt_t;
259#define __DEFINED_blkcnt_t
260#endif
261
262#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
263typedef unsigned _Int64 fsblkcnt_t;
264#define __DEFINED_fsblkcnt_t
265#endif
266
267#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
268typedef unsigned _Int64 fsfilcnt_t;
269#define __DEFINED_fsfilcnt_t
270#endif
271
272
273#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
274typedef unsigned wint_t;
275#define __DEFINED_wint_t
276#endif
277
278#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
279typedef unsigned long wctype_t;
280#define __DEFINED_wctype_t
281#endif
282
283
284#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
285typedef void * timer_t;
286#define __DEFINED_timer_t
287#endif
288
289#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
290typedef int clockid_t;
291#define __DEFINED_clockid_t
292#endif
293
294#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
295typedef long clock_t;
296#define __DEFINED_clock_t
297#endif
298
299#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
300struct timeval { time_t tv_sec; suseconds_t tv_usec; };
301#define __DEFINED_struct_timeval
302#endif
303
304#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
305struct timespec { time_t tv_sec; long tv_nsec; };
306#define __DEFINED_struct_timespec
307#endif
308
309
310#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
311typedef int pid_t;
312#define __DEFINED_pid_t
313#endif
314
315#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
316typedef unsigned id_t;
317#define __DEFINED_id_t
318#endif
319
320#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
321typedef unsigned uid_t;
322#define __DEFINED_uid_t
323#endif
324
325#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
326typedef unsigned gid_t;
327#define __DEFINED_gid_t
328#endif
329
330#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
331typedef int key_t;
332#define __DEFINED_key_t
333#endif
334
335#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
336typedef unsigned useconds_t;
337#define __DEFINED_useconds_t
338#endif
339
340
341#ifdef __cplusplus
342#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
343typedef unsigned long pthread_t;
344#define __DEFINED_pthread_t
345#endif
346
347#else
348#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
349typedef struct __pthread * pthread_t;
350#define __DEFINED_pthread_t
351#endif
352
353#endif
354#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
355typedef int pthread_once_t;
356#define __DEFINED_pthread_once_t
357#endif
358
359#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
360typedef unsigned pthread_key_t;
361#define __DEFINED_pthread_key_t
362#endif
363
364#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
365typedef int pthread_spinlock_t;
366#define __DEFINED_pthread_spinlock_t
367#endif
368
369#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
370typedef struct { unsigned __attr; } pthread_mutexattr_t;
371#define __DEFINED_pthread_mutexattr_t
372#endif
373
374#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
375typedef struct { unsigned __attr; } pthread_condattr_t;
376#define __DEFINED_pthread_condattr_t
377#endif
378
379#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
380typedef struct { unsigned __attr; } pthread_barrierattr_t;
381#define __DEFINED_pthread_barrierattr_t
382#endif
383
384#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
385typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
386#define __DEFINED_pthread_rwlockattr_t
387#endif
388
389
390#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
391typedef struct _IO_FILE FILE;
392#define __DEFINED_FILE
393#endif
394
395
396#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
397typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
398#define __DEFINED_mbstate_t
399#endif
400
401
402#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
403typedef struct __locale_struct * locale_t;
404#define __DEFINED_locale_t
405#endif
406
407
408#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
409typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
410#define __DEFINED_sigset_t
411#endif
412
413
414#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
415struct iovec { void *iov_base; size_t iov_len; };
416#define __DEFINED_struct_iovec
417#endif
418
419
420#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
421typedef unsigned socklen_t;
422#define __DEFINED_socklen_t
423#endif
424
425#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
426typedef unsigned short sa_family_t;
427#define __DEFINED_sa_family_t
428#endif
429
430
431#undef _Addr
432#undef _Int64
433#undef _Reg
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/endian.h deleted-1
...@@ -1 +0,0 @@
1#define __BYTE_ORDER __LITTLE_ENDIAN
\ No newline at end of file
lib/libc/include/i386-linux-musl/bits/syscall.h deleted-771
...@@ -1,771 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
78#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86old 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_vm86 166
168#define __NR_query_module 167
169#define __NR_poll 168
170#define __NR_nfsservctl 169
171#define __NR_setresgid 170
172#define __NR_getresgid 171
173#define __NR_prctl 172
174#define __NR_rt_sigreturn 173
175#define __NR_rt_sigaction 174
176#define __NR_rt_sigprocmask 175
177#define __NR_rt_sigpending 176
178#define __NR_rt_sigtimedwait 177
179#define __NR_rt_sigqueueinfo 178
180#define __NR_rt_sigsuspend 179
181#define __NR_pread64 180
182#define __NR_pwrite64 181
183#define __NR_chown 182
184#define __NR_getcwd 183
185#define __NR_capget 184
186#define __NR_capset 185
187#define __NR_sigaltstack 186
188#define __NR_sendfile 187
189#define __NR_getpmsg 188
190#define __NR_putpmsg 189
191#define __NR_vfork 190
192#define __NR_ugetrlimit 191
193#define __NR_mmap2 192
194#define __NR_truncate64 193
195#define __NR_ftruncate64 194
196#define __NR_stat64 195
197#define __NR_lstat64 196
198#define __NR_fstat64 197
199#define __NR_lchown32 198
200#define __NR_getuid32 199
201#define __NR_getgid32 200
202#define __NR_geteuid32 201
203#define __NR_getegid32 202
204#define __NR_setreuid32 203
205#define __NR_setregid32 204
206#define __NR_getgroups32 205
207#define __NR_setgroups32 206
208#define __NR_fchown32 207
209#define __NR_setresuid32 208
210#define __NR_getresuid32 209
211#define __NR_setresgid32 210
212#define __NR_getresgid32 211
213#define __NR_chown32 212
214#define __NR_setuid32 213
215#define __NR_setgid32 214
216#define __NR_setfsuid32 215
217#define __NR_setfsgid32 216
218#define __NR_pivot_root 217
219#define __NR_mincore 218
220#define __NR_madvise 219
221#define __NR_getdents64 220
222#define __NR_fcntl64 221
223/* 223 is unused */
224#define __NR_gettid 224
225#define __NR_readahead 225
226#define __NR_setxattr 226
227#define __NR_lsetxattr 227
228#define __NR_fsetxattr 228
229#define __NR_getxattr 229
230#define __NR_lgetxattr 230
231#define __NR_fgetxattr 231
232#define __NR_listxattr 232
233#define __NR_llistxattr 233
234#define __NR_flistxattr 234
235#define __NR_removexattr 235
236#define __NR_lremovexattr 236
237#define __NR_fremovexattr 237
238#define __NR_tkill 238
239#define __NR_sendfile64 239
240#define __NR_futex 240
241#define __NR_sched_setaffinity 241
242#define __NR_sched_getaffinity 242
243#define __NR_set_thread_area 243
244#define __NR_get_thread_area 244
245#define __NR_io_setup 245
246#define __NR_io_destroy 246
247#define __NR_io_getevents 247
248#define __NR_io_submit 248
249#define __NR_io_cancel 249
250#define __NR_fadvise64 250
251/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
252#define __NR_exit_group 252
253#define __NR_lookup_dcookie 253
254#define __NR_epoll_create 254
255#define __NR_epoll_ctl 255
256#define __NR_epoll_wait 256
257#define __NR_remap_file_pages 257
258#define __NR_set_tid_address 258
259#define __NR_timer_create 259
260#define __NR_timer_settime (__NR_timer_create+1)
261#define __NR_timer_gettime (__NR_timer_create+2)
262#define __NR_timer_getoverrun (__NR_timer_create+3)
263#define __NR_timer_delete (__NR_timer_create+4)
264#define __NR_clock_settime (__NR_timer_create+5)
265#define __NR_clock_gettime (__NR_timer_create+6)
266#define __NR_clock_getres (__NR_timer_create+7)
267#define __NR_clock_nanosleep (__NR_timer_create+8)
268#define __NR_statfs64 268
269#define __NR_fstatfs64 269
270#define __NR_tgkill 270
271#define __NR_utimes 271
272#define __NR_fadvise64_64 272
273#define __NR_vserver 273
274#define __NR_mbind 274
275#define __NR_get_mempolicy 275
276#define __NR_set_mempolicy 276
277#define __NR_mq_open 277
278#define __NR_mq_unlink (__NR_mq_open+1)
279#define __NR_mq_timedsend (__NR_mq_open+2)
280#define __NR_mq_timedreceive (__NR_mq_open+3)
281#define __NR_mq_notify (__NR_mq_open+4)
282#define __NR_mq_getsetattr (__NR_mq_open+5)
283#define __NR_kexec_load 283
284#define __NR_waitid 284
285/* #define __NR_sys_setaltroot 285 */
286#define __NR_add_key 286
287#define __NR_request_key 287
288#define __NR_keyctl 288
289#define __NR_ioprio_set 289
290#define __NR_ioprio_get 290
291#define __NR_inotify_init 291
292#define __NR_inotify_add_watch 292
293#define __NR_inotify_rm_watch 293
294#define __NR_migrate_pages 294
295#define __NR_openat 295
296#define __NR_mkdirat 296
297#define __NR_mknodat 297
298#define __NR_fchownat 298
299#define __NR_futimesat 299
300#define __NR_fstatat64 300
301#define __NR_unlinkat 301
302#define __NR_renameat 302
303#define __NR_linkat 303
304#define __NR_symlinkat 304
305#define __NR_readlinkat 305
306#define __NR_fchmodat 306
307#define __NR_faccessat 307
308#define __NR_pselect6 308
309#define __NR_ppoll 309
310#define __NR_unshare 310
311#define __NR_set_robust_list 311
312#define __NR_get_robust_list 312
313#define __NR_splice 313
314#define __NR_sync_file_range 314
315#define __NR_tee 315
316#define __NR_vmsplice 316
317#define __NR_move_pages 317
318#define __NR_getcpu 318
319#define __NR_epoll_pwait 319
320#define __NR_utimensat 320
321#define __NR_signalfd 321
322#define __NR_timerfd_create 322
323#define __NR_eventfd 323
324#define __NR_fallocate 324
325#define __NR_timerfd_settime 325
326#define __NR_timerfd_gettime 326
327#define __NR_signalfd4 327
328#define __NR_eventfd2 328
329#define __NR_epoll_create1 329
330#define __NR_dup3 330
331#define __NR_pipe2 331
332#define __NR_inotify_init1 332
333#define __NR_preadv 333
334#define __NR_pwritev 334
335#define __NR_rt_tgsigqueueinfo 335
336#define __NR_perf_event_open 336
337#define __NR_recvmmsg 337
338#define __NR_fanotify_init 338
339#define __NR_fanotify_mark 339
340#define __NR_prlimit64 340
341#define __NR_name_to_handle_at 341
342#define __NR_open_by_handle_at 342
343#define __NR_clock_adjtime 343
344#define __NR_syncfs 344
345#define __NR_sendmmsg 345
346#define __NR_setns 346
347#define __NR_process_vm_readv 347
348#define __NR_process_vm_writev 348
349#define __NR_kcmp 349
350#define __NR_finit_module 350
351#define __NR_sched_setattr 351
352#define __NR_sched_getattr 352
353#define __NR_renameat2 353
354#define __NR_seccomp 354
355#define __NR_getrandom 355
356#define __NR_memfd_create 356
357#define __NR_bpf 357
358#define __NR_execveat 358
359#define __NR_socket 359
360#define __NR_socketpair 360
361#define __NR_bind 361
362#define __NR_connect 362
363#define __NR_listen 363
364#define __NR_accept4 364
365#define __NR_getsockopt 365
366#define __NR_setsockopt 366
367#define __NR_getsockname 367
368#define __NR_getpeername 368
369#define __NR_sendto 369
370#define __NR_sendmsg 370
371#define __NR_recvfrom 371
372#define __NR_recvmsg 372
373#define __NR_shutdown 373
374#define __NR_userfaultfd 374
375#define __NR_membarrier 375
376#define __NR_mlock2 376
377#define __NR_copy_file_range 377
378#define __NR_preadv2 378
379#define __NR_pwritev2 379
380#define __NR_pkey_mprotect 380
381#define __NR_pkey_alloc 381
382#define __NR_pkey_free 382
383#define __NR_statx 383
384#define __NR_arch_prctl 384
385#define __NR_io_pgetevents 385
386#define __NR_rseq 386
387
388#define SYS_restart_syscall 0
389#define SYS_exit 1
390#define SYS_fork 2
391#define SYS_read 3
392#define SYS_write 4
393#define SYS_open 5
394#define SYS_close 6
395#define SYS_waitpid 7
396#define SYS_creat 8
397#define SYS_link 9
398#define SYS_unlink 10
399#define SYS_execve 11
400#define SYS_chdir 12
401#define SYS_time 13
402#define SYS_mknod 14
403#define SYS_chmod 15
404#define SYS_lchown 16
405#define SYS_break 17
406#define SYS_oldstat 18
407#define SYS_lseek 19
408#define SYS_getpid 20
409#define SYS_mount 21
410#define SYS_umount 22
411#define SYS_setuid 23
412#define SYS_getuid 24
413#define SYS_stime 25
414#define SYS_ptrace 26
415#define SYS_alarm 27
416#define SYS_oldfstat 28
417#define SYS_pause 29
418#define SYS_utime 30
419#define SYS_stty 31
420#define SYS_gtty 32
421#define SYS_access 33
422#define SYS_nice 34
423#define SYS_ftime 35
424#define SYS_sync 36
425#define SYS_kill 37
426#define SYS_rename 38
427#define SYS_mkdir 39
428#define SYS_rmdir 40
429#define SYS_dup 41
430#define SYS_pipe 42
431#define SYS_times 43
432#define SYS_prof 44
433#define SYS_brk 45
434#define SYS_setgid 46
435#define SYS_getgid 47
436#define SYS_signal 48
437#define SYS_geteuid 49
438#define SYS_getegid 50
439#define SYS_acct 51
440#define SYS_umount2 52
441#define SYS_lock 53
442#define SYS_ioctl 54
443#define SYS_fcntl 55
444#define SYS_mpx 56
445#define SYS_setpgid 57
446#define SYS_ulimit 58
447#define SYS_oldolduname 59
448#define SYS_umask 60
449#define SYS_chroot 61
450#define SYS_ustat 62
451#define SYS_dup2 63
452#define SYS_getppid 64
453#define SYS_getpgrp 65
454#define SYS_setsid 66
455#define SYS_sigaction 67
456#define SYS_sgetmask 68
457#define SYS_ssetmask 69
458#define SYS_setreuid 70
459#define SYS_setregid 71
460#define SYS_sigsuspend 72
461#define SYS_sigpending 73
462#define SYS_sethostname 74
463#define SYS_setrlimit 75
464#define SYS_getrlimit 76 /* Back compatible 2Gig limited rlimit */
465#define SYS_getrusage 77
466#define SYS_gettimeofday 78
467#define SYS_settimeofday 79
468#define SYS_getgroups 80
469#define SYS_setgroups 81
470#define SYS_select 82
471#define SYS_symlink 83
472#define SYS_oldlstat 84
473#define SYS_readlink 85
474#define SYS_uselib 86
475#define SYS_swapon 87
476#define SYS_reboot 88
477#define SYS_readdir 89
478#define SYS_mmap 90
479#define SYS_munmap 91
480#define SYS_truncate 92
481#define SYS_ftruncate 93
482#define SYS_fchmod 94
483#define SYS_fchown 95
484#define SYS_getpriority 96
485#define SYS_setpriority 97
486#define SYS_profil 98
487#define SYS_statfs 99
488#define SYS_fstatfs 100
489#define SYS_ioperm 101
490#define SYS_socketcall 102
491#define SYS_syslog 103
492#define SYS_setitimer 104
493#define SYS_getitimer 105
494#define SYS_stat 106
495#define SYS_lstat 107
496#define SYS_fstat 108
497#define SYS_olduname 109
498#define SYS_iopl 110
499#define SYS_vhangup 111
500#define SYS_idle 112
501#define SYS_vm86old 113
502#define SYS_wait4 114
503#define SYS_swapoff 115
504#define SYS_sysinfo 116
505#define SYS_ipc 117
506#define SYS_fsync 118
507#define SYS_sigreturn 119
508#define SYS_clone 120
509#define SYS_setdomainname 121
510#define SYS_uname 122
511#define SYS_modify_ldt 123
512#define SYS_adjtimex 124
513#define SYS_mprotect 125
514#define SYS_sigprocmask 126
515#define SYS_create_module 127
516#define SYS_init_module 128
517#define SYS_delete_module 129
518#define SYS_get_kernel_syms 130
519#define SYS_quotactl 131
520#define SYS_getpgid 132
521#define SYS_fchdir 133
522#define SYS_bdflush 134
523#define SYS_sysfs 135
524#define SYS_personality 136
525#define SYS_afs_syscall 137
526#define SYS_setfsuid 138
527#define SYS_setfsgid 139
528#define SYS__llseek 140
529#define SYS_getdents 141
530#define SYS__newselect 142
531#define SYS_flock 143
532#define SYS_msync 144
533#define SYS_readv 145
534#define SYS_writev 146
535#define SYS_getsid 147
536#define SYS_fdatasync 148
537#define SYS__sysctl 149
538#define SYS_mlock 150
539#define SYS_munlock 151
540#define SYS_mlockall 152
541#define SYS_munlockall 153
542#define SYS_sched_setparam 154
543#define SYS_sched_getparam 155
544#define SYS_sched_setscheduler 156
545#define SYS_sched_getscheduler 157
546#define SYS_sched_yield 158
547#define SYS_sched_get_priority_max 159
548#define SYS_sched_get_priority_min 160
549#define SYS_sched_rr_get_interval 161
550#define SYS_nanosleep 162
551#define SYS_mremap 163
552#define SYS_setresuid 164
553#define SYS_getresuid 165
554#define SYS_vm86 166
555#define SYS_query_module 167
556#define SYS_poll 168
557#define SYS_nfsservctl 169
558#define SYS_setresgid 170
559#define SYS_getresgid 171
560#define SYS_prctl 172
561#define SYS_rt_sigreturn 173
562#define SYS_rt_sigaction 174
563#define SYS_rt_sigprocmask 175
564#define SYS_rt_sigpending 176
565#define SYS_rt_sigtimedwait 177
566#define SYS_rt_sigqueueinfo 178
567#define SYS_rt_sigsuspend 179
568#define SYS_pread64 180
569#define SYS_pwrite64 181
570#define SYS_chown 182
571#define SYS_getcwd 183
572#define SYS_capget 184
573#define SYS_capset 185
574#define SYS_sigaltstack 186
575#define SYS_sendfile 187
576#define SYS_getpmsg 188
577#define SYS_putpmsg 189
578#define SYS_vfork 190
579#define SYS_ugetrlimit 191
580#define SYS_mmap2 192
581#define SYS_truncate64 193
582#define SYS_ftruncate64 194
583#define SYS_stat64 195
584#define SYS_lstat64 196
585#define SYS_fstat64 197
586#define SYS_lchown32 198
587#define SYS_getuid32 199
588#define SYS_getgid32 200
589#define SYS_geteuid32 201
590#define SYS_getegid32 202
591#define SYS_setreuid32 203
592#define SYS_setregid32 204
593#define SYS_getgroups32 205
594#define SYS_setgroups32 206
595#define SYS_fchown32 207
596#define SYS_setresuid32 208
597#define SYS_getresuid32 209
598#define SYS_setresgid32 210
599#define SYS_getresgid32 211
600#define SYS_chown32 212
601#define SYS_setuid32 213
602#define SYS_setgid32 214
603#define SYS_setfsuid32 215
604#define SYS_setfsgid32 216
605#define SYS_pivot_root 217
606#define SYS_mincore 218
607#define SYS_madvise 219
608#define SYS_getdents64 220
609#define SYS_fcntl64 221
610#define SYS_gettid 224
611#define SYS_readahead 225
612#define SYS_setxattr 226
613#define SYS_lsetxattr 227
614#define SYS_fsetxattr 228
615#define SYS_getxattr 229
616#define SYS_lgetxattr 230
617#define SYS_fgetxattr 231
618#define SYS_listxattr 232
619#define SYS_llistxattr 233
620#define SYS_flistxattr 234
621#define SYS_removexattr 235
622#define SYS_lremovexattr 236
623#define SYS_fremovexattr 237
624#define SYS_tkill 238
625#define SYS_sendfile64 239
626#define SYS_futex 240
627#define SYS_sched_setaffinity 241
628#define SYS_sched_getaffinity 242
629#define SYS_set_thread_area 243
630#define SYS_get_thread_area 244
631#define SYS_io_setup 245
632#define SYS_io_destroy 246
633#define SYS_io_getevents 247
634#define SYS_io_submit 248
635#define SYS_io_cancel 249
636#define SYS_fadvise64 250
637#define SYS_exit_group 252
638#define SYS_lookup_dcookie 253
639#define SYS_epoll_create 254
640#define SYS_epoll_ctl 255
641#define SYS_epoll_wait 256
642#define SYS_remap_file_pages 257
643#define SYS_set_tid_address 258
644#define SYS_timer_create 259
645#define SYS_timer_settime (__NR_timer_create+1)
646#define SYS_timer_gettime (__NR_timer_create+2)
647#define SYS_timer_getoverrun (__NR_timer_create+3)
648#define SYS_timer_delete (__NR_timer_create+4)
649#define SYS_clock_settime (__NR_timer_create+5)
650#define SYS_clock_gettime (__NR_timer_create+6)
651#define SYS_clock_getres (__NR_timer_create+7)
652#define SYS_clock_nanosleep (__NR_timer_create+8)
653#define SYS_statfs64 268
654#define SYS_fstatfs64 269
655#define SYS_tgkill 270
656#define SYS_utimes 271
657#define SYS_fadvise64_64 272
658#define SYS_vserver 273
659#define SYS_mbind 274
660#define SYS_get_mempolicy 275
661#define SYS_set_mempolicy 276
662#define SYS_mq_open 277
663#define SYS_mq_unlink (__NR_mq_open+1)
664#define SYS_mq_timedsend (__NR_mq_open+2)
665#define SYS_mq_timedreceive (__NR_mq_open+3)
666#define SYS_mq_notify (__NR_mq_open+4)
667#define SYS_mq_getsetattr (__NR_mq_open+5)
668#define SYS_kexec_load 283
669#define SYS_waitid 284
670/* #define SYS_sys_setaltroot 285 */
671#define SYS_add_key 286
672#define SYS_request_key 287
673#define SYS_keyctl 288
674#define SYS_ioprio_set 289
675#define SYS_ioprio_get 290
676#define SYS_inotify_init 291
677#define SYS_inotify_add_watch 292
678#define SYS_inotify_rm_watch 293
679#define SYS_migrate_pages 294
680#define SYS_openat 295
681#define SYS_mkdirat 296
682#define SYS_mknodat 297
683#define SYS_fchownat 298
684#define SYS_futimesat 299
685#define SYS_fstatat64 300
686#define SYS_unlinkat 301
687#define SYS_renameat 302
688#define SYS_linkat 303
689#define SYS_symlinkat 304
690#define SYS_readlinkat 305
691#define SYS_fchmodat 306
692#define SYS_faccessat 307
693#define SYS_pselect6 308
694#define SYS_ppoll 309
695#define SYS_unshare 310
696#define SYS_set_robust_list 311
697#define SYS_get_robust_list 312
698#define SYS_splice 313
699#define SYS_sync_file_range 314
700#define SYS_tee 315
701#define SYS_vmsplice 316
702#define SYS_move_pages 317
703#define SYS_getcpu 318
704#define SYS_epoll_pwait 319
705#define SYS_utimensat 320
706#define SYS_signalfd 321
707#define SYS_timerfd_create 322
708#define SYS_eventfd 323
709#define SYS_fallocate 324
710#define SYS_timerfd_settime 325
711#define SYS_timerfd_gettime 326
712#define SYS_signalfd4 327
713#define SYS_eventfd2 328
714#define SYS_epoll_create1 329
715#define SYS_dup3 330
716#define SYS_pipe2 331
717#define SYS_inotify_init1 332
718#define SYS_preadv 333
719#define SYS_pwritev 334
720#define SYS_rt_tgsigqueueinfo 335
721#define SYS_perf_event_open 336
722#define SYS_recvmmsg 337
723#define SYS_fanotify_init 338
724#define SYS_fanotify_mark 339
725#define SYS_prlimit64 340
726#define SYS_name_to_handle_at 341
727#define SYS_open_by_handle_at 342
728#define SYS_clock_adjtime 343
729#define SYS_syncfs 344
730#define SYS_sendmmsg 345
731#define SYS_setns 346
732#define SYS_process_vm_readv 347
733#define SYS_process_vm_writev 348
734#define SYS_kcmp 349
735#define SYS_finit_module 350
736#define SYS_sched_setattr 351
737#define SYS_sched_getattr 352
738#define SYS_renameat2 353
739#define SYS_seccomp 354
740#define SYS_getrandom 355
741#define SYS_memfd_create 356
742#define SYS_bpf 357
743#define SYS_execveat 358
744#define SYS_socket 359
745#define SYS_socketpair 360
746#define SYS_bind 361
747#define SYS_connect 362
748#define SYS_listen 363
749#define SYS_accept4 364
750#define SYS_getsockopt 365
751#define SYS_setsockopt 366
752#define SYS_getsockname 367
753#define SYS_getpeername 368
754#define SYS_sendto 369
755#define SYS_sendmsg 370
756#define SYS_recvfrom 371
757#define SYS_recvmsg 372
758#define SYS_shutdown 373
759#define SYS_userfaultfd 374
760#define SYS_membarrier 375
761#define SYS_mlock2 376
762#define SYS_copy_file_range 377
763#define SYS_preadv2 378
764#define SYS_pwritev2 379
765#define SYS_pkey_mprotect 380
766#define SYS_pkey_alloc 381
767#define SYS_pkey_free 382
768#define SYS_statx 383
769#define SYS_arch_prctl 384
770#define SYS_io_pgetevents 385
771#define SYS_rseq 386
\ No newline at end of file
lib/libc/include/mips-linux-musl/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 64
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/mips-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for mips-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg int
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/ioctl.h+1-99
...@@ -90,24 +90,6 @@...@@ -90,24 +90,6 @@
90#define TIOCMIWAIT 0x549190#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x549291#define TIOCGICOUNT 0x5492
9292
93#define TIOCPKT_DATA 0
94#define TIOCPKT_FLUSHREAD 1
95#define TIOCPKT_FLUSHWRITE 2
96#define TIOCPKT_STOP 4
97#define TIOCPKT_START 8
98#define TIOCPKT_NOSTOP 16
99#define TIOCPKT_DOSTOP 32
100#define TIOCPKT_IOCTL 64
101
102#define TIOCSER_TEMT 0x01
103
104struct winsize {
105 unsigned short ws_row;
106 unsigned short ws_col;
107 unsigned short ws_xpixel;
108 unsigned short ws_ypixel;
109};
110
111#define TIOCM_LE 0x00193#define TIOCM_LE 0x001
112#define TIOCM_DTR 0x00294#define TIOCM_DTR 0x002
113#define TIOCM_RTS 0x00495#define TIOCM_RTS 0x004
...@@ -123,90 +105,10 @@ struct winsize {...@@ -123,90 +105,10 @@ struct winsize {
123#define TIOCM_OUT2 0x4000105#define TIOCM_OUT2 0x4000
124#define TIOCM_LOOP 0x8000106#define TIOCM_LOOP 0x8000
125107
126#define N_TTY 0
127#define N_SLIP 1
128#define N_MOUSE 2
129#define N_PPP 3
130#define N_STRIP 4
131#define N_AX25 5
132#define N_X25 6
133#define N_6PACK 7
134#define N_MASC 8
135#define N_R3964 9
136#define N_PROFIBUS_FDL 10
137#define N_IRDA 11
138#define N_SMSBLOCK 12
139#define N_HDLC 13
140#define N_SYNC_PPP 14
141#define N_HCI 15
142
143#define FIOGETOWN _IOR('f', 123, int)108#define FIOGETOWN _IOR('f', 123, int)
144#define FIOSETOWN _IOW('f', 124, int)109#define FIOSETOWN _IOW('f', 124, int)
145#define SIOCATMARK _IOR('s', 7, int)110#define SIOCATMARK _IOR('s', 7, int)
146#define SIOCSPGRP _IOW('s', 8, pid_t)111#define SIOCSPGRP _IOW('s', 8, pid_t)
147#define SIOCGPGRP _IOR('s', 9, pid_t)112#define SIOCGPGRP _IOR('s', 9, pid_t)
148#define SIOCGSTAMP 0x8906113#define SIOCGSTAMP 0x8906
149#define SIOCGSTAMPNS 0x8907
150
151#define SIOCADDRT 0x890B
152#define SIOCDELRT 0x890C
153#define SIOCRTMSG 0x890D
154
155#define SIOCGIFNAME 0x8910
156#define SIOCSIFLINK 0x8911
157#define SIOCGIFCONF 0x8912
158#define SIOCGIFFLAGS 0x8913
159#define SIOCSIFFLAGS 0x8914
160#define SIOCGIFADDR 0x8915
161#define SIOCSIFADDR 0x8916
162#define SIOCGIFDSTADDR 0x8917
163#define SIOCSIFDSTADDR 0x8918
164#define SIOCGIFBRDADDR 0x8919
165#define SIOCSIFBRDADDR 0x891a
166#define SIOCGIFNETMASK 0x891b
167#define SIOCSIFNETMASK 0x891c
168#define SIOCGIFMETRIC 0x891d
169#define SIOCSIFMETRIC 0x891e
170#define SIOCGIFMEM 0x891f
171#define SIOCSIFMEM 0x8920
172#define SIOCGIFMTU 0x8921
173#define SIOCSIFMTU 0x8922
174#define SIOCSIFNAME 0x8923
175#define SIOCSIFHWADDR 0x8924
176#define SIOCGIFENCAP 0x8925
177#define SIOCSIFENCAP 0x8926
178#define SIOCGIFHWADDR 0x8927
179#define SIOCGIFSLAVE 0x8929
180#define SIOCSIFSLAVE 0x8930
181#define SIOCADDMULTI 0x8931
182#define SIOCDELMULTI 0x8932
183#define SIOCGIFINDEX 0x8933
184#define SIOGIFINDEX SIOCGIFINDEX
185#define SIOCSIFPFLAGS 0x8934
186#define SIOCGIFPFLAGS 0x8935
187#define SIOCDIFADDR 0x8936
188#define SIOCSIFHWBROADCAST 0x8937
189#define SIOCGIFCOUNT 0x8938
190
191#define SIOCGIFBR 0x8940
192#define SIOCSIFBR 0x8941
193
194#define SIOCGIFTXQLEN 0x8942
195#define SIOCSIFTXQLEN 0x8943
196
197#define SIOCDARP 0x8953
198#define SIOCGARP 0x8954
199#define SIOCSARP 0x8955
200
201#define SIOCDRARP 0x8960
202#define SIOCGRARP 0x8961
203#define SIOCSRARP 0x8962
204
205#define SIOCGIFMAP 0x8970
206#define SIOCSIFMAP 0x8971
207
208#define SIOCADDDLCI 0x8980
209#define SIOCDELDLCI 0x8981
210
211#define SIOCDEVPRIVATE 0x89F0
212#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
114#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/syscall.h deleted-737
...@@ -1,737 +0,0 @@
1#define __NR_syscall 4000
2#define __NR_exit 4001
3#define __NR_fork 4002
4#define __NR_read 4003
5#define __NR_write 4004
6#define __NR_open 4005
7#define __NR_close 4006
8#define __NR_waitpid 4007
9#define __NR_creat 4008
10#define __NR_link 4009
11#define __NR_unlink 4010
12#define __NR_execve 4011
13#define __NR_chdir 4012
14#define __NR_time 4013
15#define __NR_mknod 4014
16#define __NR_chmod 4015
17#define __NR_lchown 4016
18#define __NR_break 4017
19#define __NR_unused18 4018
20#define __NR_lseek 4019
21#define __NR_getpid 4020
22#define __NR_mount 4021
23#define __NR_umount 4022
24#define __NR_setuid 4023
25#define __NR_getuid 4024
26#define __NR_stime 4025
27#define __NR_ptrace 4026
28#define __NR_alarm 4027
29#define __NR_unused28 4028
30#define __NR_pause 4029
31#define __NR_utime 4030
32#define __NR_stty 4031
33#define __NR_gtty 4032
34#define __NR_access 4033
35#define __NR_nice 4034
36#define __NR_ftime 4035
37#define __NR_sync 4036
38#define __NR_kill 4037
39#define __NR_rename 4038
40#define __NR_mkdir 4039
41#define __NR_rmdir 4040
42#define __NR_dup 4041
43#define __NR_pipe 4042
44#define __NR_times 4043
45#define __NR_prof 4044
46#define __NR_brk 4045
47#define __NR_setgid 4046
48#define __NR_getgid 4047
49#define __NR_signal 4048
50#define __NR_geteuid 4049
51#define __NR_getegid 4050
52#define __NR_acct 4051
53#define __NR_umount2 4052
54#define __NR_lock 4053
55#define __NR_ioctl 4054
56#define __NR_fcntl 4055
57#define __NR_mpx 4056
58#define __NR_setpgid 4057
59#define __NR_ulimit 4058
60#define __NR_unused59 4059
61#define __NR_umask 4060
62#define __NR_chroot 4061
63#define __NR_ustat 4062
64#define __NR_dup2 4063
65#define __NR_getppid 4064
66#define __NR_getpgrp 4065
67#define __NR_setsid 4066
68#define __NR_sigaction 4067
69#define __NR_sgetmask 4068
70#define __NR_ssetmask 4069
71#define __NR_setreuid 4070
72#define __NR_setregid 4071
73#define __NR_sigsuspend 4072
74#define __NR_sigpending 4073
75#define __NR_sethostname 4074
76#define __NR_setrlimit 4075
77#define __NR_getrlimit 4076
78#define __NR_getrusage 4077
79#define __NR_gettimeofday 4078
80#define __NR_settimeofday 4079
81#define __NR_getgroups 4080
82#define __NR_setgroups 4081
83#define __NR_reserved82 4082
84#define __NR_symlink 4083
85#define __NR_unused84 4084
86#define __NR_readlink 4085
87#define __NR_uselib 4086
88#define __NR_swapon 4087
89#define __NR_reboot 4088
90#define __NR_readdir 4089
91#define __NR_mmap 4090
92#define __NR_munmap 4091
93#define __NR_truncate 4092
94#define __NR_ftruncate 4093
95#define __NR_fchmod 4094
96#define __NR_fchown 4095
97#define __NR_getpriority 4096
98#define __NR_setpriority 4097
99#define __NR_profil 4098
100#define __NR_statfs 4099
101#define __NR_fstatfs 4100
102#define __NR_ioperm 4101
103#define __NR_socketcall 4102
104#define __NR_syslog 4103
105#define __NR_setitimer 4104
106#define __NR_getitimer 4105
107#define __NR_stat 4106
108#define __NR_lstat 4107
109#define __NR_fstat 4108
110#define __NR_unused109 4109
111#define __NR_iopl 4110
112#define __NR_vhangup 4111
113#define __NR_idle 4112
114#define __NR_vm86 4113
115#define __NR_wait4 4114
116#define __NR_swapoff 4115
117#define __NR_sysinfo 4116
118#define __NR_ipc 4117
119#define __NR_fsync 4118
120#define __NR_sigreturn 4119
121#define __NR_clone 4120
122#define __NR_setdomainname 4121
123#define __NR_uname 4122
124#define __NR_modify_ldt 4123
125#define __NR_adjtimex 4124
126#define __NR_mprotect 4125
127#define __NR_sigprocmask 4126
128#define __NR_create_module 4127
129#define __NR_init_module 4128
130#define __NR_delete_module 4129
131#define __NR_get_kernel_syms 4130
132#define __NR_quotactl 4131
133#define __NR_getpgid 4132
134#define __NR_fchdir 4133
135#define __NR_bdflush 4134
136#define __NR_sysfs 4135
137#define __NR_personality 4136
138#define __NR_afs_syscall 4137
139#define __NR_setfsuid 4138
140#define __NR_setfsgid 4139
141#define __NR__llseek 4140
142#define __NR_getdents 4141
143#define __NR__newselect 4142
144#define __NR_flock 4143
145#define __NR_msync 4144
146#define __NR_readv 4145
147#define __NR_writev 4146
148#define __NR_cacheflush 4147
149#define __NR_cachectl 4148
150#define __NR_sysmips 4149
151#define __NR_unused150 4150
152#define __NR_getsid 4151
153#define __NR_fdatasync 4152
154#define __NR__sysctl 4153
155#define __NR_mlock 4154
156#define __NR_munlock 4155
157#define __NR_mlockall 4156
158#define __NR_munlockall 4157
159#define __NR_sched_setparam 4158
160#define __NR_sched_getparam 4159
161#define __NR_sched_setscheduler 4160
162#define __NR_sched_getscheduler 4161
163#define __NR_sched_yield 4162
164#define __NR_sched_get_priority_max 4163
165#define __NR_sched_get_priority_min 4164
166#define __NR_sched_rr_get_interval 4165
167#define __NR_nanosleep 4166
168#define __NR_mremap 4167
169#define __NR_accept 4168
170#define __NR_bind 4169
171#define __NR_connect 4170
172#define __NR_getpeername 4171
173#define __NR_getsockname 4172
174#define __NR_getsockopt 4173
175#define __NR_listen 4174
176#define __NR_recv 4175
177#define __NR_recvfrom 4176
178#define __NR_recvmsg 4177
179#define __NR_send 4178
180#define __NR_sendmsg 4179
181#define __NR_sendto 4180
182#define __NR_setsockopt 4181
183#define __NR_shutdown 4182
184#define __NR_socket 4183
185#define __NR_socketpair 4184
186#define __NR_setresuid 4185
187#define __NR_getresuid 4186
188#define __NR_query_module 4187
189#define __NR_poll 4188
190#define __NR_nfsservctl 4189
191#define __NR_setresgid 4190
192#define __NR_getresgid 4191
193#define __NR_prctl 4192
194#define __NR_rt_sigreturn 4193
195#define __NR_rt_sigaction 4194
196#define __NR_rt_sigprocmask 4195
197#define __NR_rt_sigpending 4196
198#define __NR_rt_sigtimedwait 4197
199#define __NR_rt_sigqueueinfo 4198
200#define __NR_rt_sigsuspend 4199
201#define __NR_pread64 4200
202#define __NR_pwrite64 4201
203#define __NR_chown 4202
204#define __NR_getcwd 4203
205#define __NR_capget 4204
206#define __NR_capset 4205
207#define __NR_sigaltstack 4206
208#define __NR_sendfile 4207
209#define __NR_getpmsg 4208
210#define __NR_putpmsg 4209
211#define __NR_mmap2 4210
212#define __NR_truncate64 4211
213#define __NR_ftruncate64 4212
214#define __NR_stat64 4213
215#define __NR_lstat64 4214
216#define __NR_fstat64 4215
217#define __NR_pivot_root 4216
218#define __NR_mincore 4217
219#define __NR_madvise 4218
220#define __NR_getdents64 4219
221#define __NR_fcntl64 4220
222#define __NR_reserved221 4221
223#define __NR_gettid 4222
224#define __NR_readahead 4223
225#define __NR_setxattr 4224
226#define __NR_lsetxattr 4225
227#define __NR_fsetxattr 4226
228#define __NR_getxattr 4227
229#define __NR_lgetxattr 4228
230#define __NR_fgetxattr 4229
231#define __NR_listxattr 4230
232#define __NR_llistxattr 4231
233#define __NR_flistxattr 4232
234#define __NR_removexattr 4233
235#define __NR_lremovexattr 4234
236#define __NR_fremovexattr 4235
237#define __NR_tkill 4236
238#define __NR_sendfile64 4237
239#define __NR_futex 4238
240#define __NR_sched_setaffinity 4239
241#define __NR_sched_getaffinity 4240
242#define __NR_io_setup 4241
243#define __NR_io_destroy 4242
244#define __NR_io_getevents 4243
245#define __NR_io_submit 4244
246#define __NR_io_cancel 4245
247#define __NR_exit_group 4246
248#define __NR_lookup_dcookie 4247
249#define __NR_epoll_create 4248
250#define __NR_epoll_ctl 4249
251#define __NR_epoll_wait 4250
252#define __NR_remap_file_pages 4251
253#define __NR_set_tid_address 4252
254#define __NR_restart_syscall 4253
255#define __NR_fadvise64 4254
256#define __NR_statfs64 4255
257#define __NR_fstatfs64 4256
258#define __NR_timer_create 4257
259#define __NR_timer_settime 4258
260#define __NR_timer_gettime 4259
261#define __NR_timer_getoverrun 4260
262#define __NR_timer_delete 4261
263#define __NR_clock_settime 4262
264#define __NR_clock_gettime 4263
265#define __NR_clock_getres 4264
266#define __NR_clock_nanosleep 4265
267#define __NR_tgkill 4266
268#define __NR_utimes 4267
269#define __NR_mbind 4268
270#define __NR_get_mempolicy 4269
271#define __NR_set_mempolicy 4270
272#define __NR_mq_open 4271
273#define __NR_mq_unlink 4272
274#define __NR_mq_timedsend 4273
275#define __NR_mq_timedreceive 4274
276#define __NR_mq_notify 4275
277#define __NR_mq_getsetattr 4276
278#define __NR_vserver 4277
279#define __NR_waitid 4278
280#define __NR_add_key 4280
281#define __NR_request_key 4281
282#define __NR_keyctl 4282
283#define __NR_set_thread_area 4283
284#define __NR_inotify_init 4284
285#define __NR_inotify_add_watch 4285
286#define __NR_inotify_rm_watch 4286
287#define __NR_migrate_pages 4287
288#define __NR_openat 4288
289#define __NR_mkdirat 4289
290#define __NR_mknodat 4290
291#define __NR_fchownat 4291
292#define __NR_futimesat 4292
293#define __NR_fstatat64 4293
294#define __NR_unlinkat 4294
295#define __NR_renameat 4295
296#define __NR_linkat 4296
297#define __NR_symlinkat 4297
298#define __NR_readlinkat 4298
299#define __NR_fchmodat 4299
300#define __NR_faccessat 4300
301#define __NR_pselect6 4301
302#define __NR_ppoll 4302
303#define __NR_unshare 4303
304#define __NR_splice 4304
305#define __NR_sync_file_range 4305
306#define __NR_tee 4306
307#define __NR_vmsplice 4307
308#define __NR_move_pages 4308
309#define __NR_set_robust_list 4309
310#define __NR_get_robust_list 4310
311#define __NR_kexec_load 4311
312#define __NR_getcpu 4312
313#define __NR_epoll_pwait 4313
314#define __NR_ioprio_set 4314
315#define __NR_ioprio_get 4315
316#define __NR_utimensat 4316
317#define __NR_signalfd 4317
318#define __NR_timerfd 4318
319#define __NR_eventfd 4319
320#define __NR_fallocate 4320
321#define __NR_timerfd_create 4321
322#define __NR_timerfd_gettime 4322
323#define __NR_timerfd_settime 4323
324#define __NR_signalfd4 4324
325#define __NR_eventfd2 4325
326#define __NR_epoll_create1 4326
327#define __NR_dup3 4327
328#define __NR_pipe2 4328
329#define __NR_inotify_init1 4329
330#define __NR_preadv 4330
331#define __NR_pwritev 4331
332#define __NR_rt_tgsigqueueinfo 4332
333#define __NR_perf_event_open 4333
334#define __NR_accept4 4334
335#define __NR_recvmmsg 4335
336#define __NR_fanotify_init 4336
337#define __NR_fanotify_mark 4337
338#define __NR_prlimit64 4338
339#define __NR_name_to_handle_at 4339
340#define __NR_open_by_handle_at 4340
341#define __NR_clock_adjtime 4341
342#define __NR_syncfs 4342
343#define __NR_sendmmsg 4343
344#define __NR_setns 4344
345#define __NR_process_vm_readv 4345
346#define __NR_process_vm_writev 4346
347#define __NR_kcmp 4347
348#define __NR_finit_module 4348
349#define __NR_sched_setattr 4349
350#define __NR_sched_getattr 4350
351#define __NR_renameat2 4351
352#define __NR_seccomp 4352
353#define __NR_getrandom 4353
354#define __NR_memfd_create 4354
355#define __NR_bpf 4355
356#define __NR_execveat 4356
357#define __NR_userfaultfd 4357
358#define __NR_membarrier 4358
359#define __NR_mlock2 4359
360#define __NR_copy_file_range 4360
361#define __NR_preadv2 4361
362#define __NR_pwritev2 4362
363#define __NR_pkey_mprotect 4363
364#define __NR_pkey_alloc 4364
365#define __NR_pkey_free 4365
366#define __NR_statx 4366
367#define __NR_rseq 4367
368#define __NR_io_pgetevents 4368
369
370#define SYS_syscall 4000
371#define SYS_exit 4001
372#define SYS_fork 4002
373#define SYS_read 4003
374#define SYS_write 4004
375#define SYS_open 4005
376#define SYS_close 4006
377#define SYS_waitpid 4007
378#define SYS_creat 4008
379#define SYS_link 4009
380#define SYS_unlink 4010
381#define SYS_execve 4011
382#define SYS_chdir 4012
383#define SYS_time 4013
384#define SYS_mknod 4014
385#define SYS_chmod 4015
386#define SYS_lchown 4016
387#define SYS_break 4017
388#define SYS_unused18 4018
389#define SYS_lseek 4019
390#define SYS_getpid 4020
391#define SYS_mount 4021
392#define SYS_umount 4022
393#define SYS_setuid 4023
394#define SYS_getuid 4024
395#define SYS_stime 4025
396#define SYS_ptrace 4026
397#define SYS_alarm 4027
398#define SYS_unused28 4028
399#define SYS_pause 4029
400#define SYS_utime 4030
401#define SYS_stty 4031
402#define SYS_gtty 4032
403#define SYS_access 4033
404#define SYS_nice 4034
405#define SYS_ftime 4035
406#define SYS_sync 4036
407#define SYS_kill 4037
408#define SYS_rename 4038
409#define SYS_mkdir 4039
410#define SYS_rmdir 4040
411#define SYS_dup 4041
412#define SYS_pipe 4042
413#define SYS_times 4043
414#define SYS_prof 4044
415#define SYS_brk 4045
416#define SYS_setgid 4046
417#define SYS_getgid 4047
418#define SYS_signal 4048
419#define SYS_geteuid 4049
420#define SYS_getegid 4050
421#define SYS_acct 4051
422#define SYS_umount2 4052
423#define SYS_lock 4053
424#define SYS_ioctl 4054
425#define SYS_fcntl 4055
426#define SYS_mpx 4056
427#define SYS_setpgid 4057
428#define SYS_ulimit 4058
429#define SYS_unused59 4059
430#define SYS_umask 4060
431#define SYS_chroot 4061
432#define SYS_ustat 4062
433#define SYS_dup2 4063
434#define SYS_getppid 4064
435#define SYS_getpgrp 4065
436#define SYS_setsid 4066
437#define SYS_sigaction 4067
438#define SYS_sgetmask 4068
439#define SYS_ssetmask 4069
440#define SYS_setreuid 4070
441#define SYS_setregid 4071
442#define SYS_sigsuspend 4072
443#define SYS_sigpending 4073
444#define SYS_sethostname 4074
445#define SYS_setrlimit 4075
446#define SYS_getrlimit 4076
447#define SYS_getrusage 4077
448#define SYS_gettimeofday 4078
449#define SYS_settimeofday 4079
450#define SYS_getgroups 4080
451#define SYS_setgroups 4081
452#define SYS_reserved82 4082
453#define SYS_symlink 4083
454#define SYS_unused84 4084
455#define SYS_readlink 4085
456#define SYS_uselib 4086
457#define SYS_swapon 4087
458#define SYS_reboot 4088
459#define SYS_readdir 4089
460#define SYS_mmap 4090
461#define SYS_munmap 4091
462#define SYS_truncate 4092
463#define SYS_ftruncate 4093
464#define SYS_fchmod 4094
465#define SYS_fchown 4095
466#define SYS_getpriority 4096
467#define SYS_setpriority 4097
468#define SYS_profil 4098
469#define SYS_statfs 4099
470#define SYS_fstatfs 4100
471#define SYS_ioperm 4101
472#define SYS_socketcall 4102
473#define SYS_syslog 4103
474#define SYS_setitimer 4104
475#define SYS_getitimer 4105
476#define SYS_stat 4106
477#define SYS_lstat 4107
478#define SYS_fstat 4108
479#define SYS_unused109 4109
480#define SYS_iopl 4110
481#define SYS_vhangup 4111
482#define SYS_idle 4112
483#define SYS_vm86 4113
484#define SYS_wait4 4114
485#define SYS_swapoff 4115
486#define SYS_sysinfo 4116
487#define SYS_ipc 4117
488#define SYS_fsync 4118
489#define SYS_sigreturn 4119
490#define SYS_clone 4120
491#define SYS_setdomainname 4121
492#define SYS_uname 4122
493#define SYS_modify_ldt 4123
494#define SYS_adjtimex 4124
495#define SYS_mprotect 4125
496#define SYS_sigprocmask 4126
497#define SYS_create_module 4127
498#define SYS_init_module 4128
499#define SYS_delete_module 4129
500#define SYS_get_kernel_syms 4130
501#define SYS_quotactl 4131
502#define SYS_getpgid 4132
503#define SYS_fchdir 4133
504#define SYS_bdflush 4134
505#define SYS_sysfs 4135
506#define SYS_personality 4136
507#define SYS_afs_syscall 4137
508#define SYS_setfsuid 4138
509#define SYS_setfsgid 4139
510#define SYS__llseek 4140
511#define SYS_getdents 4141
512#define SYS__newselect 4142
513#define SYS_flock 4143
514#define SYS_msync 4144
515#define SYS_readv 4145
516#define SYS_writev 4146
517#define SYS_cacheflush 4147
518#define SYS_cachectl 4148
519#define SYS_sysmips 4149
520#define SYS_unused150 4150
521#define SYS_getsid 4151
522#define SYS_fdatasync 4152
523#define SYS__sysctl 4153
524#define SYS_mlock 4154
525#define SYS_munlock 4155
526#define SYS_mlockall 4156
527#define SYS_munlockall 4157
528#define SYS_sched_setparam 4158
529#define SYS_sched_getparam 4159
530#define SYS_sched_setscheduler 4160
531#define SYS_sched_getscheduler 4161
532#define SYS_sched_yield 4162
533#define SYS_sched_get_priority_max 4163
534#define SYS_sched_get_priority_min 4164
535#define SYS_sched_rr_get_interval 4165
536#define SYS_nanosleep 4166
537#define SYS_mremap 4167
538#define SYS_accept 4168
539#define SYS_bind 4169
540#define SYS_connect 4170
541#define SYS_getpeername 4171
542#define SYS_getsockname 4172
543#define SYS_getsockopt 4173
544#define SYS_listen 4174
545#define SYS_recv 4175
546#define SYS_recvfrom 4176
547#define SYS_recvmsg 4177
548#define SYS_send 4178
549#define SYS_sendmsg 4179
550#define SYS_sendto 4180
551#define SYS_setsockopt 4181
552#define SYS_shutdown 4182
553#define SYS_socket 4183
554#define SYS_socketpair 4184
555#define SYS_setresuid 4185
556#define SYS_getresuid 4186
557#define SYS_query_module 4187
558#define SYS_poll 4188
559#define SYS_nfsservctl 4189
560#define SYS_setresgid 4190
561#define SYS_getresgid 4191
562#define SYS_prctl 4192
563#define SYS_rt_sigreturn 4193
564#define SYS_rt_sigaction 4194
565#define SYS_rt_sigprocmask 4195
566#define SYS_rt_sigpending 4196
567#define SYS_rt_sigtimedwait 4197
568#define SYS_rt_sigqueueinfo 4198
569#define SYS_rt_sigsuspend 4199
570#define SYS_pread64 4200
571#define SYS_pwrite64 4201
572#define SYS_chown 4202
573#define SYS_getcwd 4203
574#define SYS_capget 4204
575#define SYS_capset 4205
576#define SYS_sigaltstack 4206
577#define SYS_sendfile 4207
578#define SYS_getpmsg 4208
579#define SYS_putpmsg 4209
580#define SYS_mmap2 4210
581#define SYS_truncate64 4211
582#define SYS_ftruncate64 4212
583#define SYS_stat64 4213
584#define SYS_lstat64 4214
585#define SYS_fstat64 4215
586#define SYS_pivot_root 4216
587#define SYS_mincore 4217
588#define SYS_madvise 4218
589#define SYS_getdents64 4219
590#define SYS_fcntl64 4220
591#define SYS_reserved221 4221
592#define SYS_gettid 4222
593#define SYS_readahead 4223
594#define SYS_setxattr 4224
595#define SYS_lsetxattr 4225
596#define SYS_fsetxattr 4226
597#define SYS_getxattr 4227
598#define SYS_lgetxattr 4228
599#define SYS_fgetxattr 4229
600#define SYS_listxattr 4230
601#define SYS_llistxattr 4231
602#define SYS_flistxattr 4232
603#define SYS_removexattr 4233
604#define SYS_lremovexattr 4234
605#define SYS_fremovexattr 4235
606#define SYS_tkill 4236
607#define SYS_sendfile64 4237
608#define SYS_futex 4238
609#define SYS_sched_setaffinity 4239
610#define SYS_sched_getaffinity 4240
611#define SYS_io_setup 4241
612#define SYS_io_destroy 4242
613#define SYS_io_getevents 4243
614#define SYS_io_submit 4244
615#define SYS_io_cancel 4245
616#define SYS_exit_group 4246
617#define SYS_lookup_dcookie 4247
618#define SYS_epoll_create 4248
619#define SYS_epoll_ctl 4249
620#define SYS_epoll_wait 4250
621#define SYS_remap_file_pages 4251
622#define SYS_set_tid_address 4252
623#define SYS_restart_syscall 4253
624#define SYS_fadvise64 4254
625#define SYS_statfs64 4255
626#define SYS_fstatfs64 4256
627#define SYS_timer_create 4257
628#define SYS_timer_settime 4258
629#define SYS_timer_gettime 4259
630#define SYS_timer_getoverrun 4260
631#define SYS_timer_delete 4261
632#define SYS_clock_settime 4262
633#define SYS_clock_gettime 4263
634#define SYS_clock_getres 4264
635#define SYS_clock_nanosleep 4265
636#define SYS_tgkill 4266
637#define SYS_utimes 4267
638#define SYS_mbind 4268
639#define SYS_get_mempolicy 4269
640#define SYS_set_mempolicy 4270
641#define SYS_mq_open 4271
642#define SYS_mq_unlink 4272
643#define SYS_mq_timedsend 4273
644#define SYS_mq_timedreceive 4274
645#define SYS_mq_notify 4275
646#define SYS_mq_getsetattr 4276
647#define SYS_vserver 4277
648#define SYS_waitid 4278
649#define SYS_add_key 4280
650#define SYS_request_key 4281
651#define SYS_keyctl 4282
652#define SYS_set_thread_area 4283
653#define SYS_inotify_init 4284
654#define SYS_inotify_add_watch 4285
655#define SYS_inotify_rm_watch 4286
656#define SYS_migrate_pages 4287
657#define SYS_openat 4288
658#define SYS_mkdirat 4289
659#define SYS_mknodat 4290
660#define SYS_fchownat 4291
661#define SYS_futimesat 4292
662#define SYS_fstatat64 4293
663#define SYS_unlinkat 4294
664#define SYS_renameat 4295
665#define SYS_linkat 4296
666#define SYS_symlinkat 4297
667#define SYS_readlinkat 4298
668#define SYS_fchmodat 4299
669#define SYS_faccessat 4300
670#define SYS_pselect6 4301
671#define SYS_ppoll 4302
672#define SYS_unshare 4303
673#define SYS_splice 4304
674#define SYS_sync_file_range 4305
675#define SYS_tee 4306
676#define SYS_vmsplice 4307
677#define SYS_move_pages 4308
678#define SYS_set_robust_list 4309
679#define SYS_get_robust_list 4310
680#define SYS_kexec_load 4311
681#define SYS_getcpu 4312
682#define SYS_epoll_pwait 4313
683#define SYS_ioprio_set 4314
684#define SYS_ioprio_get 4315
685#define SYS_utimensat 4316
686#define SYS_signalfd 4317
687#define SYS_timerfd 4318
688#define SYS_eventfd 4319
689#define SYS_fallocate 4320
690#define SYS_timerfd_create 4321
691#define SYS_timerfd_gettime 4322
692#define SYS_timerfd_settime 4323
693#define SYS_signalfd4 4324
694#define SYS_eventfd2 4325
695#define SYS_epoll_create1 4326
696#define SYS_dup3 4327
697#define SYS_pipe2 4328
698#define SYS_inotify_init1 4329
699#define SYS_preadv 4330
700#define SYS_pwritev 4331
701#define SYS_rt_tgsigqueueinfo 4332
702#define SYS_perf_event_open 4333
703#define SYS_accept4 4334
704#define SYS_recvmmsg 4335
705#define SYS_fanotify_init 4336
706#define SYS_fanotify_mark 4337
707#define SYS_prlimit64 4338
708#define SYS_name_to_handle_at 4339
709#define SYS_open_by_handle_at 4340
710#define SYS_clock_adjtime 4341
711#define SYS_syncfs 4342
712#define SYS_sendmmsg 4343
713#define SYS_setns 4344
714#define SYS_process_vm_readv 4345
715#define SYS_process_vm_writev 4346
716#define SYS_kcmp 4347
717#define SYS_finit_module 4348
718#define SYS_sched_setattr 4349
719#define SYS_sched_getattr 4350
720#define SYS_renameat2 4351
721#define SYS_seccomp 4352
722#define SYS_getrandom 4353
723#define SYS_memfd_create 4354
724#define SYS_bpf 4355
725#define SYS_execveat 4356
726#define SYS_userfaultfd 4357
727#define SYS_membarrier 4358
728#define SYS_mlock2 4359
729#define SYS_copy_file_range 4360
730#define SYS_preadv2 4361
731#define SYS_pwritev2 4362
732#define SYS_pkey_mprotect 4363
733#define SYS_pkey_alloc 4364
734#define SYS_pkey_free 4365
735#define SYS_statx 4366
736#define SYS_rseq 4367
737#define SYS_io_pgetevents 4368
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/termios.h+1-1
...@@ -165,5 +165,5 @@ struct termios {...@@ -165,5 +165,5 @@ struct termios {
165#define EXTPROC 0200000165#define EXTPROC 0200000
166166
167#define XTABS 0014000167#define XTABS 0014000
168#define TIOCSER_TEMT 0x01168#define TIOCSER_TEMT 1
169#endif169#endif
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for mips64-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/alltypes.h deleted-391
...@@ -1,391 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
53typedef unsigned nlink_t;
54#define __DEFINED_nlink_t
55#endif
56
57
58#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
59typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
60#define __DEFINED_pthread_attr_t
61#endif
62
63#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
64typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
65#define __DEFINED_pthread_mutex_t
66#endif
67
68#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
69typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
70#define __DEFINED_mtx_t
71#endif
72
73#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
74typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
75#define __DEFINED_pthread_cond_t
76#endif
77
78#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
79typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
80#define __DEFINED_cnd_t
81#endif
82
83#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
84typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
85#define __DEFINED_pthread_rwlock_t
86#endif
87
88#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
89typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
90#define __DEFINED_pthread_barrier_t
91#endif
92
93#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
94typedef unsigned _Addr size_t;
95#define __DEFINED_size_t
96#endif
97
98#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
99typedef unsigned _Addr uintptr_t;
100#define __DEFINED_uintptr_t
101#endif
102
103#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
104typedef _Addr ptrdiff_t;
105#define __DEFINED_ptrdiff_t
106#endif
107
108#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
109typedef _Addr ssize_t;
110#define __DEFINED_ssize_t
111#endif
112
113#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
114typedef _Addr intptr_t;
115#define __DEFINED_intptr_t
116#endif
117
118#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
119typedef _Addr regoff_t;
120#define __DEFINED_regoff_t
121#endif
122
123#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
124typedef _Reg register_t;
125#define __DEFINED_register_t
126#endif
127
128
129#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
130typedef signed char int8_t;
131#define __DEFINED_int8_t
132#endif
133
134#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
135typedef signed short int16_t;
136#define __DEFINED_int16_t
137#endif
138
139#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
140typedef signed int int32_t;
141#define __DEFINED_int32_t
142#endif
143
144#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
145typedef signed _Int64 int64_t;
146#define __DEFINED_int64_t
147#endif
148
149#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
150typedef signed _Int64 intmax_t;
151#define __DEFINED_intmax_t
152#endif
153
154#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
155typedef unsigned char uint8_t;
156#define __DEFINED_uint8_t
157#endif
158
159#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
160typedef unsigned short uint16_t;
161#define __DEFINED_uint16_t
162#endif
163
164#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
165typedef unsigned int uint32_t;
166#define __DEFINED_uint32_t
167#endif
168
169#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
170typedef unsigned _Int64 uint64_t;
171#define __DEFINED_uint64_t
172#endif
173
174#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
175typedef unsigned _Int64 u_int64_t;
176#define __DEFINED_u_int64_t
177#endif
178
179#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
180typedef unsigned _Int64 uintmax_t;
181#define __DEFINED_uintmax_t
182#endif
183
184
185#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
186typedef unsigned mode_t;
187#define __DEFINED_mode_t
188#endif
189
190#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
191typedef unsigned _Reg nlink_t;
192#define __DEFINED_nlink_t
193#endif
194
195#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
196typedef _Int64 off_t;
197#define __DEFINED_off_t
198#endif
199
200#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
201typedef unsigned _Int64 ino_t;
202#define __DEFINED_ino_t
203#endif
204
205#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
206typedef unsigned _Int64 dev_t;
207#define __DEFINED_dev_t
208#endif
209
210#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
211typedef long blksize_t;
212#define __DEFINED_blksize_t
213#endif
214
215#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
216typedef _Int64 blkcnt_t;
217#define __DEFINED_blkcnt_t
218#endif
219
220#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
221typedef unsigned _Int64 fsblkcnt_t;
222#define __DEFINED_fsblkcnt_t
223#endif
224
225#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
226typedef unsigned _Int64 fsfilcnt_t;
227#define __DEFINED_fsfilcnt_t
228#endif
229
230
231#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
232typedef unsigned wint_t;
233#define __DEFINED_wint_t
234#endif
235
236#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
237typedef unsigned long wctype_t;
238#define __DEFINED_wctype_t
239#endif
240
241
242#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
243typedef void * timer_t;
244#define __DEFINED_timer_t
245#endif
246
247#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
248typedef int clockid_t;
249#define __DEFINED_clockid_t
250#endif
251
252#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
253typedef long clock_t;
254#define __DEFINED_clock_t
255#endif
256
257#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
258struct timeval { time_t tv_sec; suseconds_t tv_usec; };
259#define __DEFINED_struct_timeval
260#endif
261
262#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
263struct timespec { time_t tv_sec; long tv_nsec; };
264#define __DEFINED_struct_timespec
265#endif
266
267
268#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
269typedef int pid_t;
270#define __DEFINED_pid_t
271#endif
272
273#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
274typedef unsigned id_t;
275#define __DEFINED_id_t
276#endif
277
278#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
279typedef unsigned uid_t;
280#define __DEFINED_uid_t
281#endif
282
283#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
284typedef unsigned gid_t;
285#define __DEFINED_gid_t
286#endif
287
288#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
289typedef int key_t;
290#define __DEFINED_key_t
291#endif
292
293#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
294typedef unsigned useconds_t;
295#define __DEFINED_useconds_t
296#endif
297
298
299#ifdef __cplusplus
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef unsigned long pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#else
306#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
307typedef struct __pthread * pthread_t;
308#define __DEFINED_pthread_t
309#endif
310
311#endif
312#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
313typedef int pthread_once_t;
314#define __DEFINED_pthread_once_t
315#endif
316
317#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
318typedef unsigned pthread_key_t;
319#define __DEFINED_pthread_key_t
320#endif
321
322#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
323typedef int pthread_spinlock_t;
324#define __DEFINED_pthread_spinlock_t
325#endif
326
327#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
328typedef struct { unsigned __attr; } pthread_mutexattr_t;
329#define __DEFINED_pthread_mutexattr_t
330#endif
331
332#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
333typedef struct { unsigned __attr; } pthread_condattr_t;
334#define __DEFINED_pthread_condattr_t
335#endif
336
337#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
338typedef struct { unsigned __attr; } pthread_barrierattr_t;
339#define __DEFINED_pthread_barrierattr_t
340#endif
341
342#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
343typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
344#define __DEFINED_pthread_rwlockattr_t
345#endif
346
347
348#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
349typedef struct _IO_FILE FILE;
350#define __DEFINED_FILE
351#endif
352
353
354#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
355typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
356#define __DEFINED_mbstate_t
357#endif
358
359
360#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
361typedef struct __locale_struct * locale_t;
362#define __DEFINED_locale_t
363#endif
364
365
366#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
367typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
368#define __DEFINED_sigset_t
369#endif
370
371
372#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
373struct iovec { void *iov_base; size_t iov_len; };
374#define __DEFINED_struct_iovec
375#endif
376
377
378#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
379typedef unsigned socklen_t;
380#define __DEFINED_socklen_t
381#endif
382
383#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
384typedef unsigned short sa_family_t;
385#define __DEFINED_sa_family_t
386#endif
387
388
389#undef _Addr
390#undef _Int64
391#undef _Reg
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/ioctl.h+1-99
...@@ -90,24 +90,6 @@...@@ -90,24 +90,6 @@
90#define TIOCMIWAIT 0x549190#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x549291#define TIOCGICOUNT 0x5492
9292
93#define TIOCPKT_DATA 0
94#define TIOCPKT_FLUSHREAD 1
95#define TIOCPKT_FLUSHWRITE 2
96#define TIOCPKT_STOP 4
97#define TIOCPKT_START 8
98#define TIOCPKT_NOSTOP 16
99#define TIOCPKT_DOSTOP 32
100#define TIOCPKT_IOCTL 64
101
102#define TIOCSER_TEMT 0x01
103
104struct winsize {
105 unsigned short ws_row;
106 unsigned short ws_col;
107 unsigned short ws_xpixel;
108 unsigned short ws_ypixel;
109};
110
111#define TIOCM_LE 0x00193#define TIOCM_LE 0x001
112#define TIOCM_DTR 0x00294#define TIOCM_DTR 0x002
113#define TIOCM_RTS 0x00495#define TIOCM_RTS 0x004
...@@ -123,90 +105,10 @@ struct winsize {...@@ -123,90 +105,10 @@ struct winsize {
123#define TIOCM_OUT2 0x4000105#define TIOCM_OUT2 0x4000
124#define TIOCM_LOOP 0x8000106#define TIOCM_LOOP 0x8000
125107
126#define N_TTY 0
127#define N_SLIP 1
128#define N_MOUSE 2
129#define N_PPP 3
130#define N_STRIP 4
131#define N_AX25 5
132#define N_X25 6
133#define N_6PACK 7
134#define N_MASC 8
135#define N_R3964 9
136#define N_PROFIBUS_FDL 10
137#define N_IRDA 11
138#define N_SMSBLOCK 12
139#define N_HDLC 13
140#define N_SYNC_PPP 14
141#define N_HCI 15
142
143#define FIOGETOWN _IOR('f', 123, int)108#define FIOGETOWN _IOR('f', 123, int)
144#define FIOSETOWN _IOW('f', 124, int)109#define FIOSETOWN _IOW('f', 124, int)
145#define SIOCATMARK _IOR('s', 7, int)110#define SIOCATMARK _IOR('s', 7, int)
146#define SIOCSPGRP _IOW('s', 8, pid_t)111#define SIOCSPGRP _IOW('s', 8, pid_t)
147#define SIOCGPGRP _IOR('s', 9, pid_t)112#define SIOCGPGRP _IOR('s', 9, pid_t)
148#define SIOCGSTAMP 0x8906113#define SIOCGSTAMP 0x8906
149#define SIOCGSTAMPNS 0x8907
150
151#define SIOCADDRT 0x890B
152#define SIOCDELRT 0x890C
153#define SIOCRTMSG 0x890D
154
155#define SIOCGIFNAME 0x8910
156#define SIOCSIFLINK 0x8911
157#define SIOCGIFCONF 0x8912
158#define SIOCGIFFLAGS 0x8913
159#define SIOCSIFFLAGS 0x8914
160#define SIOCGIFADDR 0x8915
161#define SIOCSIFADDR 0x8916
162#define SIOCGIFDSTADDR 0x8917
163#define SIOCSIFDSTADDR 0x8918
164#define SIOCGIFBRDADDR 0x8919
165#define SIOCSIFBRDADDR 0x891a
166#define SIOCGIFNETMASK 0x891b
167#define SIOCSIFNETMASK 0x891c
168#define SIOCGIFMETRIC 0x891d
169#define SIOCSIFMETRIC 0x891e
170#define SIOCGIFMEM 0x891f
171#define SIOCSIFMEM 0x8920
172#define SIOCGIFMTU 0x8921
173#define SIOCSIFMTU 0x8922
174#define SIOCSIFNAME 0x8923
175#define SIOCSIFHWADDR 0x8924
176#define SIOCGIFENCAP 0x8925
177#define SIOCSIFENCAP 0x8926
178#define SIOCGIFHWADDR 0x8927
179#define SIOCGIFSLAVE 0x8929
180#define SIOCSIFSLAVE 0x8930
181#define SIOCADDMULTI 0x8931
182#define SIOCDELMULTI 0x8932
183#define SIOCGIFINDEX 0x8933
184#define SIOGIFINDEX SIOCGIFINDEX
185#define SIOCSIFPFLAGS 0x8934
186#define SIOCGIFPFLAGS 0x8935
187#define SIOCDIFADDR 0x8936
188#define SIOCSIFHWBROADCAST 0x8937
189#define SIOCGIFCOUNT 0x8938
190
191#define SIOCGIFBR 0x8940
192#define SIOCSIFBR 0x8941
193
194#define SIOCGIFTXQLEN 0x8942
195#define SIOCSIFTXQLEN 0x8943
196
197#define SIOCDARP 0x8953
198#define SIOCGARP 0x8954
199#define SIOCSARP 0x8955
200
201#define SIOCDRARP 0x8960
202#define SIOCGRARP 0x8961
203#define SIOCSRARP 0x8962
204
205#define SIOCGIFMAP 0x8970
206#define SIOCSIFMAP 0x8971
207
208#define SIOCADDDLCI 0x8980
209#define SIOCDELDLCI 0x8981
210
211#define SIOCDEVPRIVATE 0x89F0
212#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
114#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/syscall.h deleted-657
...@@ -1,657 +0,0 @@
1#define __NR_read 5000
2#define __NR_write 5001
3#define __NR_open 5002
4#define __NR_close 5003
5#define __NR_stat 5004
6#define __NR_fstat 5005
7#define __NR_lstat 5006
8#define __NR_poll 5007
9#define __NR_lseek 5008
10#define __NR_mmap 5009
11#define __NR_mprotect 5010
12#define __NR_munmap 5011
13#define __NR_brk 5012
14#define __NR_rt_sigaction 5013
15#define __NR_rt_sigprocmask 5014
16#define __NR_ioctl 5015
17#define __NR_pread64 5016
18#define __NR_pwrite64 5017
19#define __NR_readv 5018
20#define __NR_writev 5019
21#define __NR_access 5020
22#define __NR_pipe 5021
23#define __NR__newselect 5022
24#define __NR_sched_yield 5023
25#define __NR_mremap 5024
26#define __NR_msync 5025
27#define __NR_mincore 5026
28#define __NR_madvise 5027
29#define __NR_shmget 5028
30#define __NR_shmat 5029
31#define __NR_shmctl 5030
32#define __NR_dup 5031
33#define __NR_dup2 5032
34#define __NR_pause 5033
35#define __NR_nanosleep 5034
36#define __NR_getitimer 5035
37#define __NR_setitimer 5036
38#define __NR_alarm 5037
39#define __NR_getpid 5038
40#define __NR_sendfile 5039
41#define __NR_socket 5040
42#define __NR_connect 5041
43#define __NR_accept 5042
44#define __NR_sendto 5043
45#define __NR_recvfrom 5044
46#define __NR_sendmsg 5045
47#define __NR_recvmsg 5046
48#define __NR_shutdown 5047
49#define __NR_bind 5048
50#define __NR_listen 5049
51#define __NR_getsockname 5050
52#define __NR_getpeername 5051
53#define __NR_socketpair 5052
54#define __NR_setsockopt 5053
55#define __NR_getsockopt 5054
56#define __NR_clone 5055
57#define __NR_fork 5056
58#define __NR_execve 5057
59#define __NR_exit 5058
60#define __NR_wait4 5059
61#define __NR_kill 5060
62#define __NR_uname 5061
63#define __NR_semget 5062
64#define __NR_semop 5063
65#define __NR_semctl 5064
66#define __NR_shmdt 5065
67#define __NR_msgget 5066
68#define __NR_msgsnd 5067
69#define __NR_msgrcv 5068
70#define __NR_msgctl 5069
71#define __NR_fcntl 5070
72#define __NR_flock 5071
73#define __NR_fsync 5072
74#define __NR_fdatasync 5073
75#define __NR_truncate 5074
76#define __NR_ftruncate 5075
77#define __NR_getdents 5076
78#define __NR_getcwd 5077
79#define __NR_chdir 5078
80#define __NR_fchdir 5079
81#define __NR_rename 5080
82#define __NR_mkdir 5081
83#define __NR_rmdir 5082
84#define __NR_creat 5083
85#define __NR_link 5084
86#define __NR_unlink 5085
87#define __NR_symlink 5086
88#define __NR_readlink 5087
89#define __NR_chmod 5088
90#define __NR_fchmod 5089
91#define __NR_chown 5090
92#define __NR_fchown 5091
93#define __NR_lchown 5092
94#define __NR_umask 5093
95#define __NR_gettimeofday 5094
96#define __NR_getrlimit 5095
97#define __NR_getrusage 5096
98#define __NR_sysinfo 5097
99#define __NR_times 5098
100#define __NR_ptrace 5099
101#define __NR_getuid 5100
102#define __NR_syslog 5101
103#define __NR_getgid 5102
104#define __NR_setuid 5103
105#define __NR_setgid 5104
106#define __NR_geteuid 5105
107#define __NR_getegid 5106
108#define __NR_setpgid 5107
109#define __NR_getppid 5108
110#define __NR_getpgrp 5109
111#define __NR_setsid 5110
112#define __NR_setreuid 5111
113#define __NR_setregid 5112
114#define __NR_getgroups 5113
115#define __NR_setgroups 5114
116#define __NR_setresuid 5115
117#define __NR_getresuid 5116
118#define __NR_setresgid 5117
119#define __NR_getresgid 5118
120#define __NR_getpgid 5119
121#define __NR_setfsuid 5120
122#define __NR_setfsgid 5121
123#define __NR_getsid 5122
124#define __NR_capget 5123
125#define __NR_capset 5124
126#define __NR_rt_sigpending 5125
127#define __NR_rt_sigtimedwait 5126
128#define __NR_rt_sigqueueinfo 5127
129#define __NR_rt_sigsuspend 5128
130#define __NR_sigaltstack 5129
131#define __NR_utime 5130
132#define __NR_mknod 5131
133#define __NR_personality 5132
134#define __NR_ustat 5133
135#define __NR_statfs 5134
136#define __NR_fstatfs 5135
137#define __NR_sysfs 5136
138#define __NR_getpriority 5137
139#define __NR_setpriority 5138
140#define __NR_sched_setparam 5139
141#define __NR_sched_getparam 5140
142#define __NR_sched_setscheduler 5141
143#define __NR_sched_getscheduler 5142
144#define __NR_sched_get_priority_max 5143
145#define __NR_sched_get_priority_min 5144
146#define __NR_sched_rr_get_interval 5145
147#define __NR_mlock 5146
148#define __NR_munlock 5147
149#define __NR_mlockall 5148
150#define __NR_munlockall 5149
151#define __NR_vhangup 5150
152#define __NR_pivot_root 5151
153#define __NR__sysctl 5152
154#define __NR_prctl 5153
155#define __NR_adjtimex 5154
156#define __NR_setrlimit 5155
157#define __NR_chroot 5156
158#define __NR_sync 5157
159#define __NR_acct 5158
160#define __NR_settimeofday 5159
161#define __NR_mount 5160
162#define __NR_umount2 5161
163#define __NR_swapon 5162
164#define __NR_swapoff 5163
165#define __NR_reboot 5164
166#define __NR_sethostname 5165
167#define __NR_setdomainname 5166
168#define __NR_create_module 5167
169#define __NR_init_module 5168
170#define __NR_delete_module 5169
171#define __NR_get_kernel_syms 5170
172#define __NR_query_module 5171
173#define __NR_quotactl 5172
174#define __NR_nfsservctl 5173
175#define __NR_getpmsg 5174
176#define __NR_putpmsg 5175
177#define __NR_afs_syscall 5176
178#define __NR_reserved177 5177
179#define __NR_gettid 5178
180#define __NR_readahead 5179
181#define __NR_setxattr 5180
182#define __NR_lsetxattr 5181
183#define __NR_fsetxattr 5182
184#define __NR_getxattr 5183
185#define __NR_lgetxattr 5184
186#define __NR_fgetxattr 5185
187#define __NR_listxattr 5186
188#define __NR_llistxattr 5187
189#define __NR_flistxattr 5188
190#define __NR_removexattr 5189
191#define __NR_lremovexattr 5190
192#define __NR_fremovexattr 5191
193#define __NR_tkill 5192
194#define __NR_reserved193 5193
195#define __NR_futex 5194
196#define __NR_sched_setaffinity 5195
197#define __NR_sched_getaffinity 5196
198#define __NR_cacheflush 5197
199#define __NR_cachectl 5198
200#define __NR_sysmips 5199
201#define __NR_io_setup 5200
202#define __NR_io_destroy 5201
203#define __NR_io_getevents 5202
204#define __NR_io_submit 5203
205#define __NR_io_cancel 5204
206#define __NR_exit_group 5205
207#define __NR_lookup_dcookie 5206
208#define __NR_epoll_create 5207
209#define __NR_epoll_ctl 5208
210#define __NR_epoll_wait 5209
211#define __NR_remap_file_pages 5210
212#define __NR_rt_sigreturn 5211
213#define __NR_set_tid_address 5212
214#define __NR_restart_syscall 5213
215#define __NR_semtimedop 5214
216#define __NR_fadvise64 5215
217#define __NR_timer_create 5216
218#define __NR_timer_settime 5217
219#define __NR_timer_gettime 5218
220#define __NR_timer_getoverrun 5219
221#define __NR_timer_delete 5220
222#define __NR_clock_settime 5221
223#define __NR_clock_gettime 5222
224#define __NR_clock_getres 5223
225#define __NR_clock_nanosleep 5224
226#define __NR_tgkill 5225
227#define __NR_utimes 5226
228#define __NR_mbind 5227
229#define __NR_get_mempolicy 5228
230#define __NR_set_mempolicy 5229
231#define __NR_mq_open 5230
232#define __NR_mq_unlink 5231
233#define __NR_mq_timedsend 5232
234#define __NR_mq_timedreceive 5233
235#define __NR_mq_notify 5234
236#define __NR_mq_getsetattr 5235
237#define __NR_vserver 5236
238#define __NR_waitid 5237
239#define __NR_add_key 5239
240#define __NR_request_key 5240
241#define __NR_keyctl 5241
242#define __NR_set_thread_area 5242
243#define __NR_inotify_init 5243
244#define __NR_inotify_add_watch 5244
245#define __NR_inotify_rm_watch 5245
246#define __NR_migrate_pages 5246
247#define __NR_openat 5247
248#define __NR_mkdirat 5248
249#define __NR_mknodat 5249
250#define __NR_fchownat 5250
251#define __NR_futimesat 5251
252#define __NR_newfstatat 5252
253#define __NR_unlinkat 5253
254#define __NR_renameat 5254
255#define __NR_linkat 5255
256#define __NR_symlinkat 5256
257#define __NR_readlinkat 5257
258#define __NR_fchmodat 5258
259#define __NR_faccessat 5259
260#define __NR_pselect6 5260
261#define __NR_ppoll 5261
262#define __NR_unshare 5262
263#define __NR_splice 5263
264#define __NR_sync_file_range 5264
265#define __NR_tee 5265
266#define __NR_vmsplice 5266
267#define __NR_move_pages 5267
268#define __NR_set_robust_list 5268
269#define __NR_get_robust_list 5269
270#define __NR_kexec_load 5270
271#define __NR_getcpu 5271
272#define __NR_epoll_pwait 5272
273#define __NR_ioprio_set 5273
274#define __NR_ioprio_get 5274
275#define __NR_utimensat 5275
276#define __NR_signalfd 5276
277#define __NR_timerfd 5277
278#define __NR_eventfd 5278
279#define __NR_fallocate 5279
280#define __NR_timerfd_create 5280
281#define __NR_timerfd_gettime 5281
282#define __NR_timerfd_settime 5282
283#define __NR_signalfd4 5283
284#define __NR_eventfd2 5284
285#define __NR_epoll_create1 5285
286#define __NR_dup3 5286
287#define __NR_pipe2 5287
288#define __NR_inotify_init1 5288
289#define __NR_preadv 5289
290#define __NR_pwritev 5290
291#define __NR_rt_tgsigqueueinfo 5291
292#define __NR_perf_event_open 5292
293#define __NR_accept4 5293
294#define __NR_recvmmsg 5294
295#define __NR_fanotify_init 5295
296#define __NR_fanotify_mark 5296
297#define __NR_prlimit64 5297
298#define __NR_name_to_handle_at 5298
299#define __NR_open_by_handle_at 5299
300#define __NR_clock_adjtime 5300
301#define __NR_syncfs 5301
302#define __NR_sendmmsg 5302
303#define __NR_setns 5303
304#define __NR_process_vm_readv 5304
305#define __NR_process_vm_writev 5305
306#define __NR_kcmp 5306
307#define __NR_finit_module 5307
308#define __NR_getdents64 5308
309#define __NR_sched_setattr 5309
310#define __NR_sched_getattr 5310
311#define __NR_renameat2 5311
312#define __NR_seccomp 5312
313#define __NR_getrandom 5313
314#define __NR_memfd_create 5314
315#define __NR_bpf 5315
316#define __NR_execveat 5316
317#define __NR_userfaultfd 5317
318#define __NR_membarrier 5318
319#define __NR_mlock2 5319
320#define __NR_copy_file_range 5320
321#define __NR_preadv2 5321
322#define __NR_pwritev2 5322
323#define __NR_pkey_mprotect 5323
324#define __NR_pkey_alloc 5324
325#define __NR_pkey_free 5325
326#define __NR_statx 5326
327#define __NR_rseq 4327
328#define __NR_io_pgetevents 4328
329
330#define SYS_read 5000
331#define SYS_write 5001
332#define SYS_open 5002
333#define SYS_close 5003
334#define SYS_stat 5004
335#define SYS_fstat 5005
336#define SYS_lstat 5006
337#define SYS_poll 5007
338#define SYS_lseek 5008
339#define SYS_mmap 5009
340#define SYS_mprotect 5010
341#define SYS_munmap 5011
342#define SYS_brk 5012
343#define SYS_rt_sigaction 5013
344#define SYS_rt_sigprocmask 5014
345#define SYS_ioctl 5015
346#define SYS_pread64 5016
347#define SYS_pwrite64 5017
348#define SYS_readv 5018
349#define SYS_writev 5019
350#define SYS_access 5020
351#define SYS_pipe 5021
352#define SYS__newselect 5022
353#define SYS_sched_yield 5023
354#define SYS_mremap 5024
355#define SYS_msync 5025
356#define SYS_mincore 5026
357#define SYS_madvise 5027
358#define SYS_shmget 5028
359#define SYS_shmat 5029
360#define SYS_shmctl 5030
361#define SYS_dup 5031
362#define SYS_dup2 5032
363#define SYS_pause 5033
364#define SYS_nanosleep 5034
365#define SYS_getitimer 5035
366#define SYS_setitimer 5036
367#define SYS_alarm 5037
368#define SYS_getpid 5038
369#define SYS_sendfile 5039
370#define SYS_socket 5040
371#define SYS_connect 5041
372#define SYS_accept 5042
373#define SYS_sendto 5043
374#define SYS_recvfrom 5044
375#define SYS_sendmsg 5045
376#define SYS_recvmsg 5046
377#define SYS_shutdown 5047
378#define SYS_bind 5048
379#define SYS_listen 5049
380#define SYS_getsockname 5050
381#define SYS_getpeername 5051
382#define SYS_socketpair 5052
383#define SYS_setsockopt 5053
384#define SYS_getsockopt 5054
385#define SYS_clone 5055
386#define SYS_fork 5056
387#define SYS_execve 5057
388#define SYS_exit 5058
389#define SYS_wait4 5059
390#define SYS_kill 5060
391#define SYS_uname 5061
392#define SYS_semget 5062
393#define SYS_semop 5063
394#define SYS_semctl 5064
395#define SYS_shmdt 5065
396#define SYS_msgget 5066
397#define SYS_msgsnd 5067
398#define SYS_msgrcv 5068
399#define SYS_msgctl 5069
400#define SYS_fcntl 5070
401#define SYS_flock 5071
402#define SYS_fsync 5072
403#define SYS_fdatasync 5073
404#define SYS_truncate 5074
405#define SYS_ftruncate 5075
406#define SYS_getdents 5076
407#define SYS_getcwd 5077
408#define SYS_chdir 5078
409#define SYS_fchdir 5079
410#define SYS_rename 5080
411#define SYS_mkdir 5081
412#define SYS_rmdir 5082
413#define SYS_creat 5083
414#define SYS_link 5084
415#define SYS_unlink 5085
416#define SYS_symlink 5086
417#define SYS_readlink 5087
418#define SYS_chmod 5088
419#define SYS_fchmod 5089
420#define SYS_chown 5090
421#define SYS_fchown 5091
422#define SYS_lchown 5092
423#define SYS_umask 5093
424#define SYS_gettimeofday 5094
425#define SYS_getrlimit 5095
426#define SYS_getrusage 5096
427#define SYS_sysinfo 5097
428#define SYS_times 5098
429#define SYS_ptrace 5099
430#define SYS_getuid 5100
431#define SYS_syslog 5101
432#define SYS_getgid 5102
433#define SYS_setuid 5103
434#define SYS_setgid 5104
435#define SYS_geteuid 5105
436#define SYS_getegid 5106
437#define SYS_setpgid 5107
438#define SYS_getppid 5108
439#define SYS_getpgrp 5109
440#define SYS_setsid 5110
441#define SYS_setreuid 5111
442#define SYS_setregid 5112
443#define SYS_getgroups 5113
444#define SYS_setgroups 5114
445#define SYS_setresuid 5115
446#define SYS_getresuid 5116
447#define SYS_setresgid 5117
448#define SYS_getresgid 5118
449#define SYS_getpgid 5119
450#define SYS_setfsuid 5120
451#define SYS_setfsgid 5121
452#define SYS_getsid 5122
453#define SYS_capget 5123
454#define SYS_capset 5124
455#define SYS_rt_sigpending 5125
456#define SYS_rt_sigtimedwait 5126
457#define SYS_rt_sigqueueinfo 5127
458#define SYS_rt_sigsuspend 5128
459#define SYS_sigaltstack 5129
460#define SYS_utime 5130
461#define SYS_mknod 5131
462#define SYS_personality 5132
463#define SYS_ustat 5133
464#define SYS_statfs 5134
465#define SYS_fstatfs 5135
466#define SYS_sysfs 5136
467#define SYS_getpriority 5137
468#define SYS_setpriority 5138
469#define SYS_sched_setparam 5139
470#define SYS_sched_getparam 5140
471#define SYS_sched_setscheduler 5141
472#define SYS_sched_getscheduler 5142
473#define SYS_sched_get_priority_max 5143
474#define SYS_sched_get_priority_min 5144
475#define SYS_sched_rr_get_interval 5145
476#define SYS_mlock 5146
477#define SYS_munlock 5147
478#define SYS_mlockall 5148
479#define SYS_munlockall 5149
480#define SYS_vhangup 5150
481#define SYS_pivot_root 5151
482#define SYS__sysctl 5152
483#define SYS_prctl 5153
484#define SYS_adjtimex 5154
485#define SYS_setrlimit 5155
486#define SYS_chroot 5156
487#define SYS_sync 5157
488#define SYS_acct 5158
489#define SYS_settimeofday 5159
490#define SYS_mount 5160
491#define SYS_umount2 5161
492#define SYS_swapon 5162
493#define SYS_swapoff 5163
494#define SYS_reboot 5164
495#define SYS_sethostname 5165
496#define SYS_setdomainname 5166
497#define SYS_create_module 5167
498#define SYS_init_module 5168
499#define SYS_delete_module 5169
500#define SYS_get_kernel_syms 5170
501#define SYS_query_module 5171
502#define SYS_quotactl 5172
503#define SYS_nfsservctl 5173
504#define SYS_getpmsg 5174
505#define SYS_putpmsg 5175
506#define SYS_afs_syscall 5176
507#define SYS_reserved177 5177
508#define SYS_gettid 5178
509#define SYS_readahead 5179
510#define SYS_setxattr 5180
511#define SYS_lsetxattr 5181
512#define SYS_fsetxattr 5182
513#define SYS_getxattr 5183
514#define SYS_lgetxattr 5184
515#define SYS_fgetxattr 5185
516#define SYS_listxattr 5186
517#define SYS_llistxattr 5187
518#define SYS_flistxattr 5188
519#define SYS_removexattr 5189
520#define SYS_lremovexattr 5190
521#define SYS_fremovexattr 5191
522#define SYS_tkill 5192
523#define SYS_reserved193 5193
524#define SYS_futex 5194
525#define SYS_sched_setaffinity 5195
526#define SYS_sched_getaffinity 5196
527#define SYS_cacheflush 5197
528#define SYS_cachectl 5198
529#define SYS_sysmips 5199
530#define SYS_io_setup 5200
531#define SYS_io_destroy 5201
532#define SYS_io_getevents 5202
533#define SYS_io_submit 5203
534#define SYS_io_cancel 5204
535#define SYS_exit_group 5205
536#define SYS_lookup_dcookie 5206
537#define SYS_epoll_create 5207
538#define SYS_epoll_ctl 5208
539#define SYS_epoll_wait 5209
540#define SYS_remap_file_pages 5210
541#define SYS_rt_sigreturn 5211
542#define SYS_set_tid_address 5212
543#define SYS_restart_syscall 5213
544#define SYS_semtimedop 5214
545#define SYS_fadvise64 5215
546#define SYS_timer_create 5216
547#define SYS_timer_settime 5217
548#define SYS_timer_gettime 5218
549#define SYS_timer_getoverrun 5219
550#define SYS_timer_delete 5220
551#define SYS_clock_settime 5221
552#define SYS_clock_gettime 5222
553#define SYS_clock_getres 5223
554#define SYS_clock_nanosleep 5224
555#define SYS_tgkill 5225
556#define SYS_utimes 5226
557#define SYS_mbind 5227
558#define SYS_get_mempolicy 5228
559#define SYS_set_mempolicy 5229
560#define SYS_mq_open 5230
561#define SYS_mq_unlink 5231
562#define SYS_mq_timedsend 5232
563#define SYS_mq_timedreceive 5233
564#define SYS_mq_notify 5234
565#define SYS_mq_getsetattr 5235
566#define SYS_vserver 5236
567#define SYS_waitid 5237
568#define SYS_add_key 5239
569#define SYS_request_key 5240
570#define SYS_keyctl 5241
571#define SYS_set_thread_area 5242
572#define SYS_inotify_init 5243
573#define SYS_inotify_add_watch 5244
574#define SYS_inotify_rm_watch 5245
575#define SYS_migrate_pages 5246
576#define SYS_openat 5247
577#define SYS_mkdirat 5248
578#define SYS_mknodat 5249
579#define SYS_fchownat 5250
580#define SYS_futimesat 5251
581#define SYS_newfstatat 5252
582#define SYS_unlinkat 5253
583#define SYS_renameat 5254
584#define SYS_linkat 5255
585#define SYS_symlinkat 5256
586#define SYS_readlinkat 5257
587#define SYS_fchmodat 5258
588#define SYS_faccessat 5259
589#define SYS_pselect6 5260
590#define SYS_ppoll 5261
591#define SYS_unshare 5262
592#define SYS_splice 5263
593#define SYS_sync_file_range 5264
594#define SYS_tee 5265
595#define SYS_vmsplice 5266
596#define SYS_move_pages 5267
597#define SYS_set_robust_list 5268
598#define SYS_get_robust_list 5269
599#define SYS_kexec_load 5270
600#define SYS_getcpu 5271
601#define SYS_epoll_pwait 5272
602#define SYS_ioprio_set 5273
603#define SYS_ioprio_get 5274
604#define SYS_utimensat 5275
605#define SYS_signalfd 5276
606#define SYS_timerfd 5277
607#define SYS_eventfd 5278
608#define SYS_fallocate 5279
609#define SYS_timerfd_create 5280
610#define SYS_timerfd_gettime 5281
611#define SYS_timerfd_settime 5282
612#define SYS_signalfd4 5283
613#define SYS_eventfd2 5284
614#define SYS_epoll_create1 5285
615#define SYS_dup3 5286
616#define SYS_pipe2 5287
617#define SYS_inotify_init1 5288
618#define SYS_preadv 5289
619#define SYS_pwritev 5290
620#define SYS_rt_tgsigqueueinfo 5291
621#define SYS_perf_event_open 5292
622#define SYS_accept4 5293
623#define SYS_recvmmsg 5294
624#define SYS_fanotify_init 5295
625#define SYS_fanotify_mark 5296
626#define SYS_prlimit64 5297
627#define SYS_name_to_handle_at 5298
628#define SYS_open_by_handle_at 5299
629#define SYS_clock_adjtime 5300
630#define SYS_syncfs 5301
631#define SYS_sendmmsg 5302
632#define SYS_setns 5303
633#define SYS_process_vm_readv 5304
634#define SYS_process_vm_writev 5305
635#define SYS_kcmp 5306
636#define SYS_finit_module 5307
637#define SYS_getdents64 5308
638#define SYS_sched_setattr 5309
639#define SYS_sched_getattr 5310
640#define SYS_renameat2 5311
641#define SYS_seccomp 5312
642#define SYS_getrandom 5313
643#define SYS_memfd_create 5314
644#define SYS_bpf 5315
645#define SYS_execveat 5316
646#define SYS_userfaultfd 5317
647#define SYS_membarrier 5318
648#define SYS_mlock2 5319
649#define SYS_copy_file_range 5320
650#define SYS_preadv2 5321
651#define SYS_pwritev2 5322
652#define SYS_pkey_mprotect 5323
653#define SYS_pkey_alloc 5324
654#define SYS_pkey_free 5325
655#define SYS_statx 5326
656#define SYS_rseq 4327
657#define SYS_io_pgetevents 4328
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/termios.h+1-1
...@@ -165,5 +165,5 @@ struct termios {...@@ -165,5 +165,5 @@ struct termios {
165#define EXTPROC 0200000165#define EXTPROC 0200000
166166
167#define XTABS 0014000167#define XTABS 0014000
168#define TIOCSER_TEMT 0x01168#define TIOCSER_TEMT 1
169#endif169#endif
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for mips64el-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/alltypes.h deleted-391
...@@ -1,391 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
53typedef unsigned nlink_t;
54#define __DEFINED_nlink_t
55#endif
56
57
58#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
59typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
60#define __DEFINED_pthread_attr_t
61#endif
62
63#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
64typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
65#define __DEFINED_pthread_mutex_t
66#endif
67
68#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
69typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
70#define __DEFINED_mtx_t
71#endif
72
73#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
74typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
75#define __DEFINED_pthread_cond_t
76#endif
77
78#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
79typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
80#define __DEFINED_cnd_t
81#endif
82
83#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
84typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
85#define __DEFINED_pthread_rwlock_t
86#endif
87
88#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
89typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
90#define __DEFINED_pthread_barrier_t
91#endif
92
93#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
94typedef unsigned _Addr size_t;
95#define __DEFINED_size_t
96#endif
97
98#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
99typedef unsigned _Addr uintptr_t;
100#define __DEFINED_uintptr_t
101#endif
102
103#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
104typedef _Addr ptrdiff_t;
105#define __DEFINED_ptrdiff_t
106#endif
107
108#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
109typedef _Addr ssize_t;
110#define __DEFINED_ssize_t
111#endif
112
113#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
114typedef _Addr intptr_t;
115#define __DEFINED_intptr_t
116#endif
117
118#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
119typedef _Addr regoff_t;
120#define __DEFINED_regoff_t
121#endif
122
123#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
124typedef _Reg register_t;
125#define __DEFINED_register_t
126#endif
127
128
129#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
130typedef signed char int8_t;
131#define __DEFINED_int8_t
132#endif
133
134#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
135typedef signed short int16_t;
136#define __DEFINED_int16_t
137#endif
138
139#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
140typedef signed int int32_t;
141#define __DEFINED_int32_t
142#endif
143
144#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
145typedef signed _Int64 int64_t;
146#define __DEFINED_int64_t
147#endif
148
149#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
150typedef signed _Int64 intmax_t;
151#define __DEFINED_intmax_t
152#endif
153
154#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
155typedef unsigned char uint8_t;
156#define __DEFINED_uint8_t
157#endif
158
159#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
160typedef unsigned short uint16_t;
161#define __DEFINED_uint16_t
162#endif
163
164#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
165typedef unsigned int uint32_t;
166#define __DEFINED_uint32_t
167#endif
168
169#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
170typedef unsigned _Int64 uint64_t;
171#define __DEFINED_uint64_t
172#endif
173
174#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
175typedef unsigned _Int64 u_int64_t;
176#define __DEFINED_u_int64_t
177#endif
178
179#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
180typedef unsigned _Int64 uintmax_t;
181#define __DEFINED_uintmax_t
182#endif
183
184
185#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
186typedef unsigned mode_t;
187#define __DEFINED_mode_t
188#endif
189
190#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
191typedef unsigned _Reg nlink_t;
192#define __DEFINED_nlink_t
193#endif
194
195#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
196typedef _Int64 off_t;
197#define __DEFINED_off_t
198#endif
199
200#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
201typedef unsigned _Int64 ino_t;
202#define __DEFINED_ino_t
203#endif
204
205#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
206typedef unsigned _Int64 dev_t;
207#define __DEFINED_dev_t
208#endif
209
210#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
211typedef long blksize_t;
212#define __DEFINED_blksize_t
213#endif
214
215#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
216typedef _Int64 blkcnt_t;
217#define __DEFINED_blkcnt_t
218#endif
219
220#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
221typedef unsigned _Int64 fsblkcnt_t;
222#define __DEFINED_fsblkcnt_t
223#endif
224
225#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
226typedef unsigned _Int64 fsfilcnt_t;
227#define __DEFINED_fsfilcnt_t
228#endif
229
230
231#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
232typedef unsigned wint_t;
233#define __DEFINED_wint_t
234#endif
235
236#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
237typedef unsigned long wctype_t;
238#define __DEFINED_wctype_t
239#endif
240
241
242#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
243typedef void * timer_t;
244#define __DEFINED_timer_t
245#endif
246
247#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
248typedef int clockid_t;
249#define __DEFINED_clockid_t
250#endif
251
252#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
253typedef long clock_t;
254#define __DEFINED_clock_t
255#endif
256
257#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
258struct timeval { time_t tv_sec; suseconds_t tv_usec; };
259#define __DEFINED_struct_timeval
260#endif
261
262#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
263struct timespec { time_t tv_sec; long tv_nsec; };
264#define __DEFINED_struct_timespec
265#endif
266
267
268#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
269typedef int pid_t;
270#define __DEFINED_pid_t
271#endif
272
273#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
274typedef unsigned id_t;
275#define __DEFINED_id_t
276#endif
277
278#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
279typedef unsigned uid_t;
280#define __DEFINED_uid_t
281#endif
282
283#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
284typedef unsigned gid_t;
285#define __DEFINED_gid_t
286#endif
287
288#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
289typedef int key_t;
290#define __DEFINED_key_t
291#endif
292
293#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
294typedef unsigned useconds_t;
295#define __DEFINED_useconds_t
296#endif
297
298
299#ifdef __cplusplus
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef unsigned long pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#else
306#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
307typedef struct __pthread * pthread_t;
308#define __DEFINED_pthread_t
309#endif
310
311#endif
312#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
313typedef int pthread_once_t;
314#define __DEFINED_pthread_once_t
315#endif
316
317#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
318typedef unsigned pthread_key_t;
319#define __DEFINED_pthread_key_t
320#endif
321
322#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
323typedef int pthread_spinlock_t;
324#define __DEFINED_pthread_spinlock_t
325#endif
326
327#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
328typedef struct { unsigned __attr; } pthread_mutexattr_t;
329#define __DEFINED_pthread_mutexattr_t
330#endif
331
332#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
333typedef struct { unsigned __attr; } pthread_condattr_t;
334#define __DEFINED_pthread_condattr_t
335#endif
336
337#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
338typedef struct { unsigned __attr; } pthread_barrierattr_t;
339#define __DEFINED_pthread_barrierattr_t
340#endif
341
342#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
343typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
344#define __DEFINED_pthread_rwlockattr_t
345#endif
346
347
348#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
349typedef struct _IO_FILE FILE;
350#define __DEFINED_FILE
351#endif
352
353
354#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
355typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
356#define __DEFINED_mbstate_t
357#endif
358
359
360#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
361typedef struct __locale_struct * locale_t;
362#define __DEFINED_locale_t
363#endif
364
365
366#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
367typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
368#define __DEFINED_sigset_t
369#endif
370
371
372#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
373struct iovec { void *iov_base; size_t iov_len; };
374#define __DEFINED_struct_iovec
375#endif
376
377
378#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
379typedef unsigned socklen_t;
380#define __DEFINED_socklen_t
381#endif
382
383#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
384typedef unsigned short sa_family_t;
385#define __DEFINED_sa_family_t
386#endif
387
388
389#undef _Addr
390#undef _Int64
391#undef _Reg
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if _MIPSEL || __MIPSEL || __MIPSEL__
2#define __BYTE_ORDER __LITTLE_ENDIAN
3#else
4#define __BYTE_ORDER __BIG_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define ENOMSG 35
36#define EIDRM 36
37#define ECHRNG 37
38#define EL2NSYNC 38
39#define EL3HLT 39
40#define EL3RST 40
41#define ELNRNG 41
42#define EUNATCH 42
43#define ENOCSI 43
44#define EL2HLT 44
45#define EDEADLK 45
46#define ENOLCK 46
47#define EBADE 50
48#define EBADR 51
49#define EXFULL 52
50#define ENOANO 53
51#define EBADRQC 54
52#define EBADSLT 55
53#define EDEADLOCK 56
54#define EBFONT 59
55#define ENOSTR 60
56#define ENODATA 61
57#define ETIME 62
58#define ENOSR 63
59#define ENONET 64
60#define ENOPKG 65
61#define EREMOTE 66
62#define ENOLINK 67
63#define EADV 68
64#define ESRMNT 69
65#define ECOMM 70
66#define EPROTO 71
67#define EDOTDOT 73
68#define EMULTIHOP 74
69#define EBADMSG 77
70#define ENAMETOOLONG 78
71#define EOVERFLOW 79
72#define ENOTUNIQ 80
73#define EBADFD 81
74#define EREMCHG 82
75#define ELIBACC 83
76#define ELIBBAD 84
77#define ELIBSCN 85
78#define ELIBMAX 86
79#define ELIBEXEC 87
80#define EILSEQ 88
81#define ENOSYS 89
82#define ELOOP 90
83#define ERESTART 91
84#define ESTRPIPE 92
85#define ENOTEMPTY 93
86#define EUSERS 94
87#define ENOTSOCK 95
88#define EDESTADDRREQ 96
89#define EMSGSIZE 97
90#define EPROTOTYPE 98
91#define ENOPROTOOPT 99
92#define EPROTONOSUPPORT 120
93#define ESOCKTNOSUPPORT 121
94#define EOPNOTSUPP 122
95#define ENOTSUP EOPNOTSUPP
96#define EPFNOSUPPORT 123
97#define EAFNOSUPPORT 124
98#define EADDRINUSE 125
99#define EADDRNOTAVAIL 126
100#define ENETDOWN 127
101#define ENETUNREACH 128
102#define ENETRESET 129
103#define ECONNABORTED 130
104#define ECONNRESET 131
105#define ENOBUFS 132
106#define EISCONN 133
107#define ENOTCONN 134
108#define EUCLEAN 135
109#define ENOTNAM 137
110#define ENAVAIL 138
111#define EISNAM 139
112#define EREMOTEIO 140
113#define ESHUTDOWN 143
114#define ETOOMANYREFS 144
115#define ETIMEDOUT 145
116#define ECONNREFUSED 146
117#define EHOSTDOWN 147
118#define EHOSTUNREACH 148
119#define EWOULDBLOCK EAGAIN
120#define EALREADY 149
121#define EINPROGRESS 150
122#define ESTALE 151
123#define ECANCELED 158
124#define ENOMEDIUM 159
125#define EMEDIUMTYPE 160
126#define ENOKEY 161
127#define EKEYEXPIRED 162
128#define EKEYREVOKED 163
129#define EKEYREJECTED 164
130#define EOWNERDEAD 165
131#define ENOTRECOVERABLE 166
132#define ERFKILL 167
133#define EHWPOISON 168
134#define EDQUOT 1133
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0400
2#define O_EXCL 02000
3#define O_NOCTTY 04000
4#define O_TRUNC 01000
5#define O_APPEND 0010
6#define O_NONBLOCK 0200
7#define O_DSYNC 0020
8#define O_SYNC 040020
9#define O_RSYNC 040020
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 010000
15#define O_DIRECT 0100000
16#define O_LARGEFILE 0
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 24
29#define F_GETOWN 23
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 14
34#define F_SETLK 6
35#define F_SETLKW 7
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/fenv.h deleted-25
...@@ -1,25 +0,0 @@
1#ifdef __mips_soft_float
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INEXACT 4
6#define FE_UNDERFLOW 8
7#define FE_OVERFLOW 16
8#define FE_DIVBYZERO 32
9#define FE_INVALID 64
10
11#define FE_ALL_EXCEPT 124
12
13#define FE_TONEAREST 0
14#define FE_TOWARDZERO 1
15#define FE_UPWARD 2
16#define FE_DOWNWARD 3
17#endif
18
19typedef unsigned short fexcept_t;
20
21typedef struct {
22 unsigned __cw;
23} fenv_t;
24
25#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/hwcap.h deleted-3
...@@ -1,3 +0,0 @@
1#define HWCAP_MIPS_R6 (1 << 0)
2#define HWCAP_MIPS_MSA (1 << 1)
3#define HWCAP_MIPS_CRC32 (1 << 2)
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/ioctl.h deleted-212
...@@ -1,212 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_READ 2U
4#define _IOC_WRITE 4U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define TCGETA 0x5401
12#define TCSETA 0x5402
13#define TCSETAW 0x5403
14#define TCSETAF 0x5404
15#define TCSBRK 0x5405
16#define TCXONC 0x5406
17#define TCFLSH 0x5407
18#define TCGETS 0x540D
19#define TCSETS 0x540E
20#define TCSETSW 0x540F
21#define TCSETSF 0x5410
22
23#define TIOCEXCL 0x740D
24#define TIOCNXCL 0x740E
25#define TIOCOUTQ 0x7472
26#define TIOCSTI 0x5472
27#define TIOCMGET 0x741D
28#define TIOCMBIS 0x741B
29#define TIOCMBIC 0x741C
30#define TIOCMSET 0x741A
31
32#define TIOCPKT 0x5470
33#define TIOCSWINSZ _IOW('t', 103, struct winsize)
34#define TIOCGWINSZ _IOR('t', 104, struct winsize)
35#define TIOCNOTTY 0x5471
36#define TIOCSETD 0x7401
37#define TIOCGETD 0x7400
38
39#define FIOCLEX 0x6601
40#define FIONCLEX 0x6602
41#define FIOASYNC 0x667D
42#define FIONBIO 0x667E
43#define FIOQSIZE 0x667F
44
45#define TIOCGLTC 0x7474
46#define TIOCSLTC 0x7475
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49#define TIOCCONS _IOW('t', 120, int)
50
51#define FIONREAD 0x467F
52#define TIOCINQ FIONREAD
53
54#define TIOCGETP 0x7408
55#define TIOCSETP 0x7409
56#define TIOCSETN 0x740A
57
58#define TIOCSBRK 0x5427
59#define TIOCCBRK 0x5428
60#define TIOCGSID 0x7416
61#define TIOCGRS485 _IOR('T', 0x2E, char[32])
62#define TIOCSRS485 _IOWR('T', 0x2F, char[32])
63#define TIOCGPTN _IOR('T', 0x30, unsigned int)
64#define TIOCSPTLCK _IOW('T', 0x31, int)
65#define TIOCGDEV _IOR('T', 0x32, unsigned int)
66#define TIOCSIG _IOW('T', 0x36, int)
67#define TIOCVHANGUP 0x5437
68#define TIOCGPKT _IOR('T', 0x38, int)
69#define TIOCGPTLCK _IOR('T', 0x39, int)
70#define TIOCGEXCL _IOR('T', 0x40, int)
71#define TIOCGPTPEER _IO('T', 0x41)
72
73#define TIOCSCTTY 0x5480
74#define TIOCGSOFTCAR 0x5481
75#define TIOCSSOFTCAR 0x5482
76#define TIOCLINUX 0x5483
77#define TIOCGSERIAL 0x5484
78#define TIOCSSERIAL 0x5485
79#define TCSBRKP 0x5486
80
81#define TIOCSERCONFIG 0x5488
82#define TIOCSERGWILD 0x5489
83#define TIOCSERSWILD 0x548A
84#define TIOCGLCKTRMIOS 0x548B
85#define TIOCSLCKTRMIOS 0x548C
86#define TIOCSERGSTRUCT 0x548D
87#define TIOCSERGETLSR 0x548E
88#define TIOCSERGETMULTI 0x548F
89#define TIOCSERSETMULTI 0x5490
90#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x5492
92
93#define TIOCPKT_DATA 0
94#define TIOCPKT_FLUSHREAD 1
95#define TIOCPKT_FLUSHWRITE 2
96#define TIOCPKT_STOP 4
97#define TIOCPKT_START 8
98#define TIOCPKT_NOSTOP 16
99#define TIOCPKT_DOSTOP 32
100#define TIOCPKT_IOCTL 64
101
102#define TIOCSER_TEMT 0x01
103
104struct winsize {
105 unsigned short ws_row;
106 unsigned short ws_col;
107 unsigned short ws_xpixel;
108 unsigned short ws_ypixel;
109};
110
111#define TIOCM_LE 0x001
112#define TIOCM_DTR 0x002
113#define TIOCM_RTS 0x004
114#define TIOCM_ST 0x010
115#define TIOCM_SR 0x020
116#define TIOCM_CTS 0x040
117#define TIOCM_CAR 0x100
118#define TIOCM_CD TIOCM_CAR
119#define TIOCM_RNG 0x200
120#define TIOCM_RI TIOCM_RNG
121#define TIOCM_DSR 0x400
122#define TIOCM_OUT1 0x2000
123#define TIOCM_OUT2 0x4000
124#define TIOCM_LOOP 0x8000
125
126#define N_TTY 0
127#define N_SLIP 1
128#define N_MOUSE 2
129#define N_PPP 3
130#define N_STRIP 4
131#define N_AX25 5
132#define N_X25 6
133#define N_6PACK 7
134#define N_MASC 8
135#define N_R3964 9
136#define N_PROFIBUS_FDL 10
137#define N_IRDA 11
138#define N_SMSBLOCK 12
139#define N_HDLC 13
140#define N_SYNC_PPP 14
141#define N_HCI 15
142
143#define FIOGETOWN _IOR('f', 123, int)
144#define FIOSETOWN _IOW('f', 124, int)
145#define SIOCATMARK _IOR('s', 7, int)
146#define SIOCSPGRP _IOW('s', 8, pid_t)
147#define SIOCGPGRP _IOR('s', 9, pid_t)
148#define SIOCGSTAMP 0x8906
149#define SIOCGSTAMPNS 0x8907
150
151#define SIOCADDRT 0x890B
152#define SIOCDELRT 0x890C
153#define SIOCRTMSG 0x890D
154
155#define SIOCGIFNAME 0x8910
156#define SIOCSIFLINK 0x8911
157#define SIOCGIFCONF 0x8912
158#define SIOCGIFFLAGS 0x8913
159#define SIOCSIFFLAGS 0x8914
160#define SIOCGIFADDR 0x8915
161#define SIOCSIFADDR 0x8916
162#define SIOCGIFDSTADDR 0x8917
163#define SIOCSIFDSTADDR 0x8918
164#define SIOCGIFBRDADDR 0x8919
165#define SIOCSIFBRDADDR 0x891a
166#define SIOCGIFNETMASK 0x891b
167#define SIOCSIFNETMASK 0x891c
168#define SIOCGIFMETRIC 0x891d
169#define SIOCSIFMETRIC 0x891e
170#define SIOCGIFMEM 0x891f
171#define SIOCSIFMEM 0x8920
172#define SIOCGIFMTU 0x8921
173#define SIOCSIFMTU 0x8922
174#define SIOCSIFNAME 0x8923
175#define SIOCSIFHWADDR 0x8924
176#define SIOCGIFENCAP 0x8925
177#define SIOCSIFENCAP 0x8926
178#define SIOCGIFHWADDR 0x8927
179#define SIOCGIFSLAVE 0x8929
180#define SIOCSIFSLAVE 0x8930
181#define SIOCADDMULTI 0x8931
182#define SIOCDELMULTI 0x8932
183#define SIOCGIFINDEX 0x8933
184#define SIOGIFINDEX SIOCGIFINDEX
185#define SIOCSIFPFLAGS 0x8934
186#define SIOCGIFPFLAGS 0x8935
187#define SIOCDIFADDR 0x8936
188#define SIOCSIFHWBROADCAST 0x8937
189#define SIOCGIFCOUNT 0x8938
190
191#define SIOCGIFBR 0x8940
192#define SIOCSIFBR 0x8941
193
194#define SIOCGIFTXQLEN 0x8942
195#define SIOCSIFTXQLEN 0x8943
196
197#define SIOCDARP 0x8953
198#define SIOCGARP 0x8954
199#define SIOCSARP 0x8955
200
201#define SIOCDRARP 0x8960
202#define SIOCGRARP 0x8961
203#define SIOCSRARP 0x8962
204
205#define SIOCGIFMAP 0x8970
206#define SIOCSIFMAP 0x8971
207
208#define SIOCADDDLCI 0x8980
209#define SIOCDELDLCI 0x8981
210
211#define SIOCDEVPRIVATE 0x89F0
212#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/ipc.h deleted-14
...@@ -1,14 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 int __ipc_perm_seq;
9 int __pad1;
10 unsigned long __unused1;
11 unsigned long __unused2;
12};
13
14#define IPC_64 0x100
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/limits.h deleted-7
...@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/mman.h deleted-25
...@@ -1,25 +0,0 @@
1#undef MAP_ANON
2#define MAP_ANON 0x800
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x0400
5#undef MAP_GROWSDOWN
6#define MAP_GROWSDOWN 0x1000
7#undef MAP_DENYWRITE
8#define MAP_DENYWRITE 0x2000
9#undef MAP_EXECUTABLE
10#define MAP_EXECUTABLE 0x4000
11#undef MAP_LOCKED
12#define MAP_LOCKED 0x8000
13#undef MAP_POPULATE
14#define MAP_POPULATE 0x10000
15#undef MAP_NONBLOCK
16#define MAP_NONBLOCK 0x20000
17#undef MAP_STACK
18#define MAP_STACK 0x40000
19#undef MAP_HUGETLB
20#define MAP_HUGETLB 0x80000
21#undef MAP_SYNC
22
23#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
24#undef MADV_SOFT_OFFLINE
25#endif
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/poll.h deleted-2
...@@ -1,2 +0,0 @@
1#define POLLWRNORM POLLOUT
2#define POLLWRBAND 0x100
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFFBIG 1
2#define _POSIX_V7_LP64_OFFBIG 1
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/ptrace.h deleted-9
...@@ -1,9 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_PEEKTEXT_3264 0xc0
4#define PTRACE_PEEKDATA_3264 0xc1
5#define PTRACE_POKETEXT_3264 0xc2
6#define PTRACE_POKEDATA_3264 0xc3
7#define PTRACE_GET_THREAD_AREA_3264 0xc4
8#define PTRACE_GET_WATCH_REGS 0xd0
9#define PTRACE_SET_WATCH_REGS 0xd1
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/reg.h deleted-47
...@@ -1,47 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3
4#define EF_R0 0
5#define EF_R1 1
6#define EF_R2 2
7#define EF_R3 3
8#define EF_R4 4
9#define EF_R5 5
10#define EF_R6 6
11#define EF_R7 7
12#define EF_R8 8
13#define EF_R9 9
14#define EF_R10 10
15#define EF_R11 11
16#define EF_R12 12
17#define EF_R13 13
18#define EF_R14 14
19#define EF_R15 15
20#define EF_R16 16
21#define EF_R17 17
22#define EF_R18 18
23#define EF_R19 19
24#define EF_R20 20
25#define EF_R21 21
26#define EF_R22 22
27#define EF_R23 23
28#define EF_R24 24
29#define EF_R25 25
30
31#define EF_R26 26
32#define EF_R27 27
33#define EF_R28 28
34#define EF_R29 29
35#define EF_R30 30
36#define EF_R31 31
37
38#define EF_LO 32
39#define EF_HI 33
40
41#define EF_CP0_EPC 34
42#define EF_CP0_BADVADDR 35
43#define EF_CP0_STATUS 36
44#define EF_CP0_CAUSE 37
45#define EF_UNUSED0 38
46
47#define EF_SIZE 304
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/resource.h deleted-5
...@@ -1,5 +0,0 @@
1#define RLIMIT_NOFILE 5
2#define RLIMIT_AS 6
3#define RLIMIT_RSS 7
4#define RLIMIT_NPROC 8
5#define RLIMIT_MEMLOCK 9
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/sem.h deleted-14
...@@ -1,14 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 time_t __unused3;
13 time_t __unused4;
14};
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[23];
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/signal.h deleted-143
...@@ -1,143 +0,0 @@
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 unsigned long long greg_t, gregset_t[32];
11
12typedef struct {
13 union {
14 double fp_dregs[32];
15 struct {
16 float _fp_fregs;
17 unsigned _fp_pad;
18 } fp_fregs[32];
19 } fp_r;
20} fpregset_t;
21
22struct sigcontext {
23 unsigned long long sc_regs[32];
24 unsigned long long sc_fpregs[32];
25 unsigned long long sc_mdhi;
26 unsigned long long sc_hi1;
27 unsigned long long sc_hi2;
28 unsigned long long sc_hi3;
29 unsigned long long sc_mdlo;
30 unsigned long long sc_lo1;
31 unsigned long long sc_lo2;
32 unsigned long long sc_lo3;
33 unsigned long long sc_pc;
34 unsigned int sc_fpc_csr;
35 unsigned int sc_used_math;
36 unsigned int sc_dsp;
37 unsigned int sc_reserved;
38};
39
40typedef struct {
41 gregset_t gregs;
42 fpregset_t fpregs;
43 greg_t mdhi;
44 greg_t hi1;
45 greg_t hi2;
46 greg_t hi3;
47 greg_t mdlo;
48 greg_t lo1;
49 greg_t lo2;
50 greg_t lo3;
51 greg_t pc;
52 unsigned int fpc_csr;
53 unsigned int used_math;
54 unsigned int dsp;
55 unsigned int reserved;
56} mcontext_t;
57
58#else
59typedef struct {
60 unsigned long long __mc1[32];
61 double __mc2[32];
62 unsigned long long __mc3[9];
63 unsigned __mc4[4];
64} mcontext_t;
65#endif
66
67struct sigaltstack {
68 void *ss_sp;
69 size_t ss_size;
70 int ss_flags;
71};
72
73typedef struct __ucontext {
74 unsigned long uc_flags;
75 struct __ucontext *uc_link;
76 stack_t uc_stack;
77 mcontext_t uc_mcontext;
78 sigset_t uc_sigmask;
79} ucontext_t;
80
81#define SA_NOCLDSTOP 1
82#define SA_NOCLDWAIT 0x10000
83#define SA_SIGINFO 8
84#define SA_ONSTACK 0x08000000
85#define SA_RESTART 0x10000000
86#define SA_NODEFER 0x40000000
87#define SA_RESETHAND 0x80000000
88#define SA_RESTORER 0x04000000
89
90#undef SIG_BLOCK
91#undef SIG_UNBLOCK
92#undef SIG_SETMASK
93#define SIG_BLOCK 1
94#define SIG_UNBLOCK 2
95#define SIG_SETMASK 3
96
97#undef SI_ASYNCIO
98#undef SI_MESGQ
99#undef SI_TIMER
100#define SI_ASYNCIO (-2)
101#define SI_MESGQ (-4)
102#define SI_TIMER (-3)
103
104#define __SI_SWAP_ERRNO_CODE
105
106#endif
107
108#define SIGHUP 1
109#define SIGINT 2
110#define SIGQUIT 3
111#define SIGILL 4
112#define SIGTRAP 5
113#define SIGABRT 6
114#define SIGIOT SIGABRT
115#define SIGSTKFLT 7
116#define SIGFPE 8
117#define SIGKILL 9
118#define SIGBUS 10
119#define SIGSEGV 11
120#define SIGSYS 12
121#define SIGPIPE 13
122#define SIGALRM 14
123#define SIGTERM 15
124#define SIGUSR1 16
125#define SIGUSR2 17
126#define SIGCHLD 18
127#define SIGPWR 19
128#define SIGWINCH 20
129#define SIGURG 21
130#define SIGIO 22
131#define SIGPOLL SIGIO
132#define SIGSTOP 23
133#define SIGTSTP 24
134#define SIGCONT 25
135#define SIGTTIN 26
136#define SIGTTOU 27
137#define SIGVTALRM 28
138#define SIGPROF 29
139#define SIGXCPU 30
140#define SIGXFSZ 31
141#define SIGUNUSED SIGSYS
142
143#define _NSIG 128
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/socket.h deleted-69
...@@ -1,69 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
34
35#define SOCK_STREAM 2
36#define SOCK_DGRAM 1
37#define SOL_SOCKET 65535
38#define SO_DEBUG 1
39
40#define SO_REUSEADDR 0x0004
41#define SO_KEEPALIVE 0x0008
42#define SO_DONTROUTE 0x0010
43#define SO_BROADCAST 0x0020
44#define SO_LINGER 0x0080
45#define SO_OOBINLINE 0x0100
46#define SO_REUSEPORT 0x0200
47#define SO_SNDBUF 0x1001
48#define SO_RCVBUF 0x1002
49#define SO_SNDLOWAT 0x1003
50#define SO_RCVLOWAT 0x1004
51#define SO_RCVTIMEO 0x1006
52#define SO_SNDTIMEO 0x1005
53#define SO_ERROR 0x1007
54#define SO_TYPE 0x1008
55#define SO_ACCEPTCONN 0x1009
56#define SO_PROTOCOL 0x1028
57#define SO_DOMAIN 0x1029
58
59#define SO_NO_CHECK 11
60#define SO_PRIORITY 12
61#define SO_BSDCOMPAT 14
62#define SO_PASSCRED 17
63#define SO_PEERCRED 18
64#define SO_PEERSEC 30
65#define SO_SNDBUFFORCE 31
66#define SO_RCVBUFFORCE 33
67
68#define SOCK_NONBLOCK 0200
69#define SOCK_CLOEXEC 02000000
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/stat.h deleted-23
...@@ -1,23 +0,0 @@
1#include <string.h>
2#include <bits/alltypes.h>
3
4struct stat {
5 dev_t st_dev;
6 int __pad1[3];
7 ino_t st_ino;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 unsigned int __pad2[2];
14 off_t st_size;
15 int __pad3;
16 struct timespec st_atim;
17 struct timespec st_mtim;
18 struct timespec st_ctim;
19 blksize_t st_blksize;
20 unsigned int __pad4;
21 blkcnt_t st_blocks;
22 int __pad5[14];
23};
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/statfs.h deleted-8
...@@ -1,8 +0,0 @@
1struct statfs {
2 unsigned long f_type, f_bsize, f_frsize;
3 fsblkcnt_t f_blocks, f_bfree;
4 fsfilcnt_t f_files, f_ffree;
5 fsblkcnt_t f_bavail;
6 fsid_t f_fsid;
7 unsigned long f_namelen, f_flags, f_spare[5];
8};
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/syscall.h deleted-657
...@@ -1,657 +0,0 @@
1#define __NR_read 5000
2#define __NR_write 5001
3#define __NR_open 5002
4#define __NR_close 5003
5#define __NR_stat 5004
6#define __NR_fstat 5005
7#define __NR_lstat 5006
8#define __NR_poll 5007
9#define __NR_lseek 5008
10#define __NR_mmap 5009
11#define __NR_mprotect 5010
12#define __NR_munmap 5011
13#define __NR_brk 5012
14#define __NR_rt_sigaction 5013
15#define __NR_rt_sigprocmask 5014
16#define __NR_ioctl 5015
17#define __NR_pread64 5016
18#define __NR_pwrite64 5017
19#define __NR_readv 5018
20#define __NR_writev 5019
21#define __NR_access 5020
22#define __NR_pipe 5021
23#define __NR__newselect 5022
24#define __NR_sched_yield 5023
25#define __NR_mremap 5024
26#define __NR_msync 5025
27#define __NR_mincore 5026
28#define __NR_madvise 5027
29#define __NR_shmget 5028
30#define __NR_shmat 5029
31#define __NR_shmctl 5030
32#define __NR_dup 5031
33#define __NR_dup2 5032
34#define __NR_pause 5033
35#define __NR_nanosleep 5034
36#define __NR_getitimer 5035
37#define __NR_setitimer 5036
38#define __NR_alarm 5037
39#define __NR_getpid 5038
40#define __NR_sendfile 5039
41#define __NR_socket 5040
42#define __NR_connect 5041
43#define __NR_accept 5042
44#define __NR_sendto 5043
45#define __NR_recvfrom 5044
46#define __NR_sendmsg 5045
47#define __NR_recvmsg 5046
48#define __NR_shutdown 5047
49#define __NR_bind 5048
50#define __NR_listen 5049
51#define __NR_getsockname 5050
52#define __NR_getpeername 5051
53#define __NR_socketpair 5052
54#define __NR_setsockopt 5053
55#define __NR_getsockopt 5054
56#define __NR_clone 5055
57#define __NR_fork 5056
58#define __NR_execve 5057
59#define __NR_exit 5058
60#define __NR_wait4 5059
61#define __NR_kill 5060
62#define __NR_uname 5061
63#define __NR_semget 5062
64#define __NR_semop 5063
65#define __NR_semctl 5064
66#define __NR_shmdt 5065
67#define __NR_msgget 5066
68#define __NR_msgsnd 5067
69#define __NR_msgrcv 5068
70#define __NR_msgctl 5069
71#define __NR_fcntl 5070
72#define __NR_flock 5071
73#define __NR_fsync 5072
74#define __NR_fdatasync 5073
75#define __NR_truncate 5074
76#define __NR_ftruncate 5075
77#define __NR_getdents 5076
78#define __NR_getcwd 5077
79#define __NR_chdir 5078
80#define __NR_fchdir 5079
81#define __NR_rename 5080
82#define __NR_mkdir 5081
83#define __NR_rmdir 5082
84#define __NR_creat 5083
85#define __NR_link 5084
86#define __NR_unlink 5085
87#define __NR_symlink 5086
88#define __NR_readlink 5087
89#define __NR_chmod 5088
90#define __NR_fchmod 5089
91#define __NR_chown 5090
92#define __NR_fchown 5091
93#define __NR_lchown 5092
94#define __NR_umask 5093
95#define __NR_gettimeofday 5094
96#define __NR_getrlimit 5095
97#define __NR_getrusage 5096
98#define __NR_sysinfo 5097
99#define __NR_times 5098
100#define __NR_ptrace 5099
101#define __NR_getuid 5100
102#define __NR_syslog 5101
103#define __NR_getgid 5102
104#define __NR_setuid 5103
105#define __NR_setgid 5104
106#define __NR_geteuid 5105
107#define __NR_getegid 5106
108#define __NR_setpgid 5107
109#define __NR_getppid 5108
110#define __NR_getpgrp 5109
111#define __NR_setsid 5110
112#define __NR_setreuid 5111
113#define __NR_setregid 5112
114#define __NR_getgroups 5113
115#define __NR_setgroups 5114
116#define __NR_setresuid 5115
117#define __NR_getresuid 5116
118#define __NR_setresgid 5117
119#define __NR_getresgid 5118
120#define __NR_getpgid 5119
121#define __NR_setfsuid 5120
122#define __NR_setfsgid 5121
123#define __NR_getsid 5122
124#define __NR_capget 5123
125#define __NR_capset 5124
126#define __NR_rt_sigpending 5125
127#define __NR_rt_sigtimedwait 5126
128#define __NR_rt_sigqueueinfo 5127
129#define __NR_rt_sigsuspend 5128
130#define __NR_sigaltstack 5129
131#define __NR_utime 5130
132#define __NR_mknod 5131
133#define __NR_personality 5132
134#define __NR_ustat 5133
135#define __NR_statfs 5134
136#define __NR_fstatfs 5135
137#define __NR_sysfs 5136
138#define __NR_getpriority 5137
139#define __NR_setpriority 5138
140#define __NR_sched_setparam 5139
141#define __NR_sched_getparam 5140
142#define __NR_sched_setscheduler 5141
143#define __NR_sched_getscheduler 5142
144#define __NR_sched_get_priority_max 5143
145#define __NR_sched_get_priority_min 5144
146#define __NR_sched_rr_get_interval 5145
147#define __NR_mlock 5146
148#define __NR_munlock 5147
149#define __NR_mlockall 5148
150#define __NR_munlockall 5149
151#define __NR_vhangup 5150
152#define __NR_pivot_root 5151
153#define __NR__sysctl 5152
154#define __NR_prctl 5153
155#define __NR_adjtimex 5154
156#define __NR_setrlimit 5155
157#define __NR_chroot 5156
158#define __NR_sync 5157
159#define __NR_acct 5158
160#define __NR_settimeofday 5159
161#define __NR_mount 5160
162#define __NR_umount2 5161
163#define __NR_swapon 5162
164#define __NR_swapoff 5163
165#define __NR_reboot 5164
166#define __NR_sethostname 5165
167#define __NR_setdomainname 5166
168#define __NR_create_module 5167
169#define __NR_init_module 5168
170#define __NR_delete_module 5169
171#define __NR_get_kernel_syms 5170
172#define __NR_query_module 5171
173#define __NR_quotactl 5172
174#define __NR_nfsservctl 5173
175#define __NR_getpmsg 5174
176#define __NR_putpmsg 5175
177#define __NR_afs_syscall 5176
178#define __NR_reserved177 5177
179#define __NR_gettid 5178
180#define __NR_readahead 5179
181#define __NR_setxattr 5180
182#define __NR_lsetxattr 5181
183#define __NR_fsetxattr 5182
184#define __NR_getxattr 5183
185#define __NR_lgetxattr 5184
186#define __NR_fgetxattr 5185
187#define __NR_listxattr 5186
188#define __NR_llistxattr 5187
189#define __NR_flistxattr 5188
190#define __NR_removexattr 5189
191#define __NR_lremovexattr 5190
192#define __NR_fremovexattr 5191
193#define __NR_tkill 5192
194#define __NR_reserved193 5193
195#define __NR_futex 5194
196#define __NR_sched_setaffinity 5195
197#define __NR_sched_getaffinity 5196
198#define __NR_cacheflush 5197
199#define __NR_cachectl 5198
200#define __NR_sysmips 5199
201#define __NR_io_setup 5200
202#define __NR_io_destroy 5201
203#define __NR_io_getevents 5202
204#define __NR_io_submit 5203
205#define __NR_io_cancel 5204
206#define __NR_exit_group 5205
207#define __NR_lookup_dcookie 5206
208#define __NR_epoll_create 5207
209#define __NR_epoll_ctl 5208
210#define __NR_epoll_wait 5209
211#define __NR_remap_file_pages 5210
212#define __NR_rt_sigreturn 5211
213#define __NR_set_tid_address 5212
214#define __NR_restart_syscall 5213
215#define __NR_semtimedop 5214
216#define __NR_fadvise64 5215
217#define __NR_timer_create 5216
218#define __NR_timer_settime 5217
219#define __NR_timer_gettime 5218
220#define __NR_timer_getoverrun 5219
221#define __NR_timer_delete 5220
222#define __NR_clock_settime 5221
223#define __NR_clock_gettime 5222
224#define __NR_clock_getres 5223
225#define __NR_clock_nanosleep 5224
226#define __NR_tgkill 5225
227#define __NR_utimes 5226
228#define __NR_mbind 5227
229#define __NR_get_mempolicy 5228
230#define __NR_set_mempolicy 5229
231#define __NR_mq_open 5230
232#define __NR_mq_unlink 5231
233#define __NR_mq_timedsend 5232
234#define __NR_mq_timedreceive 5233
235#define __NR_mq_notify 5234
236#define __NR_mq_getsetattr 5235
237#define __NR_vserver 5236
238#define __NR_waitid 5237
239#define __NR_add_key 5239
240#define __NR_request_key 5240
241#define __NR_keyctl 5241
242#define __NR_set_thread_area 5242
243#define __NR_inotify_init 5243
244#define __NR_inotify_add_watch 5244
245#define __NR_inotify_rm_watch 5245
246#define __NR_migrate_pages 5246
247#define __NR_openat 5247
248#define __NR_mkdirat 5248
249#define __NR_mknodat 5249
250#define __NR_fchownat 5250
251#define __NR_futimesat 5251
252#define __NR_newfstatat 5252
253#define __NR_unlinkat 5253
254#define __NR_renameat 5254
255#define __NR_linkat 5255
256#define __NR_symlinkat 5256
257#define __NR_readlinkat 5257
258#define __NR_fchmodat 5258
259#define __NR_faccessat 5259
260#define __NR_pselect6 5260
261#define __NR_ppoll 5261
262#define __NR_unshare 5262
263#define __NR_splice 5263
264#define __NR_sync_file_range 5264
265#define __NR_tee 5265
266#define __NR_vmsplice 5266
267#define __NR_move_pages 5267
268#define __NR_set_robust_list 5268
269#define __NR_get_robust_list 5269
270#define __NR_kexec_load 5270
271#define __NR_getcpu 5271
272#define __NR_epoll_pwait 5272
273#define __NR_ioprio_set 5273
274#define __NR_ioprio_get 5274
275#define __NR_utimensat 5275
276#define __NR_signalfd 5276
277#define __NR_timerfd 5277
278#define __NR_eventfd 5278
279#define __NR_fallocate 5279
280#define __NR_timerfd_create 5280
281#define __NR_timerfd_gettime 5281
282#define __NR_timerfd_settime 5282
283#define __NR_signalfd4 5283
284#define __NR_eventfd2 5284
285#define __NR_epoll_create1 5285
286#define __NR_dup3 5286
287#define __NR_pipe2 5287
288#define __NR_inotify_init1 5288
289#define __NR_preadv 5289
290#define __NR_pwritev 5290
291#define __NR_rt_tgsigqueueinfo 5291
292#define __NR_perf_event_open 5292
293#define __NR_accept4 5293
294#define __NR_recvmmsg 5294
295#define __NR_fanotify_init 5295
296#define __NR_fanotify_mark 5296
297#define __NR_prlimit64 5297
298#define __NR_name_to_handle_at 5298
299#define __NR_open_by_handle_at 5299
300#define __NR_clock_adjtime 5300
301#define __NR_syncfs 5301
302#define __NR_sendmmsg 5302
303#define __NR_setns 5303
304#define __NR_process_vm_readv 5304
305#define __NR_process_vm_writev 5305
306#define __NR_kcmp 5306
307#define __NR_finit_module 5307
308#define __NR_getdents64 5308
309#define __NR_sched_setattr 5309
310#define __NR_sched_getattr 5310
311#define __NR_renameat2 5311
312#define __NR_seccomp 5312
313#define __NR_getrandom 5313
314#define __NR_memfd_create 5314
315#define __NR_bpf 5315
316#define __NR_execveat 5316
317#define __NR_userfaultfd 5317
318#define __NR_membarrier 5318
319#define __NR_mlock2 5319
320#define __NR_copy_file_range 5320
321#define __NR_preadv2 5321
322#define __NR_pwritev2 5322
323#define __NR_pkey_mprotect 5323
324#define __NR_pkey_alloc 5324
325#define __NR_pkey_free 5325
326#define __NR_statx 5326
327#define __NR_rseq 4327
328#define __NR_io_pgetevents 4328
329
330#define SYS_read 5000
331#define SYS_write 5001
332#define SYS_open 5002
333#define SYS_close 5003
334#define SYS_stat 5004
335#define SYS_fstat 5005
336#define SYS_lstat 5006
337#define SYS_poll 5007
338#define SYS_lseek 5008
339#define SYS_mmap 5009
340#define SYS_mprotect 5010
341#define SYS_munmap 5011
342#define SYS_brk 5012
343#define SYS_rt_sigaction 5013
344#define SYS_rt_sigprocmask 5014
345#define SYS_ioctl 5015
346#define SYS_pread64 5016
347#define SYS_pwrite64 5017
348#define SYS_readv 5018
349#define SYS_writev 5019
350#define SYS_access 5020
351#define SYS_pipe 5021
352#define SYS__newselect 5022
353#define SYS_sched_yield 5023
354#define SYS_mremap 5024
355#define SYS_msync 5025
356#define SYS_mincore 5026
357#define SYS_madvise 5027
358#define SYS_shmget 5028
359#define SYS_shmat 5029
360#define SYS_shmctl 5030
361#define SYS_dup 5031
362#define SYS_dup2 5032
363#define SYS_pause 5033
364#define SYS_nanosleep 5034
365#define SYS_getitimer 5035
366#define SYS_setitimer 5036
367#define SYS_alarm 5037
368#define SYS_getpid 5038
369#define SYS_sendfile 5039
370#define SYS_socket 5040
371#define SYS_connect 5041
372#define SYS_accept 5042
373#define SYS_sendto 5043
374#define SYS_recvfrom 5044
375#define SYS_sendmsg 5045
376#define SYS_recvmsg 5046
377#define SYS_shutdown 5047
378#define SYS_bind 5048
379#define SYS_listen 5049
380#define SYS_getsockname 5050
381#define SYS_getpeername 5051
382#define SYS_socketpair 5052
383#define SYS_setsockopt 5053
384#define SYS_getsockopt 5054
385#define SYS_clone 5055
386#define SYS_fork 5056
387#define SYS_execve 5057
388#define SYS_exit 5058
389#define SYS_wait4 5059
390#define SYS_kill 5060
391#define SYS_uname 5061
392#define SYS_semget 5062
393#define SYS_semop 5063
394#define SYS_semctl 5064
395#define SYS_shmdt 5065
396#define SYS_msgget 5066
397#define SYS_msgsnd 5067
398#define SYS_msgrcv 5068
399#define SYS_msgctl 5069
400#define SYS_fcntl 5070
401#define SYS_flock 5071
402#define SYS_fsync 5072
403#define SYS_fdatasync 5073
404#define SYS_truncate 5074
405#define SYS_ftruncate 5075
406#define SYS_getdents 5076
407#define SYS_getcwd 5077
408#define SYS_chdir 5078
409#define SYS_fchdir 5079
410#define SYS_rename 5080
411#define SYS_mkdir 5081
412#define SYS_rmdir 5082
413#define SYS_creat 5083
414#define SYS_link 5084
415#define SYS_unlink 5085
416#define SYS_symlink 5086
417#define SYS_readlink 5087
418#define SYS_chmod 5088
419#define SYS_fchmod 5089
420#define SYS_chown 5090
421#define SYS_fchown 5091
422#define SYS_lchown 5092
423#define SYS_umask 5093
424#define SYS_gettimeofday 5094
425#define SYS_getrlimit 5095
426#define SYS_getrusage 5096
427#define SYS_sysinfo 5097
428#define SYS_times 5098
429#define SYS_ptrace 5099
430#define SYS_getuid 5100
431#define SYS_syslog 5101
432#define SYS_getgid 5102
433#define SYS_setuid 5103
434#define SYS_setgid 5104
435#define SYS_geteuid 5105
436#define SYS_getegid 5106
437#define SYS_setpgid 5107
438#define SYS_getppid 5108
439#define SYS_getpgrp 5109
440#define SYS_setsid 5110
441#define SYS_setreuid 5111
442#define SYS_setregid 5112
443#define SYS_getgroups 5113
444#define SYS_setgroups 5114
445#define SYS_setresuid 5115
446#define SYS_getresuid 5116
447#define SYS_setresgid 5117
448#define SYS_getresgid 5118
449#define SYS_getpgid 5119
450#define SYS_setfsuid 5120
451#define SYS_setfsgid 5121
452#define SYS_getsid 5122
453#define SYS_capget 5123
454#define SYS_capset 5124
455#define SYS_rt_sigpending 5125
456#define SYS_rt_sigtimedwait 5126
457#define SYS_rt_sigqueueinfo 5127
458#define SYS_rt_sigsuspend 5128
459#define SYS_sigaltstack 5129
460#define SYS_utime 5130
461#define SYS_mknod 5131
462#define SYS_personality 5132
463#define SYS_ustat 5133
464#define SYS_statfs 5134
465#define SYS_fstatfs 5135
466#define SYS_sysfs 5136
467#define SYS_getpriority 5137
468#define SYS_setpriority 5138
469#define SYS_sched_setparam 5139
470#define SYS_sched_getparam 5140
471#define SYS_sched_setscheduler 5141
472#define SYS_sched_getscheduler 5142
473#define SYS_sched_get_priority_max 5143
474#define SYS_sched_get_priority_min 5144
475#define SYS_sched_rr_get_interval 5145
476#define SYS_mlock 5146
477#define SYS_munlock 5147
478#define SYS_mlockall 5148
479#define SYS_munlockall 5149
480#define SYS_vhangup 5150
481#define SYS_pivot_root 5151
482#define SYS__sysctl 5152
483#define SYS_prctl 5153
484#define SYS_adjtimex 5154
485#define SYS_setrlimit 5155
486#define SYS_chroot 5156
487#define SYS_sync 5157
488#define SYS_acct 5158
489#define SYS_settimeofday 5159
490#define SYS_mount 5160
491#define SYS_umount2 5161
492#define SYS_swapon 5162
493#define SYS_swapoff 5163
494#define SYS_reboot 5164
495#define SYS_sethostname 5165
496#define SYS_setdomainname 5166
497#define SYS_create_module 5167
498#define SYS_init_module 5168
499#define SYS_delete_module 5169
500#define SYS_get_kernel_syms 5170
501#define SYS_query_module 5171
502#define SYS_quotactl 5172
503#define SYS_nfsservctl 5173
504#define SYS_getpmsg 5174
505#define SYS_putpmsg 5175
506#define SYS_afs_syscall 5176
507#define SYS_reserved177 5177
508#define SYS_gettid 5178
509#define SYS_readahead 5179
510#define SYS_setxattr 5180
511#define SYS_lsetxattr 5181
512#define SYS_fsetxattr 5182
513#define SYS_getxattr 5183
514#define SYS_lgetxattr 5184
515#define SYS_fgetxattr 5185
516#define SYS_listxattr 5186
517#define SYS_llistxattr 5187
518#define SYS_flistxattr 5188
519#define SYS_removexattr 5189
520#define SYS_lremovexattr 5190
521#define SYS_fremovexattr 5191
522#define SYS_tkill 5192
523#define SYS_reserved193 5193
524#define SYS_futex 5194
525#define SYS_sched_setaffinity 5195
526#define SYS_sched_getaffinity 5196
527#define SYS_cacheflush 5197
528#define SYS_cachectl 5198
529#define SYS_sysmips 5199
530#define SYS_io_setup 5200
531#define SYS_io_destroy 5201
532#define SYS_io_getevents 5202
533#define SYS_io_submit 5203
534#define SYS_io_cancel 5204
535#define SYS_exit_group 5205
536#define SYS_lookup_dcookie 5206
537#define SYS_epoll_create 5207
538#define SYS_epoll_ctl 5208
539#define SYS_epoll_wait 5209
540#define SYS_remap_file_pages 5210
541#define SYS_rt_sigreturn 5211
542#define SYS_set_tid_address 5212
543#define SYS_restart_syscall 5213
544#define SYS_semtimedop 5214
545#define SYS_fadvise64 5215
546#define SYS_timer_create 5216
547#define SYS_timer_settime 5217
548#define SYS_timer_gettime 5218
549#define SYS_timer_getoverrun 5219
550#define SYS_timer_delete 5220
551#define SYS_clock_settime 5221
552#define SYS_clock_gettime 5222
553#define SYS_clock_getres 5223
554#define SYS_clock_nanosleep 5224
555#define SYS_tgkill 5225
556#define SYS_utimes 5226
557#define SYS_mbind 5227
558#define SYS_get_mempolicy 5228
559#define SYS_set_mempolicy 5229
560#define SYS_mq_open 5230
561#define SYS_mq_unlink 5231
562#define SYS_mq_timedsend 5232
563#define SYS_mq_timedreceive 5233
564#define SYS_mq_notify 5234
565#define SYS_mq_getsetattr 5235
566#define SYS_vserver 5236
567#define SYS_waitid 5237
568#define SYS_add_key 5239
569#define SYS_request_key 5240
570#define SYS_keyctl 5241
571#define SYS_set_thread_area 5242
572#define SYS_inotify_init 5243
573#define SYS_inotify_add_watch 5244
574#define SYS_inotify_rm_watch 5245
575#define SYS_migrate_pages 5246
576#define SYS_openat 5247
577#define SYS_mkdirat 5248
578#define SYS_mknodat 5249
579#define SYS_fchownat 5250
580#define SYS_futimesat 5251
581#define SYS_newfstatat 5252
582#define SYS_unlinkat 5253
583#define SYS_renameat 5254
584#define SYS_linkat 5255
585#define SYS_symlinkat 5256
586#define SYS_readlinkat 5257
587#define SYS_fchmodat 5258
588#define SYS_faccessat 5259
589#define SYS_pselect6 5260
590#define SYS_ppoll 5261
591#define SYS_unshare 5262
592#define SYS_splice 5263
593#define SYS_sync_file_range 5264
594#define SYS_tee 5265
595#define SYS_vmsplice 5266
596#define SYS_move_pages 5267
597#define SYS_set_robust_list 5268
598#define SYS_get_robust_list 5269
599#define SYS_kexec_load 5270
600#define SYS_getcpu 5271
601#define SYS_epoll_pwait 5272
602#define SYS_ioprio_set 5273
603#define SYS_ioprio_get 5274
604#define SYS_utimensat 5275
605#define SYS_signalfd 5276
606#define SYS_timerfd 5277
607#define SYS_eventfd 5278
608#define SYS_fallocate 5279
609#define SYS_timerfd_create 5280
610#define SYS_timerfd_gettime 5281
611#define SYS_timerfd_settime 5282
612#define SYS_signalfd4 5283
613#define SYS_eventfd2 5284
614#define SYS_epoll_create1 5285
615#define SYS_dup3 5286
616#define SYS_pipe2 5287
617#define SYS_inotify_init1 5288
618#define SYS_preadv 5289
619#define SYS_pwritev 5290
620#define SYS_rt_tgsigqueueinfo 5291
621#define SYS_perf_event_open 5292
622#define SYS_accept4 5293
623#define SYS_recvmmsg 5294
624#define SYS_fanotify_init 5295
625#define SYS_fanotify_mark 5296
626#define SYS_prlimit64 5297
627#define SYS_name_to_handle_at 5298
628#define SYS_open_by_handle_at 5299
629#define SYS_clock_adjtime 5300
630#define SYS_syncfs 5301
631#define SYS_sendmmsg 5302
632#define SYS_setns 5303
633#define SYS_process_vm_readv 5304
634#define SYS_process_vm_writev 5305
635#define SYS_kcmp 5306
636#define SYS_finit_module 5307
637#define SYS_getdents64 5308
638#define SYS_sched_setattr 5309
639#define SYS_sched_getattr 5310
640#define SYS_renameat2 5311
641#define SYS_seccomp 5312
642#define SYS_getrandom 5313
643#define SYS_memfd_create 5314
644#define SYS_bpf 5315
645#define SYS_execveat 5316
646#define SYS_userfaultfd 5317
647#define SYS_membarrier 5318
648#define SYS_mlock2 5319
649#define SYS_copy_file_range 5320
650#define SYS_preadv2 5321
651#define SYS_pwritev2 5322
652#define SYS_pkey_mprotect 5323
653#define SYS_pkey_alloc 5324
654#define SYS_pkey_free 5325
655#define SYS_statx 5326
656#define SYS_rseq 4327
657#define SYS_io_pgetevents 4328
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/termios.h deleted-169
...@@ -1,169 +0,0 @@
1struct termios {
2 tcflag_t c_iflag;
3 tcflag_t c_oflag;
4 tcflag_t c_cflag;
5 tcflag_t c_lflag;
6 cc_t c_line;
7 cc_t c_cc[NCCS];
8 speed_t __c_ispeed;
9 speed_t __c_ospeed;
10};
11
12#define VINTR 0
13#define VQUIT 1
14#define VERASE 2
15#define VKILL 3
16#define VMIN 4
17#define VTIME 5
18#define VEOL2 6
19#define VSWTC 7
20#define VSWTCH 7
21#define VSTART 8
22#define VSTOP 9
23#define VSUSP 10
24#define VREPRINT 12
25#define VDISCARD 13
26#define VWERASE 14
27#define VLNEXT 15
28#define VEOF 16
29#define VEOL 17
30
31#define IGNBRK 0000001
32#define BRKINT 0000002
33#define IGNPAR 0000004
34#define PARMRK 0000010
35#define INPCK 0000020
36#define ISTRIP 0000040
37#define INLCR 0000100
38#define IGNCR 0000200
39#define ICRNL 0000400
40#define IUCLC 0001000
41#define IXON 0002000
42#define IXANY 0004000
43#define IXOFF 0010000
44#define IMAXBEL 0020000
45#define IUTF8 0040000
46
47#define OPOST 0000001
48#define OLCUC 0000002
49#define ONLCR 0000004
50#define OCRNL 0000010
51#define ONOCR 0000020
52#define ONLRET 0000040
53#define OFILL 0000100
54#define OFDEL 0000200
55#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
56#define NLDLY 0000400
57#define NL0 0000000
58#define NL1 0000400
59#define CRDLY 0003000
60#define CR0 0000000
61#define CR1 0001000
62#define CR2 0002000
63#define CR3 0003000
64#define TABDLY 0014000
65#define TAB0 0000000
66#define TAB1 0004000
67#define TAB2 0010000
68#define TAB3 0014000
69#define BSDLY 0020000
70#define BS0 0000000
71#define BS1 0020000
72#define FFDLY 0100000
73#define FF0 0000000
74#define FF1 0100000
75#endif
76
77#define VTDLY 0040000
78#define VT0 0000000
79#define VT1 0040000
80
81#define B0 0000000
82#define B50 0000001
83#define B75 0000002
84#define B110 0000003
85#define B134 0000004
86#define B150 0000005
87#define B200 0000006
88#define B300 0000007
89#define B600 0000010
90#define B1200 0000011
91#define B1800 0000012
92#define B2400 0000013
93#define B4800 0000014
94#define B9600 0000015
95#define B19200 0000016
96#define B38400 0000017
97
98#define B57600 0010001
99#define B115200 0010002
100#define B230400 0010003
101#define B460800 0010004
102#define B500000 0010005
103#define B576000 0010006
104#define B921600 0010007
105#define B1000000 0010010
106#define B1152000 0010011
107#define B1500000 0010012
108#define B2000000 0010013
109#define B2500000 0010014
110#define B3000000 0010015
111#define B3500000 0010016
112#define B4000000 0010017
113
114#define CSIZE 0000060
115#define CS5 0000000
116#define CS6 0000020
117#define CS7 0000040
118#define CS8 0000060
119#define CSTOPB 0000100
120#define CREAD 0000200
121#define PARENB 0000400
122#define PARODD 0001000
123#define HUPCL 0002000
124#define CLOCAL 0004000
125
126#define ISIG 0000001
127#define ICANON 0000002
128#define ECHO 0000010
129#define ECHOE 0000020
130#define ECHOK 0000040
131#define ECHONL 0000100
132#define NOFLSH 0000200
133#define IEXTEN 0000400
134#define TOSTOP 0100000
135#define ITOSTOP 0100000
136
137#define TCOOFF 0
138#define TCOON 1
139#define TCIOFF 2
140#define TCION 3
141
142#define TCIFLUSH 0
143#define TCOFLUSH 1
144#define TCIOFLUSH 2
145
146#define TCSANOW 0
147#define TCSADRAIN 1
148#define TCSAFLUSH 2
149
150#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
151#define EXTA 0000016
152#define EXTB 0000017
153#define CBAUD 0010017
154#define CBAUDEX 0010000
155#define CIBAUD 002003600000
156#define CMSPAR 010000000000
157#define CRTSCTS 020000000000
158
159#define XCASE 0000004
160#define ECHOCTL 0001000
161#define ECHOPRT 0002000
162#define ECHOKE 0004000
163#define FLUSHO 0020000
164#define PENDIN 0040000
165#define EXTPROC 0200000
166
167#define XTABS 0014000
168#define TIOCSER_TEMT 0x01
169#endif
\ No newline at end of file
lib/libc/include/mips64el-linux-musl/bits/user.h deleted-15
...@@ -1,15 +0,0 @@
1struct user {
2 unsigned long regs[102];
3 unsigned long u_tsize, u_dsize, u_ssize;
4 unsigned long long start_code, start_data, start_stack;
5 long long signal;
6 unsigned long long *u_ar0;
7 unsigned long long magic;
8 char u_comm[32];
9};
10
11#define ELF_NGREG 45
12#define ELF_NFPREG 33
13
14typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
15typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 64
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for mipsel-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg int
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if _MIPSEL || __MIPSEL || __MIPSEL__
2#define __BYTE_ORDER __LITTLE_ENDIAN
3#else
4#define __BYTE_ORDER __BIG_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define ENOMSG 35
36#define EIDRM 36
37#define ECHRNG 37
38#define EL2NSYNC 38
39#define EL3HLT 39
40#define EL3RST 40
41#define ELNRNG 41
42#define EUNATCH 42
43#define ENOCSI 43
44#define EL2HLT 44
45#define EDEADLK 45
46#define ENOLCK 46
47#define EBADE 50
48#define EBADR 51
49#define EXFULL 52
50#define ENOANO 53
51#define EBADRQC 54
52#define EBADSLT 55
53#define EDEADLOCK 56
54#define EBFONT 59
55#define ENOSTR 60
56#define ENODATA 61
57#define ETIME 62
58#define ENOSR 63
59#define ENONET 64
60#define ENOPKG 65
61#define EREMOTE 66
62#define ENOLINK 67
63#define EADV 68
64#define ESRMNT 69
65#define ECOMM 70
66#define EPROTO 71
67#define EDOTDOT 73
68#define EMULTIHOP 74
69#define EBADMSG 77
70#define ENAMETOOLONG 78
71#define EOVERFLOW 79
72#define ENOTUNIQ 80
73#define EBADFD 81
74#define EREMCHG 82
75#define ELIBACC 83
76#define ELIBBAD 84
77#define ELIBSCN 85
78#define ELIBMAX 86
79#define ELIBEXEC 87
80#define EILSEQ 88
81#define ENOSYS 89
82#define ELOOP 90
83#define ERESTART 91
84#define ESTRPIPE 92
85#define ENOTEMPTY 93
86#define EUSERS 94
87#define ENOTSOCK 95
88#define EDESTADDRREQ 96
89#define EMSGSIZE 97
90#define EPROTOTYPE 98
91#define ENOPROTOOPT 99
92#define EPROTONOSUPPORT 120
93#define ESOCKTNOSUPPORT 121
94#define EOPNOTSUPP 122
95#define ENOTSUP EOPNOTSUPP
96#define EPFNOSUPPORT 123
97#define EAFNOSUPPORT 124
98#define EADDRINUSE 125
99#define EADDRNOTAVAIL 126
100#define ENETDOWN 127
101#define ENETUNREACH 128
102#define ENETRESET 129
103#define ECONNABORTED 130
104#define ECONNRESET 131
105#define ENOBUFS 132
106#define EISCONN 133
107#define ENOTCONN 134
108#define EUCLEAN 135
109#define ENOTNAM 137
110#define ENAVAIL 138
111#define EISNAM 139
112#define EREMOTEIO 140
113#define ESHUTDOWN 143
114#define ETOOMANYREFS 144
115#define ETIMEDOUT 145
116#define ECONNREFUSED 146
117#define EHOSTDOWN 147
118#define EHOSTUNREACH 148
119#define EWOULDBLOCK EAGAIN
120#define EALREADY 149
121#define EINPROGRESS 150
122#define ESTALE 151
123#define ECANCELED 158
124#define ENOMEDIUM 159
125#define EMEDIUMTYPE 160
126#define ENOKEY 161
127#define EKEYEXPIRED 162
128#define EKEYREVOKED 163
129#define EKEYREJECTED 164
130#define EOWNERDEAD 165
131#define ENOTRECOVERABLE 166
132#define ERFKILL 167
133#define EHWPOISON 168
134#define EDQUOT 1133
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0400
2#define O_EXCL 02000
3#define O_NOCTTY 04000
4#define O_TRUNC 01000
5#define O_APPEND 0010
6#define O_NONBLOCK 0200
7#define O_DSYNC 0020
8#define O_SYNC 040020
9#define O_RSYNC 040020
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 010000
15#define O_DIRECT 0100000
16#define O_LARGEFILE 020000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 24
29#define F_GETOWN 23
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 33
34#define F_SETLK 34
35#define F_SETLKW 35
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/fenv.h deleted-25
...@@ -1,25 +0,0 @@
1#ifdef __mips_soft_float
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INEXACT 4
6#define FE_UNDERFLOW 8
7#define FE_OVERFLOW 16
8#define FE_DIVBYZERO 32
9#define FE_INVALID 64
10
11#define FE_ALL_EXCEPT 124
12
13#define FE_TONEAREST 0
14#define FE_TOWARDZERO 1
15#define FE_UPWARD 2
16#define FE_DOWNWARD 3
17#endif
18
19typedef unsigned short fexcept_t;
20
21typedef struct {
22 unsigned __cw;
23} fenv_t;
24
25#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/hwcap.h deleted-3
...@@ -1,3 +0,0 @@
1#define HWCAP_MIPS_R6 (1 << 0)
2#define HWCAP_MIPS_MSA (1 << 1)
3#define HWCAP_MIPS_CRC32 (1 << 2)
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/ioctl.h deleted-212
...@@ -1,212 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_READ 2U
4#define _IOC_WRITE 4U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define TCGETA 0x5401
12#define TCSETA 0x5402
13#define TCSETAW 0x5403
14#define TCSETAF 0x5404
15#define TCSBRK 0x5405
16#define TCXONC 0x5406
17#define TCFLSH 0x5407
18#define TCGETS 0x540D
19#define TCSETS 0x540E
20#define TCSETSW 0x540F
21#define TCSETSF 0x5410
22
23#define TIOCEXCL 0x740D
24#define TIOCNXCL 0x740E
25#define TIOCOUTQ 0x7472
26#define TIOCSTI 0x5472
27#define TIOCMGET 0x741D
28#define TIOCMBIS 0x741B
29#define TIOCMBIC 0x741C
30#define TIOCMSET 0x741A
31
32#define TIOCPKT 0x5470
33#define TIOCSWINSZ _IOW('t', 103, struct winsize)
34#define TIOCGWINSZ _IOR('t', 104, struct winsize)
35#define TIOCNOTTY 0x5471
36#define TIOCSETD 0x7401
37#define TIOCGETD 0x7400
38
39#define FIOCLEX 0x6601
40#define FIONCLEX 0x6602
41#define FIOASYNC 0x667D
42#define FIONBIO 0x667E
43#define FIOQSIZE 0x667F
44
45#define TIOCGLTC 0x7474
46#define TIOCSLTC 0x7475
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49#define TIOCCONS _IOW('t', 120, int)
50
51#define FIONREAD 0x467F
52#define TIOCINQ FIONREAD
53
54#define TIOCGETP 0x7408
55#define TIOCSETP 0x7409
56#define TIOCSETN 0x740A
57
58#define TIOCSBRK 0x5427
59#define TIOCCBRK 0x5428
60#define TIOCGSID 0x7416
61#define TIOCGRS485 _IOR('T', 0x2E, char[32])
62#define TIOCSRS485 _IOWR('T', 0x2F, char[32])
63#define TIOCGPTN _IOR('T', 0x30, unsigned int)
64#define TIOCSPTLCK _IOW('T', 0x31, int)
65#define TIOCGDEV _IOR('T', 0x32, unsigned int)
66#define TIOCSIG _IOW('T', 0x36, int)
67#define TIOCVHANGUP 0x5437
68#define TIOCGPKT _IOR('T', 0x38, int)
69#define TIOCGPTLCK _IOR('T', 0x39, int)
70#define TIOCGEXCL _IOR('T', 0x40, int)
71#define TIOCGPTPEER _IO('T', 0x41)
72
73#define TIOCSCTTY 0x5480
74#define TIOCGSOFTCAR 0x5481
75#define TIOCSSOFTCAR 0x5482
76#define TIOCLINUX 0x5483
77#define TIOCGSERIAL 0x5484
78#define TIOCSSERIAL 0x5485
79#define TCSBRKP 0x5486
80
81#define TIOCSERCONFIG 0x5488
82#define TIOCSERGWILD 0x5489
83#define TIOCSERSWILD 0x548A
84#define TIOCGLCKTRMIOS 0x548B
85#define TIOCSLCKTRMIOS 0x548C
86#define TIOCSERGSTRUCT 0x548D
87#define TIOCSERGETLSR 0x548E
88#define TIOCSERGETMULTI 0x548F
89#define TIOCSERSETMULTI 0x5490
90#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x5492
92
93#define TIOCPKT_DATA 0
94#define TIOCPKT_FLUSHREAD 1
95#define TIOCPKT_FLUSHWRITE 2
96#define TIOCPKT_STOP 4
97#define TIOCPKT_START 8
98#define TIOCPKT_NOSTOP 16
99#define TIOCPKT_DOSTOP 32
100#define TIOCPKT_IOCTL 64
101
102#define TIOCSER_TEMT 0x01
103
104struct winsize {
105 unsigned short ws_row;
106 unsigned short ws_col;
107 unsigned short ws_xpixel;
108 unsigned short ws_ypixel;
109};
110
111#define TIOCM_LE 0x001
112#define TIOCM_DTR 0x002
113#define TIOCM_RTS 0x004
114#define TIOCM_ST 0x010
115#define TIOCM_SR 0x020
116#define TIOCM_CTS 0x040
117#define TIOCM_CAR 0x100
118#define TIOCM_CD TIOCM_CAR
119#define TIOCM_RNG 0x200
120#define TIOCM_RI TIOCM_RNG
121#define TIOCM_DSR 0x400
122#define TIOCM_OUT1 0x2000
123#define TIOCM_OUT2 0x4000
124#define TIOCM_LOOP 0x8000
125
126#define N_TTY 0
127#define N_SLIP 1
128#define N_MOUSE 2
129#define N_PPP 3
130#define N_STRIP 4
131#define N_AX25 5
132#define N_X25 6
133#define N_6PACK 7
134#define N_MASC 8
135#define N_R3964 9
136#define N_PROFIBUS_FDL 10
137#define N_IRDA 11
138#define N_SMSBLOCK 12
139#define N_HDLC 13
140#define N_SYNC_PPP 14
141#define N_HCI 15
142
143#define FIOGETOWN _IOR('f', 123, int)
144#define FIOSETOWN _IOW('f', 124, int)
145#define SIOCATMARK _IOR('s', 7, int)
146#define SIOCSPGRP _IOW('s', 8, pid_t)
147#define SIOCGPGRP _IOR('s', 9, pid_t)
148#define SIOCGSTAMP 0x8906
149#define SIOCGSTAMPNS 0x8907
150
151#define SIOCADDRT 0x890B
152#define SIOCDELRT 0x890C
153#define SIOCRTMSG 0x890D
154
155#define SIOCGIFNAME 0x8910
156#define SIOCSIFLINK 0x8911
157#define SIOCGIFCONF 0x8912
158#define SIOCGIFFLAGS 0x8913
159#define SIOCSIFFLAGS 0x8914
160#define SIOCGIFADDR 0x8915
161#define SIOCSIFADDR 0x8916
162#define SIOCGIFDSTADDR 0x8917
163#define SIOCSIFDSTADDR 0x8918
164#define SIOCGIFBRDADDR 0x8919
165#define SIOCSIFBRDADDR 0x891a
166#define SIOCGIFNETMASK 0x891b
167#define SIOCSIFNETMASK 0x891c
168#define SIOCGIFMETRIC 0x891d
169#define SIOCSIFMETRIC 0x891e
170#define SIOCGIFMEM 0x891f
171#define SIOCSIFMEM 0x8920
172#define SIOCGIFMTU 0x8921
173#define SIOCSIFMTU 0x8922
174#define SIOCSIFNAME 0x8923
175#define SIOCSIFHWADDR 0x8924
176#define SIOCGIFENCAP 0x8925
177#define SIOCSIFENCAP 0x8926
178#define SIOCGIFHWADDR 0x8927
179#define SIOCGIFSLAVE 0x8929
180#define SIOCSIFSLAVE 0x8930
181#define SIOCADDMULTI 0x8931
182#define SIOCDELMULTI 0x8932
183#define SIOCGIFINDEX 0x8933
184#define SIOGIFINDEX SIOCGIFINDEX
185#define SIOCSIFPFLAGS 0x8934
186#define SIOCGIFPFLAGS 0x8935
187#define SIOCDIFADDR 0x8936
188#define SIOCSIFHWBROADCAST 0x8937
189#define SIOCGIFCOUNT 0x8938
190
191#define SIOCGIFBR 0x8940
192#define SIOCSIFBR 0x8941
193
194#define SIOCGIFTXQLEN 0x8942
195#define SIOCSIFTXQLEN 0x8943
196
197#define SIOCDARP 0x8953
198#define SIOCGARP 0x8954
199#define SIOCSARP 0x8955
200
201#define SIOCDRARP 0x8960
202#define SIOCGRARP 0x8961
203#define SIOCSRARP 0x8962
204
205#define SIOCGIFMAP 0x8970
206#define SIOCSIFMAP 0x8971
207
208#define SIOCADDDLCI 0x8980
209#define SIOCDELDLCI 0x8981
210
211#define SIOCDEVPRIVATE 0x89F0
212#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/mman.h deleted-25
...@@ -1,25 +0,0 @@
1#undef MAP_ANON
2#define MAP_ANON 0x800
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x0400
5#undef MAP_GROWSDOWN
6#define MAP_GROWSDOWN 0x1000
7#undef MAP_DENYWRITE
8#define MAP_DENYWRITE 0x2000
9#undef MAP_EXECUTABLE
10#define MAP_EXECUTABLE 0x4000
11#undef MAP_LOCKED
12#define MAP_LOCKED 0x8000
13#undef MAP_POPULATE
14#define MAP_POPULATE 0x10000
15#undef MAP_NONBLOCK
16#define MAP_NONBLOCK 0x20000
17#undef MAP_STACK
18#define MAP_STACK 0x40000
19#undef MAP_HUGETLB
20#define MAP_HUGETLB 0x80000
21#undef MAP_SYNC
22
23#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
24#undef MADV_SOFT_OFFLINE
25#endif
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/msg.h deleted-24
...@@ -1,24 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3#if _MIPSEL || __MIPSEL || __MIPSEL__
4 time_t msg_stime;
5 int __unused1;
6 time_t msg_rtime;
7 int __unused2;
8 time_t msg_ctime;
9 int __unused3;
10#else
11 int __unused1;
12 time_t msg_stime;
13 int __unused2;
14 time_t msg_rtime;
15 int __unused3;
16 time_t msg_ctime;
17#endif
18 unsigned long msg_cbytes;
19 msgqnum_t msg_qnum;
20 msglen_t msg_qbytes;
21 pid_t msg_lspid;
22 pid_t msg_lrpid;
23 unsigned long __unused[2];
24};
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/poll.h deleted-2
...@@ -1,2 +0,0 @@
1#define POLLWRNORM POLLOUT
2#define POLLWRBAND 0x100
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/ptrace.h deleted-9
...@@ -1,9 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_PEEKTEXT_3264 0xc0
4#define PTRACE_PEEKDATA_3264 0xc1
5#define PTRACE_POKETEXT_3264 0xc2
6#define PTRACE_POKEDATA_3264 0xc3
7#define PTRACE_GET_THREAD_AREA_3264 0xc4
8#define PTRACE_GET_WATCH_REGS 0xd0
9#define PTRACE_SET_WATCH_REGS 0xd1
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/reg.h deleted-47
...@@ -1,47 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3
4#define EF_R0 6
5#define EF_R1 7
6#define EF_R2 8
7#define EF_R3 9
8#define EF_R4 10
9#define EF_R5 11
10#define EF_R6 12
11#define EF_R7 13
12#define EF_R8 14
13#define EF_R9 15
14#define EF_R10 16
15#define EF_R11 17
16#define EF_R12 18
17#define EF_R13 19
18#define EF_R14 20
19#define EF_R15 21
20#define EF_R16 22
21#define EF_R17 23
22#define EF_R18 24
23#define EF_R19 25
24#define EF_R20 26
25#define EF_R21 27
26#define EF_R22 28
27#define EF_R23 29
28#define EF_R24 30
29#define EF_R25 31
30
31#define EF_R26 32
32#define EF_R27 33
33#define EF_R28 34
34#define EF_R29 35
35#define EF_R30 36
36#define EF_R31 37
37
38#define EF_LO 38
39#define EF_HI 39
40
41#define EF_CP0_EPC 40
42#define EF_CP0_BADVADDR 41
43#define EF_CP0_STATUS 42
44#define EF_CP0_CAUSE 43
45#define EF_UNUSED0 44
46
47#define EF_SIZE 180
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/resource.h deleted-5
...@@ -1,5 +0,0 @@
1#define RLIMIT_NOFILE 5
2#define RLIMIT_AS 6
3#define RLIMIT_RSS 7
4#define RLIMIT_NPROC 8
5#define RLIMIT_MEMLOCK 9
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/sem.h deleted-14
...@@ -1,14 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 time_t __unused3;
13 time_t __unused4;
14};
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[13];
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/signal.h deleted-120
...@@ -1,120 +0,0 @@
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 unsigned long long greg_t, gregset_t[32];
11typedef struct {
12 union {
13 double fp_dregs[32];
14 struct {
15 float _fp_fregs;
16 unsigned _fp_pad;
17 } fp_fregs[32];
18 } fp_r;
19} fpregset_t;
20struct sigcontext {
21 unsigned sc_regmask, sc_status;
22 unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
23 unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
24 unsigned long long sc_mdhi, sc_mdlo;
25 unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
26};
27typedef struct {
28 unsigned regmask, status;
29 unsigned long long pc, gregs[32], fpregs[32];
30 unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
31 unsigned long long mdhi, mdlo;
32 unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
33} mcontext_t;
34#else
35typedef struct {
36 unsigned __mc1[2];
37 unsigned long long __mc2[65];
38 unsigned __mc3[5];
39 unsigned long long __mc4[2];
40 unsigned __mc5[6];
41} mcontext_t;
42#endif
43
44struct sigaltstack {
45 void *ss_sp;
46 size_t ss_size;
47 int ss_flags;
48};
49
50typedef struct __ucontext {
51 unsigned long uc_flags;
52 struct __ucontext *uc_link;
53 stack_t uc_stack;
54 mcontext_t uc_mcontext;
55 sigset_t uc_sigmask;
56} ucontext_t;
57
58#define SA_NOCLDSTOP 1
59#define SA_NOCLDWAIT 0x10000
60#define SA_SIGINFO 8
61#define SA_ONSTACK 0x08000000
62#define SA_RESTART 0x10000000
63#define SA_NODEFER 0x40000000
64#define SA_RESETHAND 0x80000000
65#define SA_RESTORER 0x04000000
66
67#undef SIG_BLOCK
68#undef SIG_UNBLOCK
69#undef SIG_SETMASK
70#define SIG_BLOCK 1
71#define SIG_UNBLOCK 2
72#define SIG_SETMASK 3
73
74#undef SI_ASYNCIO
75#undef SI_MESGQ
76#undef SI_TIMER
77#define SI_ASYNCIO (-2)
78#define SI_MESGQ (-4)
79#define SI_TIMER (-3)
80
81#define __SI_SWAP_ERRNO_CODE
82
83#endif
84
85#define SIGHUP 1
86#define SIGINT 2
87#define SIGQUIT 3
88#define SIGILL 4
89#define SIGTRAP 5
90#define SIGABRT 6
91#define SIGIOT SIGABRT
92#define SIGSTKFLT 7
93#define SIGFPE 8
94#define SIGKILL 9
95#define SIGBUS 10
96#define SIGSEGV 11
97#define SIGSYS 12
98#define SIGPIPE 13
99#define SIGALRM 14
100#define SIGTERM 15
101#define SIGUSR1 16
102#define SIGUSR2 17
103#define SIGCHLD 18
104#define SIGPWR 19
105#define SIGWINCH 20
106#define SIGURG 21
107#define SIGIO 22
108#define SIGPOLL SIGIO
109#define SIGSTOP 23
110#define SIGTSTP 24
111#define SIGCONT 25
112#define SIGTTIN 26
113#define SIGTTOU 27
114#define SIGVTALRM 28
115#define SIGPROF 29
116#define SIGXCPU 30
117#define SIGXFSZ 31
118#define SIGUNUSED SIGSYS
119
120#define _NSIG 128
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/socket.h deleted-53
...@@ -1,53 +0,0 @@
1struct msghdr {
2 void *msg_name;
3 socklen_t msg_namelen;
4 struct iovec *msg_iov;
5 int msg_iovlen;
6 void *msg_control;
7 socklen_t msg_controllen;
8 int msg_flags;
9};
10
11struct cmsghdr {
12 socklen_t cmsg_len;
13 int cmsg_level;
14 int cmsg_type;
15};
16
17#define SOCK_STREAM 2
18#define SOCK_DGRAM 1
19
20#define SOL_SOCKET 65535
21
22#define SO_DEBUG 1
23
24#define SO_REUSEADDR 0x0004
25#define SO_KEEPALIVE 0x0008
26#define SO_DONTROUTE 0x0010
27#define SO_BROADCAST 0x0020
28#define SO_LINGER 0x0080
29#define SO_OOBINLINE 0x0100
30#define SO_REUSEPORT 0x0200
31#define SO_SNDBUF 0x1001
32#define SO_RCVBUF 0x1002
33#define SO_SNDLOWAT 0x1003
34#define SO_RCVLOWAT 0x1004
35#define SO_RCVTIMEO 0x1006
36#define SO_SNDTIMEO 0x1005
37#define SO_ERROR 0x1007
38#define SO_TYPE 0x1008
39#define SO_ACCEPTCONN 0x1009
40#define SO_PROTOCOL 0x1028
41#define SO_DOMAIN 0x1029
42
43#define SO_NO_CHECK 11
44#define SO_PRIORITY 12
45#define SO_BSDCOMPAT 14
46#define SO_PASSCRED 17
47#define SO_PEERCRED 18
48#define SO_PEERSEC 30
49#define SO_SNDBUFFORCE 31
50#define SO_RCVBUFFORCE 33
51
52#define SOCK_NONBLOCK 0200
53#define SOCK_CLOEXEC 02000000
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/stat.h deleted-22
...@@ -1,22 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 long __st_padding1[2];
7 ino_t st_ino;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 long __st_padding2[2];
14 off_t st_size;
15 struct timespec st_atim;
16 struct timespec st_mtim;
17 struct timespec st_ctim;
18 blksize_t st_blksize;
19 long __st_padding3;
20 blkcnt_t st_blocks;
21 long __st_padding4[14];
22};
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/statfs.h deleted-8
...@@ -1,8 +0,0 @@
1struct statfs {
2 unsigned long f_type, f_bsize, f_frsize;
3 fsblkcnt_t f_blocks, f_bfree;
4 fsfilcnt_t f_files, f_ffree;
5 fsblkcnt_t f_bavail;
6 fsid_t f_fsid;
7 unsigned long f_namelen, f_flags, f_spare[5];
8};
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
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
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/syscall.h deleted-737
...@@ -1,737 +0,0 @@
1#define __NR_syscall 4000
2#define __NR_exit 4001
3#define __NR_fork 4002
4#define __NR_read 4003
5#define __NR_write 4004
6#define __NR_open 4005
7#define __NR_close 4006
8#define __NR_waitpid 4007
9#define __NR_creat 4008
10#define __NR_link 4009
11#define __NR_unlink 4010
12#define __NR_execve 4011
13#define __NR_chdir 4012
14#define __NR_time 4013
15#define __NR_mknod 4014
16#define __NR_chmod 4015
17#define __NR_lchown 4016
18#define __NR_break 4017
19#define __NR_unused18 4018
20#define __NR_lseek 4019
21#define __NR_getpid 4020
22#define __NR_mount 4021
23#define __NR_umount 4022
24#define __NR_setuid 4023
25#define __NR_getuid 4024
26#define __NR_stime 4025
27#define __NR_ptrace 4026
28#define __NR_alarm 4027
29#define __NR_unused28 4028
30#define __NR_pause 4029
31#define __NR_utime 4030
32#define __NR_stty 4031
33#define __NR_gtty 4032
34#define __NR_access 4033
35#define __NR_nice 4034
36#define __NR_ftime 4035
37#define __NR_sync 4036
38#define __NR_kill 4037
39#define __NR_rename 4038
40#define __NR_mkdir 4039
41#define __NR_rmdir 4040
42#define __NR_dup 4041
43#define __NR_pipe 4042
44#define __NR_times 4043
45#define __NR_prof 4044
46#define __NR_brk 4045
47#define __NR_setgid 4046
48#define __NR_getgid 4047
49#define __NR_signal 4048
50#define __NR_geteuid 4049
51#define __NR_getegid 4050
52#define __NR_acct 4051
53#define __NR_umount2 4052
54#define __NR_lock 4053
55#define __NR_ioctl 4054
56#define __NR_fcntl 4055
57#define __NR_mpx 4056
58#define __NR_setpgid 4057
59#define __NR_ulimit 4058
60#define __NR_unused59 4059
61#define __NR_umask 4060
62#define __NR_chroot 4061
63#define __NR_ustat 4062
64#define __NR_dup2 4063
65#define __NR_getppid 4064
66#define __NR_getpgrp 4065
67#define __NR_setsid 4066
68#define __NR_sigaction 4067
69#define __NR_sgetmask 4068
70#define __NR_ssetmask 4069
71#define __NR_setreuid 4070
72#define __NR_setregid 4071
73#define __NR_sigsuspend 4072
74#define __NR_sigpending 4073
75#define __NR_sethostname 4074
76#define __NR_setrlimit 4075
77#define __NR_getrlimit 4076
78#define __NR_getrusage 4077
79#define __NR_gettimeofday 4078
80#define __NR_settimeofday 4079
81#define __NR_getgroups 4080
82#define __NR_setgroups 4081
83#define __NR_reserved82 4082
84#define __NR_symlink 4083
85#define __NR_unused84 4084
86#define __NR_readlink 4085
87#define __NR_uselib 4086
88#define __NR_swapon 4087
89#define __NR_reboot 4088
90#define __NR_readdir 4089
91#define __NR_mmap 4090
92#define __NR_munmap 4091
93#define __NR_truncate 4092
94#define __NR_ftruncate 4093
95#define __NR_fchmod 4094
96#define __NR_fchown 4095
97#define __NR_getpriority 4096
98#define __NR_setpriority 4097
99#define __NR_profil 4098
100#define __NR_statfs 4099
101#define __NR_fstatfs 4100
102#define __NR_ioperm 4101
103#define __NR_socketcall 4102
104#define __NR_syslog 4103
105#define __NR_setitimer 4104
106#define __NR_getitimer 4105
107#define __NR_stat 4106
108#define __NR_lstat 4107
109#define __NR_fstat 4108
110#define __NR_unused109 4109
111#define __NR_iopl 4110
112#define __NR_vhangup 4111
113#define __NR_idle 4112
114#define __NR_vm86 4113
115#define __NR_wait4 4114
116#define __NR_swapoff 4115
117#define __NR_sysinfo 4116
118#define __NR_ipc 4117
119#define __NR_fsync 4118
120#define __NR_sigreturn 4119
121#define __NR_clone 4120
122#define __NR_setdomainname 4121
123#define __NR_uname 4122
124#define __NR_modify_ldt 4123
125#define __NR_adjtimex 4124
126#define __NR_mprotect 4125
127#define __NR_sigprocmask 4126
128#define __NR_create_module 4127
129#define __NR_init_module 4128
130#define __NR_delete_module 4129
131#define __NR_get_kernel_syms 4130
132#define __NR_quotactl 4131
133#define __NR_getpgid 4132
134#define __NR_fchdir 4133
135#define __NR_bdflush 4134
136#define __NR_sysfs 4135
137#define __NR_personality 4136
138#define __NR_afs_syscall 4137
139#define __NR_setfsuid 4138
140#define __NR_setfsgid 4139
141#define __NR__llseek 4140
142#define __NR_getdents 4141
143#define __NR__newselect 4142
144#define __NR_flock 4143
145#define __NR_msync 4144
146#define __NR_readv 4145
147#define __NR_writev 4146
148#define __NR_cacheflush 4147
149#define __NR_cachectl 4148
150#define __NR_sysmips 4149
151#define __NR_unused150 4150
152#define __NR_getsid 4151
153#define __NR_fdatasync 4152
154#define __NR__sysctl 4153
155#define __NR_mlock 4154
156#define __NR_munlock 4155
157#define __NR_mlockall 4156
158#define __NR_munlockall 4157
159#define __NR_sched_setparam 4158
160#define __NR_sched_getparam 4159
161#define __NR_sched_setscheduler 4160
162#define __NR_sched_getscheduler 4161
163#define __NR_sched_yield 4162
164#define __NR_sched_get_priority_max 4163
165#define __NR_sched_get_priority_min 4164
166#define __NR_sched_rr_get_interval 4165
167#define __NR_nanosleep 4166
168#define __NR_mremap 4167
169#define __NR_accept 4168
170#define __NR_bind 4169
171#define __NR_connect 4170
172#define __NR_getpeername 4171
173#define __NR_getsockname 4172
174#define __NR_getsockopt 4173
175#define __NR_listen 4174
176#define __NR_recv 4175
177#define __NR_recvfrom 4176
178#define __NR_recvmsg 4177
179#define __NR_send 4178
180#define __NR_sendmsg 4179
181#define __NR_sendto 4180
182#define __NR_setsockopt 4181
183#define __NR_shutdown 4182
184#define __NR_socket 4183
185#define __NR_socketpair 4184
186#define __NR_setresuid 4185
187#define __NR_getresuid 4186
188#define __NR_query_module 4187
189#define __NR_poll 4188
190#define __NR_nfsservctl 4189
191#define __NR_setresgid 4190
192#define __NR_getresgid 4191
193#define __NR_prctl 4192
194#define __NR_rt_sigreturn 4193
195#define __NR_rt_sigaction 4194
196#define __NR_rt_sigprocmask 4195
197#define __NR_rt_sigpending 4196
198#define __NR_rt_sigtimedwait 4197
199#define __NR_rt_sigqueueinfo 4198
200#define __NR_rt_sigsuspend 4199
201#define __NR_pread64 4200
202#define __NR_pwrite64 4201
203#define __NR_chown 4202
204#define __NR_getcwd 4203
205#define __NR_capget 4204
206#define __NR_capset 4205
207#define __NR_sigaltstack 4206
208#define __NR_sendfile 4207
209#define __NR_getpmsg 4208
210#define __NR_putpmsg 4209
211#define __NR_mmap2 4210
212#define __NR_truncate64 4211
213#define __NR_ftruncate64 4212
214#define __NR_stat64 4213
215#define __NR_lstat64 4214
216#define __NR_fstat64 4215
217#define __NR_pivot_root 4216
218#define __NR_mincore 4217
219#define __NR_madvise 4218
220#define __NR_getdents64 4219
221#define __NR_fcntl64 4220
222#define __NR_reserved221 4221
223#define __NR_gettid 4222
224#define __NR_readahead 4223
225#define __NR_setxattr 4224
226#define __NR_lsetxattr 4225
227#define __NR_fsetxattr 4226
228#define __NR_getxattr 4227
229#define __NR_lgetxattr 4228
230#define __NR_fgetxattr 4229
231#define __NR_listxattr 4230
232#define __NR_llistxattr 4231
233#define __NR_flistxattr 4232
234#define __NR_removexattr 4233
235#define __NR_lremovexattr 4234
236#define __NR_fremovexattr 4235
237#define __NR_tkill 4236
238#define __NR_sendfile64 4237
239#define __NR_futex 4238
240#define __NR_sched_setaffinity 4239
241#define __NR_sched_getaffinity 4240
242#define __NR_io_setup 4241
243#define __NR_io_destroy 4242
244#define __NR_io_getevents 4243
245#define __NR_io_submit 4244
246#define __NR_io_cancel 4245
247#define __NR_exit_group 4246
248#define __NR_lookup_dcookie 4247
249#define __NR_epoll_create 4248
250#define __NR_epoll_ctl 4249
251#define __NR_epoll_wait 4250
252#define __NR_remap_file_pages 4251
253#define __NR_set_tid_address 4252
254#define __NR_restart_syscall 4253
255#define __NR_fadvise64 4254
256#define __NR_statfs64 4255
257#define __NR_fstatfs64 4256
258#define __NR_timer_create 4257
259#define __NR_timer_settime 4258
260#define __NR_timer_gettime 4259
261#define __NR_timer_getoverrun 4260
262#define __NR_timer_delete 4261
263#define __NR_clock_settime 4262
264#define __NR_clock_gettime 4263
265#define __NR_clock_getres 4264
266#define __NR_clock_nanosleep 4265
267#define __NR_tgkill 4266
268#define __NR_utimes 4267
269#define __NR_mbind 4268
270#define __NR_get_mempolicy 4269
271#define __NR_set_mempolicy 4270
272#define __NR_mq_open 4271
273#define __NR_mq_unlink 4272
274#define __NR_mq_timedsend 4273
275#define __NR_mq_timedreceive 4274
276#define __NR_mq_notify 4275
277#define __NR_mq_getsetattr 4276
278#define __NR_vserver 4277
279#define __NR_waitid 4278
280#define __NR_add_key 4280
281#define __NR_request_key 4281
282#define __NR_keyctl 4282
283#define __NR_set_thread_area 4283
284#define __NR_inotify_init 4284
285#define __NR_inotify_add_watch 4285
286#define __NR_inotify_rm_watch 4286
287#define __NR_migrate_pages 4287
288#define __NR_openat 4288
289#define __NR_mkdirat 4289
290#define __NR_mknodat 4290
291#define __NR_fchownat 4291
292#define __NR_futimesat 4292
293#define __NR_fstatat64 4293
294#define __NR_unlinkat 4294
295#define __NR_renameat 4295
296#define __NR_linkat 4296
297#define __NR_symlinkat 4297
298#define __NR_readlinkat 4298
299#define __NR_fchmodat 4299
300#define __NR_faccessat 4300
301#define __NR_pselect6 4301
302#define __NR_ppoll 4302
303#define __NR_unshare 4303
304#define __NR_splice 4304
305#define __NR_sync_file_range 4305
306#define __NR_tee 4306
307#define __NR_vmsplice 4307
308#define __NR_move_pages 4308
309#define __NR_set_robust_list 4309
310#define __NR_get_robust_list 4310
311#define __NR_kexec_load 4311
312#define __NR_getcpu 4312
313#define __NR_epoll_pwait 4313
314#define __NR_ioprio_set 4314
315#define __NR_ioprio_get 4315
316#define __NR_utimensat 4316
317#define __NR_signalfd 4317
318#define __NR_timerfd 4318
319#define __NR_eventfd 4319
320#define __NR_fallocate 4320
321#define __NR_timerfd_create 4321
322#define __NR_timerfd_gettime 4322
323#define __NR_timerfd_settime 4323
324#define __NR_signalfd4 4324
325#define __NR_eventfd2 4325
326#define __NR_epoll_create1 4326
327#define __NR_dup3 4327
328#define __NR_pipe2 4328
329#define __NR_inotify_init1 4329
330#define __NR_preadv 4330
331#define __NR_pwritev 4331
332#define __NR_rt_tgsigqueueinfo 4332
333#define __NR_perf_event_open 4333
334#define __NR_accept4 4334
335#define __NR_recvmmsg 4335
336#define __NR_fanotify_init 4336
337#define __NR_fanotify_mark 4337
338#define __NR_prlimit64 4338
339#define __NR_name_to_handle_at 4339
340#define __NR_open_by_handle_at 4340
341#define __NR_clock_adjtime 4341
342#define __NR_syncfs 4342
343#define __NR_sendmmsg 4343
344#define __NR_setns 4344
345#define __NR_process_vm_readv 4345
346#define __NR_process_vm_writev 4346
347#define __NR_kcmp 4347
348#define __NR_finit_module 4348
349#define __NR_sched_setattr 4349
350#define __NR_sched_getattr 4350
351#define __NR_renameat2 4351
352#define __NR_seccomp 4352
353#define __NR_getrandom 4353
354#define __NR_memfd_create 4354
355#define __NR_bpf 4355
356#define __NR_execveat 4356
357#define __NR_userfaultfd 4357
358#define __NR_membarrier 4358
359#define __NR_mlock2 4359
360#define __NR_copy_file_range 4360
361#define __NR_preadv2 4361
362#define __NR_pwritev2 4362
363#define __NR_pkey_mprotect 4363
364#define __NR_pkey_alloc 4364
365#define __NR_pkey_free 4365
366#define __NR_statx 4366
367#define __NR_rseq 4367
368#define __NR_io_pgetevents 4368
369
370#define SYS_syscall 4000
371#define SYS_exit 4001
372#define SYS_fork 4002
373#define SYS_read 4003
374#define SYS_write 4004
375#define SYS_open 4005
376#define SYS_close 4006
377#define SYS_waitpid 4007
378#define SYS_creat 4008
379#define SYS_link 4009
380#define SYS_unlink 4010
381#define SYS_execve 4011
382#define SYS_chdir 4012
383#define SYS_time 4013
384#define SYS_mknod 4014
385#define SYS_chmod 4015
386#define SYS_lchown 4016
387#define SYS_break 4017
388#define SYS_unused18 4018
389#define SYS_lseek 4019
390#define SYS_getpid 4020
391#define SYS_mount 4021
392#define SYS_umount 4022
393#define SYS_setuid 4023
394#define SYS_getuid 4024
395#define SYS_stime 4025
396#define SYS_ptrace 4026
397#define SYS_alarm 4027
398#define SYS_unused28 4028
399#define SYS_pause 4029
400#define SYS_utime 4030
401#define SYS_stty 4031
402#define SYS_gtty 4032
403#define SYS_access 4033
404#define SYS_nice 4034
405#define SYS_ftime 4035
406#define SYS_sync 4036
407#define SYS_kill 4037
408#define SYS_rename 4038
409#define SYS_mkdir 4039
410#define SYS_rmdir 4040
411#define SYS_dup 4041
412#define SYS_pipe 4042
413#define SYS_times 4043
414#define SYS_prof 4044
415#define SYS_brk 4045
416#define SYS_setgid 4046
417#define SYS_getgid 4047
418#define SYS_signal 4048
419#define SYS_geteuid 4049
420#define SYS_getegid 4050
421#define SYS_acct 4051
422#define SYS_umount2 4052
423#define SYS_lock 4053
424#define SYS_ioctl 4054
425#define SYS_fcntl 4055
426#define SYS_mpx 4056
427#define SYS_setpgid 4057
428#define SYS_ulimit 4058
429#define SYS_unused59 4059
430#define SYS_umask 4060
431#define SYS_chroot 4061
432#define SYS_ustat 4062
433#define SYS_dup2 4063
434#define SYS_getppid 4064
435#define SYS_getpgrp 4065
436#define SYS_setsid 4066
437#define SYS_sigaction 4067
438#define SYS_sgetmask 4068
439#define SYS_ssetmask 4069
440#define SYS_setreuid 4070
441#define SYS_setregid 4071
442#define SYS_sigsuspend 4072
443#define SYS_sigpending 4073
444#define SYS_sethostname 4074
445#define SYS_setrlimit 4075
446#define SYS_getrlimit 4076
447#define SYS_getrusage 4077
448#define SYS_gettimeofday 4078
449#define SYS_settimeofday 4079
450#define SYS_getgroups 4080
451#define SYS_setgroups 4081
452#define SYS_reserved82 4082
453#define SYS_symlink 4083
454#define SYS_unused84 4084
455#define SYS_readlink 4085
456#define SYS_uselib 4086
457#define SYS_swapon 4087
458#define SYS_reboot 4088
459#define SYS_readdir 4089
460#define SYS_mmap 4090
461#define SYS_munmap 4091
462#define SYS_truncate 4092
463#define SYS_ftruncate 4093
464#define SYS_fchmod 4094
465#define SYS_fchown 4095
466#define SYS_getpriority 4096
467#define SYS_setpriority 4097
468#define SYS_profil 4098
469#define SYS_statfs 4099
470#define SYS_fstatfs 4100
471#define SYS_ioperm 4101
472#define SYS_socketcall 4102
473#define SYS_syslog 4103
474#define SYS_setitimer 4104
475#define SYS_getitimer 4105
476#define SYS_stat 4106
477#define SYS_lstat 4107
478#define SYS_fstat 4108
479#define SYS_unused109 4109
480#define SYS_iopl 4110
481#define SYS_vhangup 4111
482#define SYS_idle 4112
483#define SYS_vm86 4113
484#define SYS_wait4 4114
485#define SYS_swapoff 4115
486#define SYS_sysinfo 4116
487#define SYS_ipc 4117
488#define SYS_fsync 4118
489#define SYS_sigreturn 4119
490#define SYS_clone 4120
491#define SYS_setdomainname 4121
492#define SYS_uname 4122
493#define SYS_modify_ldt 4123
494#define SYS_adjtimex 4124
495#define SYS_mprotect 4125
496#define SYS_sigprocmask 4126
497#define SYS_create_module 4127
498#define SYS_init_module 4128
499#define SYS_delete_module 4129
500#define SYS_get_kernel_syms 4130
501#define SYS_quotactl 4131
502#define SYS_getpgid 4132
503#define SYS_fchdir 4133
504#define SYS_bdflush 4134
505#define SYS_sysfs 4135
506#define SYS_personality 4136
507#define SYS_afs_syscall 4137
508#define SYS_setfsuid 4138
509#define SYS_setfsgid 4139
510#define SYS__llseek 4140
511#define SYS_getdents 4141
512#define SYS__newselect 4142
513#define SYS_flock 4143
514#define SYS_msync 4144
515#define SYS_readv 4145
516#define SYS_writev 4146
517#define SYS_cacheflush 4147
518#define SYS_cachectl 4148
519#define SYS_sysmips 4149
520#define SYS_unused150 4150
521#define SYS_getsid 4151
522#define SYS_fdatasync 4152
523#define SYS__sysctl 4153
524#define SYS_mlock 4154
525#define SYS_munlock 4155
526#define SYS_mlockall 4156
527#define SYS_munlockall 4157
528#define SYS_sched_setparam 4158
529#define SYS_sched_getparam 4159
530#define SYS_sched_setscheduler 4160
531#define SYS_sched_getscheduler 4161
532#define SYS_sched_yield 4162
533#define SYS_sched_get_priority_max 4163
534#define SYS_sched_get_priority_min 4164
535#define SYS_sched_rr_get_interval 4165
536#define SYS_nanosleep 4166
537#define SYS_mremap 4167
538#define SYS_accept 4168
539#define SYS_bind 4169
540#define SYS_connect 4170
541#define SYS_getpeername 4171
542#define SYS_getsockname 4172
543#define SYS_getsockopt 4173
544#define SYS_listen 4174
545#define SYS_recv 4175
546#define SYS_recvfrom 4176
547#define SYS_recvmsg 4177
548#define SYS_send 4178
549#define SYS_sendmsg 4179
550#define SYS_sendto 4180
551#define SYS_setsockopt 4181
552#define SYS_shutdown 4182
553#define SYS_socket 4183
554#define SYS_socketpair 4184
555#define SYS_setresuid 4185
556#define SYS_getresuid 4186
557#define SYS_query_module 4187
558#define SYS_poll 4188
559#define SYS_nfsservctl 4189
560#define SYS_setresgid 4190
561#define SYS_getresgid 4191
562#define SYS_prctl 4192
563#define SYS_rt_sigreturn 4193
564#define SYS_rt_sigaction 4194
565#define SYS_rt_sigprocmask 4195
566#define SYS_rt_sigpending 4196
567#define SYS_rt_sigtimedwait 4197
568#define SYS_rt_sigqueueinfo 4198
569#define SYS_rt_sigsuspend 4199
570#define SYS_pread64 4200
571#define SYS_pwrite64 4201
572#define SYS_chown 4202
573#define SYS_getcwd 4203
574#define SYS_capget 4204
575#define SYS_capset 4205
576#define SYS_sigaltstack 4206
577#define SYS_sendfile 4207
578#define SYS_getpmsg 4208
579#define SYS_putpmsg 4209
580#define SYS_mmap2 4210
581#define SYS_truncate64 4211
582#define SYS_ftruncate64 4212
583#define SYS_stat64 4213
584#define SYS_lstat64 4214
585#define SYS_fstat64 4215
586#define SYS_pivot_root 4216
587#define SYS_mincore 4217
588#define SYS_madvise 4218
589#define SYS_getdents64 4219
590#define SYS_fcntl64 4220
591#define SYS_reserved221 4221
592#define SYS_gettid 4222
593#define SYS_readahead 4223
594#define SYS_setxattr 4224
595#define SYS_lsetxattr 4225
596#define SYS_fsetxattr 4226
597#define SYS_getxattr 4227
598#define SYS_lgetxattr 4228
599#define SYS_fgetxattr 4229
600#define SYS_listxattr 4230
601#define SYS_llistxattr 4231
602#define SYS_flistxattr 4232
603#define SYS_removexattr 4233
604#define SYS_lremovexattr 4234
605#define SYS_fremovexattr 4235
606#define SYS_tkill 4236
607#define SYS_sendfile64 4237
608#define SYS_futex 4238
609#define SYS_sched_setaffinity 4239
610#define SYS_sched_getaffinity 4240
611#define SYS_io_setup 4241
612#define SYS_io_destroy 4242
613#define SYS_io_getevents 4243
614#define SYS_io_submit 4244
615#define SYS_io_cancel 4245
616#define SYS_exit_group 4246
617#define SYS_lookup_dcookie 4247
618#define SYS_epoll_create 4248
619#define SYS_epoll_ctl 4249
620#define SYS_epoll_wait 4250
621#define SYS_remap_file_pages 4251
622#define SYS_set_tid_address 4252
623#define SYS_restart_syscall 4253
624#define SYS_fadvise64 4254
625#define SYS_statfs64 4255
626#define SYS_fstatfs64 4256
627#define SYS_timer_create 4257
628#define SYS_timer_settime 4258
629#define SYS_timer_gettime 4259
630#define SYS_timer_getoverrun 4260
631#define SYS_timer_delete 4261
632#define SYS_clock_settime 4262
633#define SYS_clock_gettime 4263
634#define SYS_clock_getres 4264
635#define SYS_clock_nanosleep 4265
636#define SYS_tgkill 4266
637#define SYS_utimes 4267
638#define SYS_mbind 4268
639#define SYS_get_mempolicy 4269
640#define SYS_set_mempolicy 4270
641#define SYS_mq_open 4271
642#define SYS_mq_unlink 4272
643#define SYS_mq_timedsend 4273
644#define SYS_mq_timedreceive 4274
645#define SYS_mq_notify 4275
646#define SYS_mq_getsetattr 4276
647#define SYS_vserver 4277
648#define SYS_waitid 4278
649#define SYS_add_key 4280
650#define SYS_request_key 4281
651#define SYS_keyctl 4282
652#define SYS_set_thread_area 4283
653#define SYS_inotify_init 4284
654#define SYS_inotify_add_watch 4285
655#define SYS_inotify_rm_watch 4286
656#define SYS_migrate_pages 4287
657#define SYS_openat 4288
658#define SYS_mkdirat 4289
659#define SYS_mknodat 4290
660#define SYS_fchownat 4291
661#define SYS_futimesat 4292
662#define SYS_fstatat64 4293
663#define SYS_unlinkat 4294
664#define SYS_renameat 4295
665#define SYS_linkat 4296
666#define SYS_symlinkat 4297
667#define SYS_readlinkat 4298
668#define SYS_fchmodat 4299
669#define SYS_faccessat 4300
670#define SYS_pselect6 4301
671#define SYS_ppoll 4302
672#define SYS_unshare 4303
673#define SYS_splice 4304
674#define SYS_sync_file_range 4305
675#define SYS_tee 4306
676#define SYS_vmsplice 4307
677#define SYS_move_pages 4308
678#define SYS_set_robust_list 4309
679#define SYS_get_robust_list 4310
680#define SYS_kexec_load 4311
681#define SYS_getcpu 4312
682#define SYS_epoll_pwait 4313
683#define SYS_ioprio_set 4314
684#define SYS_ioprio_get 4315
685#define SYS_utimensat 4316
686#define SYS_signalfd 4317
687#define SYS_timerfd 4318
688#define SYS_eventfd 4319
689#define SYS_fallocate 4320
690#define SYS_timerfd_create 4321
691#define SYS_timerfd_gettime 4322
692#define SYS_timerfd_settime 4323
693#define SYS_signalfd4 4324
694#define SYS_eventfd2 4325
695#define SYS_epoll_create1 4326
696#define SYS_dup3 4327
697#define SYS_pipe2 4328
698#define SYS_inotify_init1 4329
699#define SYS_preadv 4330
700#define SYS_pwritev 4331
701#define SYS_rt_tgsigqueueinfo 4332
702#define SYS_perf_event_open 4333
703#define SYS_accept4 4334
704#define SYS_recvmmsg 4335
705#define SYS_fanotify_init 4336
706#define SYS_fanotify_mark 4337
707#define SYS_prlimit64 4338
708#define SYS_name_to_handle_at 4339
709#define SYS_open_by_handle_at 4340
710#define SYS_clock_adjtime 4341
711#define SYS_syncfs 4342
712#define SYS_sendmmsg 4343
713#define SYS_setns 4344
714#define SYS_process_vm_readv 4345
715#define SYS_process_vm_writev 4346
716#define SYS_kcmp 4347
717#define SYS_finit_module 4348
718#define SYS_sched_setattr 4349
719#define SYS_sched_getattr 4350
720#define SYS_renameat2 4351
721#define SYS_seccomp 4352
722#define SYS_getrandom 4353
723#define SYS_memfd_create 4354
724#define SYS_bpf 4355
725#define SYS_execveat 4356
726#define SYS_userfaultfd 4357
727#define SYS_membarrier 4358
728#define SYS_mlock2 4359
729#define SYS_copy_file_range 4360
730#define SYS_preadv2 4361
731#define SYS_pwritev2 4362
732#define SYS_pkey_mprotect 4363
733#define SYS_pkey_alloc 4364
734#define SYS_pkey_free 4365
735#define SYS_statx 4366
736#define SYS_rseq 4367
737#define SYS_io_pgetevents 4368
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/termios.h deleted-169
...@@ -1,169 +0,0 @@
1struct termios {
2 tcflag_t c_iflag;
3 tcflag_t c_oflag;
4 tcflag_t c_cflag;
5 tcflag_t c_lflag;
6 cc_t c_line;
7 cc_t c_cc[NCCS];
8 speed_t __c_ispeed;
9 speed_t __c_ospeed;
10};
11
12#define VINTR 0
13#define VQUIT 1
14#define VERASE 2
15#define VKILL 3
16#define VMIN 4
17#define VTIME 5
18#define VEOL2 6
19#define VSWTC 7
20#define VSWTCH 7
21#define VSTART 8
22#define VSTOP 9
23#define VSUSP 10
24#define VREPRINT 12
25#define VDISCARD 13
26#define VWERASE 14
27#define VLNEXT 15
28#define VEOF 16
29#define VEOL 17
30
31#define IGNBRK 0000001
32#define BRKINT 0000002
33#define IGNPAR 0000004
34#define PARMRK 0000010
35#define INPCK 0000020
36#define ISTRIP 0000040
37#define INLCR 0000100
38#define IGNCR 0000200
39#define ICRNL 0000400
40#define IUCLC 0001000
41#define IXON 0002000
42#define IXANY 0004000
43#define IXOFF 0010000
44#define IMAXBEL 0020000
45#define IUTF8 0040000
46
47#define OPOST 0000001
48#define OLCUC 0000002
49#define ONLCR 0000004
50#define OCRNL 0000010
51#define ONOCR 0000020
52#define ONLRET 0000040
53#define OFILL 0000100
54#define OFDEL 0000200
55#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
56#define NLDLY 0000400
57#define NL0 0000000
58#define NL1 0000400
59#define CRDLY 0003000
60#define CR0 0000000
61#define CR1 0001000
62#define CR2 0002000
63#define CR3 0003000
64#define TABDLY 0014000
65#define TAB0 0000000
66#define TAB1 0004000
67#define TAB2 0010000
68#define TAB3 0014000
69#define BSDLY 0020000
70#define BS0 0000000
71#define BS1 0020000
72#define FFDLY 0100000
73#define FF0 0000000
74#define FF1 0100000
75#endif
76
77#define VTDLY 0040000
78#define VT0 0000000
79#define VT1 0040000
80
81#define B0 0000000
82#define B50 0000001
83#define B75 0000002
84#define B110 0000003
85#define B134 0000004
86#define B150 0000005
87#define B200 0000006
88#define B300 0000007
89#define B600 0000010
90#define B1200 0000011
91#define B1800 0000012
92#define B2400 0000013
93#define B4800 0000014
94#define B9600 0000015
95#define B19200 0000016
96#define B38400 0000017
97
98#define B57600 0010001
99#define B115200 0010002
100#define B230400 0010003
101#define B460800 0010004
102#define B500000 0010005
103#define B576000 0010006
104#define B921600 0010007
105#define B1000000 0010010
106#define B1152000 0010011
107#define B1500000 0010012
108#define B2000000 0010013
109#define B2500000 0010014
110#define B3000000 0010015
111#define B3500000 0010016
112#define B4000000 0010017
113
114#define CSIZE 0000060
115#define CS5 0000000
116#define CS6 0000020
117#define CS7 0000040
118#define CS8 0000060
119#define CSTOPB 0000100
120#define CREAD 0000200
121#define PARENB 0000400
122#define PARODD 0001000
123#define HUPCL 0002000
124#define CLOCAL 0004000
125
126#define ISIG 0000001
127#define ICANON 0000002
128#define ECHO 0000010
129#define ECHOE 0000020
130#define ECHOK 0000040
131#define ECHONL 0000100
132#define NOFLSH 0000200
133#define IEXTEN 0000400
134#define TOSTOP 0100000
135#define ITOSTOP 0100000
136
137#define TCOOFF 0
138#define TCOON 1
139#define TCIOFF 2
140#define TCION 3
141
142#define TCIFLUSH 0
143#define TCOFLUSH 1
144#define TCIOFLUSH 2
145
146#define TCSANOW 0
147#define TCSADRAIN 1
148#define TCSAFLUSH 2
149
150#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
151#define EXTA 0000016
152#define EXTB 0000017
153#define CBAUD 0010017
154#define CBAUDEX 0010000
155#define CIBAUD 002003600000
156#define CMSPAR 010000000000
157#define CRTSCTS 020000000000
158
159#define XCASE 0000004
160#define ECHOCTL 0001000
161#define ECHOPRT 0002000
162#define ECHOKE 0004000
163#define FLUSHO 0020000
164#define PENDIN 0040000
165#define EXTPROC 0200000
166
167#define XTABS 0014000
168#define TIOCSER_TEMT 0x01
169#endif
\ No newline at end of file
lib/libc/include/mipsel-linux-musl/bits/user.h deleted-13
...@@ -1,13 +0,0 @@
1struct user {
2 unsigned long regs[45+64];
3 unsigned long u_tsize, u_dsize, u_ssize;
4 unsigned long start_code, start_data, start_stack;
5 long signal;
6 void *u_ar0;
7 unsigned long magic;
8 char u_comm[32];
9};
10#define ELF_NGREG 45
11#define ELF_NFPREG 33
12typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
13typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 32
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for powerpc-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg int
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef long wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/ioctl.h+1-98
...@@ -78,14 +78,6 @@...@@ -78,14 +78,6 @@
78#define TIOCGSERIAL 0x541E78#define TIOCGSERIAL 0x541E
79#define TIOCSSERIAL 0x541F79#define TIOCSSERIAL 0x541F
80#define TIOCPKT 0x542080#define TIOCPKT 0x5420
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88#define TIOCPKT_IOCTL 64
8981
90#define TIOCNOTTY 0x542282#define TIOCNOTTY 0x5422
91#define TIOCSETD 0x542383#define TIOCSETD 0x5423
...@@ -113,105 +105,16 @@...@@ -113,105 +105,16 @@
113#define TIOCSLCKTRMIOS 0x5457105#define TIOCSLCKTRMIOS 0x5457
114#define TIOCSERGSTRUCT 0x5458106#define TIOCSERGSTRUCT 0x5458
115#define TIOCSERGETLSR 0x5459107#define TIOCSERGETLSR 0x5459
116#define TIOCSER_TEMT 0x01
117#define TIOCSERGETMULTI 0x545A108#define TIOCSERGETMULTI 0x545A
118#define TIOCSERSETMULTI 0x545B109#define TIOCSERSETMULTI 0x545B
119110
120#define TIOCMIWAIT 0x545C111#define TIOCMIWAIT 0x545C
121#define TIOCGICOUNT 0x545D112#define TIOCGICOUNT 0x545D
122113
123
124struct winsize {
125 unsigned short ws_row;
126 unsigned short ws_col;
127 unsigned short ws_xpixel;
128 unsigned short ws_ypixel;
129};
130
131#define N_TTY 0
132#define N_SLIP 1
133#define N_MOUSE 2
134#define N_PPP 3
135#define N_STRIP 4
136#define N_AX25 5
137#define N_X25 6
138#define N_6PACK 7
139#define N_MASC 8
140#define N_R3964 9
141#define N_PROFIBUS_FDL 10
142#define N_IRDA 11
143#define N_SMSBLOCK 12
144#define N_HDLC 13
145#define N_SYNC_PPP 14
146#define N_HCI 15
147
148#define FIOSETOWN 0x8901114#define FIOSETOWN 0x8901
149#define SIOCSPGRP 0x8902115#define SIOCSPGRP 0x8902
150#define FIOGETOWN 0x8903116#define FIOGETOWN 0x8903
151#define SIOCGPGRP 0x8904117#define SIOCGPGRP 0x8904
152#define SIOCATMARK 0x8905118#define SIOCATMARK 0x8905
153#define SIOCGSTAMP 0x8906119#define SIOCGSTAMP 0x8906
154#define SIOCGSTAMPNS 0x8907
155
156#define SIOCADDRT 0x890B
157#define SIOCDELRT 0x890C
158#define SIOCRTMSG 0x890D
159
160#define SIOCGIFNAME 0x8910
161#define SIOCSIFLINK 0x8911
162#define SIOCGIFCONF 0x8912
163#define SIOCGIFFLAGS 0x8913
164#define SIOCSIFFLAGS 0x8914
165#define SIOCGIFADDR 0x8915
166#define SIOCSIFADDR 0x8916
167#define SIOCGIFDSTADDR 0x8917
168#define SIOCSIFDSTADDR 0x8918
169#define SIOCGIFBRDADDR 0x8919
170#define SIOCSIFBRDADDR 0x891a
171#define SIOCGIFNETMASK 0x891b
172#define SIOCSIFNETMASK 0x891c
173#define SIOCGIFMETRIC 0x891d
174#define SIOCSIFMETRIC 0x891e
175#define SIOCGIFMEM 0x891f
176#define SIOCSIFMEM 0x8920
177#define SIOCGIFMTU 0x8921
178#define SIOCSIFMTU 0x8922
179#define SIOCSIFNAME 0x8923
180#define SIOCSIFHWADDR 0x8924
181#define SIOCGIFENCAP 0x8925
182#define SIOCSIFENCAP 0x8926
183#define SIOCGIFHWADDR 0x8927
184#define SIOCGIFSLAVE 0x8929
185#define SIOCSIFSLAVE 0x8930
186#define SIOCADDMULTI 0x8931
187#define SIOCDELMULTI 0x8932
188#define SIOCGIFINDEX 0x8933
189#define SIOGIFINDEX SIOCGIFINDEX
190#define SIOCSIFPFLAGS 0x8934
191#define SIOCGIFPFLAGS 0x8935
192#define SIOCDIFADDR 0x8936
193#define SIOCSIFHWBROADCAST 0x8937
194#define SIOCGIFCOUNT 0x8938
195
196#define SIOCGIFBR 0x8940
197#define SIOCSIFBR 0x8941
198
199#define SIOCGIFTXQLEN 0x8942
200#define SIOCSIFTXQLEN 0x8943
201
202#define SIOCDARP 0x8953
203#define SIOCGARP 0x8954
204#define SIOCSARP 0x8955
205
206#define SIOCDRARP 0x8960
207#define SIOCGRARP 0x8961
208#define SIOCSRARP 0x8962
209
210#define SIOCGIFMAP 0x8970
211#define SIOCSIFMAP 0x8971
212
213#define SIOCADDDLCI 0x8980
214#define SIOCDELDLCI 0x8981
215
216#define SIOCDEVPRIVATE 0x89F0
217#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
120#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/ptrace.h+2
...@@ -8,6 +8,8 @@...@@ -8,6 +8,8 @@
8#define PTRACE_SET_DEBUGREG 0x1a8#define PTRACE_SET_DEBUGREG 0x1a
9#define PTRACE_GETVSRREGS 0x1b9#define PTRACE_GETVSRREGS 0x1b
10#define PTRACE_SETVSRREGS 0x1c10#define PTRACE_SETVSRREGS 0x1c
11#define PTRACE_SYSEMU 0x1d
12#define PTRACE_SYSEMU_SINGLESTEP 0x1e
11#define PTRACE_SINGLEBLOCK 0x10013#define PTRACE_SINGLEBLOCK 0x100
1214
13#define PT_GETVRREGS PTRACE_GETVRREGS15#define PT_GETVRREGS PTRACE_GETVRREGS
lib/libc/include/powerpc-linux-musl/bits/syscall.h deleted-751
...@@ -1,751 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76
78#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_query_module 166
168#define __NR_poll 167
169#define __NR_nfsservctl 168
170#define __NR_setresgid 169
171#define __NR_getresgid 170
172#define __NR_prctl 171
173#define __NR_rt_sigreturn 172
174#define __NR_rt_sigaction 173
175#define __NR_rt_sigprocmask 174
176#define __NR_rt_sigpending 175
177#define __NR_rt_sigtimedwait 176
178#define __NR_rt_sigqueueinfo 177
179#define __NR_rt_sigsuspend 178
180#define __NR_pread64 179
181#define __NR_pwrite64 180
182#define __NR_chown 181
183#define __NR_getcwd 182
184#define __NR_capget 183
185#define __NR_capset 184
186#define __NR_sigaltstack 185
187#define __NR_sendfile 186
188#define __NR_getpmsg 187
189#define __NR_putpmsg 188
190#define __NR_vfork 189
191#define __NR_ugetrlimit 190
192#define __NR_readahead 191
193#define __NR_mmap2 192
194#define __NR_truncate64 193
195#define __NR_ftruncate64 194
196#define __NR_stat64 195
197#define __NR_lstat64 196
198#define __NR_fstat64 197
199#define __NR_pciconfig_read 198
200#define __NR_pciconfig_write 199
201#define __NR_pciconfig_iobase 200
202#define __NR_multiplexer 201
203#define __NR_getdents64 202
204#define __NR_pivot_root 203
205#define __NR_fcntl64 204
206#define __NR_madvise 205
207#define __NR_mincore 206
208#define __NR_gettid 207
209#define __NR_tkill 208
210#define __NR_setxattr 209
211#define __NR_lsetxattr 210
212#define __NR_fsetxattr 211
213#define __NR_getxattr 212
214#define __NR_lgetxattr 213
215#define __NR_fgetxattr 214
216#define __NR_listxattr 215
217#define __NR_llistxattr 216
218#define __NR_flistxattr 217
219#define __NR_removexattr 218
220#define __NR_lremovexattr 219
221#define __NR_fremovexattr 220
222#define __NR_futex 221
223#define __NR_sched_setaffinity 222
224#define __NR_sched_getaffinity 223
225#define __NR_tuxcall 225
226#define __NR_sendfile64 226
227#define __NR_io_setup 227
228#define __NR_io_destroy 228
229#define __NR_io_getevents 229
230#define __NR_io_submit 230
231#define __NR_io_cancel 231
232#define __NR_set_tid_address 232
233#define __NR_fadvise64 233
234#define __NR_exit_group 234
235#define __NR_lookup_dcookie 235
236#define __NR_epoll_create 236
237#define __NR_epoll_ctl 237
238#define __NR_epoll_wait 238
239#define __NR_remap_file_pages 239
240#define __NR_timer_create 240
241#define __NR_timer_settime 241
242#define __NR_timer_gettime 242
243#define __NR_timer_getoverrun 243
244#define __NR_timer_delete 244
245#define __NR_clock_settime 245
246#define __NR_clock_gettime 246
247#define __NR_clock_getres 247
248#define __NR_clock_nanosleep 248
249#define __NR_swapcontext 249
250#define __NR_tgkill 250
251#define __NR_utimes 251
252#define __NR_statfs64 252
253#define __NR_fstatfs64 253
254#define __NR_fadvise64_64 254
255#define __NR_rtas 255
256#define __NR_sys_debug_setcontext 256
257#define __NR_migrate_pages 258
258#define __NR_mbind 259
259#define __NR_get_mempolicy 260
260#define __NR_set_mempolicy 261
261#define __NR_mq_open 262
262#define __NR_mq_unlink 263
263#define __NR_mq_timedsend 264
264#define __NR_mq_timedreceive 265
265#define __NR_mq_notify 266
266#define __NR_mq_getsetattr 267
267#define __NR_kexec_load 268
268#define __NR_add_key 269
269#define __NR_request_key 270
270#define __NR_keyctl 271
271#define __NR_waitid 272
272#define __NR_ioprio_set 273
273#define __NR_ioprio_get 274
274#define __NR_inotify_init 275
275#define __NR_inotify_add_watch 276
276#define __NR_inotify_rm_watch 277
277#define __NR_spu_run 278
278#define __NR_spu_create 279
279#define __NR_pselect6 280
280#define __NR_ppoll 281
281#define __NR_unshare 282
282#define __NR_splice 283
283#define __NR_tee 284
284#define __NR_vmsplice 285
285#define __NR_openat 286
286#define __NR_mkdirat 287
287#define __NR_mknodat 288
288#define __NR_fchownat 289
289#define __NR_futimesat 290
290#define __NR_fstatat64 291
291#define __NR_unlinkat 292
292#define __NR_renameat 293
293#define __NR_linkat 294
294#define __NR_symlinkat 295
295#define __NR_readlinkat 296
296#define __NR_fchmodat 297
297#define __NR_faccessat 298
298#define __NR_get_robust_list 299
299#define __NR_set_robust_list 300
300#define __NR_move_pages 301
301#define __NR_getcpu 302
302#define __NR_epoll_pwait 303
303#define __NR_utimensat 304
304#define __NR_signalfd 305
305#define __NR_timerfd_create 306
306#define __NR_eventfd 307
307#define __NR_sync_file_range2 308
308#define __NR_fallocate 309
309#define __NR_subpage_prot 310
310#define __NR_timerfd_settime 311
311#define __NR_timerfd_gettime 312
312#define __NR_signalfd4 313
313#define __NR_eventfd2 314
314#define __NR_epoll_create1 315
315#define __NR_dup3 316
316#define __NR_pipe2 317
317#define __NR_inotify_init1 318
318#define __NR_perf_event_open 319
319#define __NR_preadv 320
320#define __NR_pwritev 321
321#define __NR_rt_tgsigqueueinfo 322
322#define __NR_fanotify_init 323
323#define __NR_fanotify_mark 324
324#define __NR_prlimit64 325
325#define __NR_socket 326
326#define __NR_bind 327
327#define __NR_connect 328
328#define __NR_listen 329
329#define __NR_accept 330
330#define __NR_getsockname 331
331#define __NR_getpeername 332
332#define __NR_socketpair 333
333#define __NR_send 334
334#define __NR_sendto 335
335#define __NR_recv 336
336#define __NR_recvfrom 337
337#define __NR_shutdown 338
338#define __NR_setsockopt 339
339#define __NR_getsockopt 340
340#define __NR_sendmsg 341
341#define __NR_recvmsg 342
342#define __NR_recvmmsg 343
343#define __NR_accept4 344
344#define __NR_name_to_handle_at 345
345#define __NR_open_by_handle_at 346
346#define __NR_clock_adjtime 347
347#define __NR_syncfs 348
348#define __NR_sendmmsg 349
349#define __NR_setns 350
350#define __NR_process_vm_readv 351
351#define __NR_process_vm_writev 352
352#define __NR_finit_module 353
353#define __NR_kcmp 354
354#define __NR_sched_setattr 355
355#define __NR_sched_getattr 356
356#define __NR_renameat2 357
357#define __NR_seccomp 358
358#define __NR_getrandom 359
359#define __NR_memfd_create 360
360#define __NR_bpf 361
361#define __NR_execveat 362
362#define __NR_switch_endian 363
363#define __NR_userfaultfd 364
364#define __NR_membarrier 365
365#define __NR_mlock2 378
366#define __NR_copy_file_range 379
367#define __NR_preadv2 380
368#define __NR_pwritev2 381
369#define __NR_kexec_file_load 382
370#define __NR_statx 383
371#define __NR_pkey_alloc 384
372#define __NR_pkey_free 385
373#define __NR_pkey_mprotect 386
374#define __NR_rseq 387
375#define __NR_io_pgetevents 388
376
377#define SYS_restart_syscall 0
378#define SYS_exit 1
379#define SYS_fork 2
380#define SYS_read 3
381#define SYS_write 4
382#define SYS_open 5
383#define SYS_close 6
384#define SYS_waitpid 7
385#define SYS_creat 8
386#define SYS_link 9
387#define SYS_unlink 10
388#define SYS_execve 11
389#define SYS_chdir 12
390#define SYS_time 13
391#define SYS_mknod 14
392#define SYS_chmod 15
393#define SYS_lchown 16
394#define SYS_break 17
395#define SYS_oldstat 18
396#define SYS_lseek 19
397#define SYS_getpid 20
398#define SYS_mount 21
399#define SYS_umount 22
400#define SYS_setuid 23
401#define SYS_getuid 24
402#define SYS_stime 25
403#define SYS_ptrace 26
404#define SYS_alarm 27
405#define SYS_oldfstat 28
406#define SYS_pause 29
407#define SYS_utime 30
408#define SYS_stty 31
409#define SYS_gtty 32
410#define SYS_access 33
411#define SYS_nice 34
412#define SYS_ftime 35
413#define SYS_sync 36
414#define SYS_kill 37
415#define SYS_rename 38
416#define SYS_mkdir 39
417#define SYS_rmdir 40
418#define SYS_dup 41
419#define SYS_pipe 42
420#define SYS_times 43
421#define SYS_prof 44
422#define SYS_brk 45
423#define SYS_setgid 46
424#define SYS_getgid 47
425#define SYS_signal 48
426#define SYS_geteuid 49
427#define SYS_getegid 50
428#define SYS_acct 51
429#define SYS_umount2 52
430#define SYS_lock 53
431#define SYS_ioctl 54
432#define SYS_fcntl 55
433#define SYS_mpx 56
434#define SYS_setpgid 57
435#define SYS_ulimit 58
436#define SYS_oldolduname 59
437#define SYS_umask 60
438#define SYS_chroot 61
439#define SYS_ustat 62
440#define SYS_dup2 63
441#define SYS_getppid 64
442#define SYS_getpgrp 65
443#define SYS_setsid 66
444#define SYS_sigaction 67
445#define SYS_sgetmask 68
446#define SYS_ssetmask 69
447#define SYS_setreuid 70
448#define SYS_setregid 71
449#define SYS_sigsuspend 72
450#define SYS_sigpending 73
451#define SYS_sethostname 74
452#define SYS_setrlimit 75
453#define SYS_getrlimit 76
454#define SYS_getrusage 77
455#define SYS_gettimeofday 78
456#define SYS_settimeofday 79
457#define SYS_getgroups 80
458#define SYS_setgroups 81
459#define SYS_select 82
460#define SYS_symlink 83
461#define SYS_oldlstat 84
462#define SYS_readlink 85
463#define SYS_uselib 86
464#define SYS_swapon 87
465#define SYS_reboot 88
466#define SYS_readdir 89
467#define SYS_mmap 90
468#define SYS_munmap 91
469#define SYS_truncate 92
470#define SYS_ftruncate 93
471#define SYS_fchmod 94
472#define SYS_fchown 95
473#define SYS_getpriority 96
474#define SYS_setpriority 97
475#define SYS_profil 98
476#define SYS_statfs 99
477#define SYS_fstatfs 100
478#define SYS_ioperm 101
479#define SYS_socketcall 102
480#define SYS_syslog 103
481#define SYS_setitimer 104
482#define SYS_getitimer 105
483#define SYS_stat 106
484#define SYS_lstat 107
485#define SYS_fstat 108
486#define SYS_olduname 109
487#define SYS_iopl 110
488#define SYS_vhangup 111
489#define SYS_idle 112
490#define SYS_vm86 113
491#define SYS_wait4 114
492#define SYS_swapoff 115
493#define SYS_sysinfo 116
494#define SYS_ipc 117
495#define SYS_fsync 118
496#define SYS_sigreturn 119
497#define SYS_clone 120
498#define SYS_setdomainname 121
499#define SYS_uname 122
500#define SYS_modify_ldt 123
501#define SYS_adjtimex 124
502#define SYS_mprotect 125
503#define SYS_sigprocmask 126
504#define SYS_create_module 127
505#define SYS_init_module 128
506#define SYS_delete_module 129
507#define SYS_get_kernel_syms 130
508#define SYS_quotactl 131
509#define SYS_getpgid 132
510#define SYS_fchdir 133
511#define SYS_bdflush 134
512#define SYS_sysfs 135
513#define SYS_personality 136
514#define SYS_afs_syscall 137
515#define SYS_setfsuid 138
516#define SYS_setfsgid 139
517#define SYS__llseek 140
518#define SYS_getdents 141
519#define SYS__newselect 142
520#define SYS_flock 143
521#define SYS_msync 144
522#define SYS_readv 145
523#define SYS_writev 146
524#define SYS_getsid 147
525#define SYS_fdatasync 148
526#define SYS__sysctl 149
527#define SYS_mlock 150
528#define SYS_munlock 151
529#define SYS_mlockall 152
530#define SYS_munlockall 153
531#define SYS_sched_setparam 154
532#define SYS_sched_getparam 155
533#define SYS_sched_setscheduler 156
534#define SYS_sched_getscheduler 157
535#define SYS_sched_yield 158
536#define SYS_sched_get_priority_max 159
537#define SYS_sched_get_priority_min 160
538#define SYS_sched_rr_get_interval 161
539#define SYS_nanosleep 162
540#define SYS_mremap 163
541#define SYS_setresuid 164
542#define SYS_getresuid 165
543#define SYS_query_module 166
544#define SYS_poll 167
545#define SYS_nfsservctl 168
546#define SYS_setresgid 169
547#define SYS_getresgid 170
548#define SYS_prctl 171
549#define SYS_rt_sigreturn 172
550#define SYS_rt_sigaction 173
551#define SYS_rt_sigprocmask 174
552#define SYS_rt_sigpending 175
553#define SYS_rt_sigtimedwait 176
554#define SYS_rt_sigqueueinfo 177
555#define SYS_rt_sigsuspend 178
556#define SYS_pread64 179
557#define SYS_pwrite64 180
558#define SYS_chown 181
559#define SYS_getcwd 182
560#define SYS_capget 183
561#define SYS_capset 184
562#define SYS_sigaltstack 185
563#define SYS_sendfile 186
564#define SYS_getpmsg 187
565#define SYS_putpmsg 188
566#define SYS_vfork 189
567#define SYS_ugetrlimit 190
568#define SYS_readahead 191
569#define SYS_mmap2 192
570#define SYS_truncate64 193
571#define SYS_ftruncate64 194
572#define SYS_stat64 195
573#define SYS_lstat64 196
574#define SYS_fstat64 197
575#define SYS_pciconfig_read 198
576#define SYS_pciconfig_write 199
577#define SYS_pciconfig_iobase 200
578#define SYS_multiplexer 201
579#define SYS_getdents64 202
580#define SYS_pivot_root 203
581#define SYS_fcntl64 204
582#define SYS_madvise 205
583#define SYS_mincore 206
584#define SYS_gettid 207
585#define SYS_tkill 208
586#define SYS_setxattr 209
587#define SYS_lsetxattr 210
588#define SYS_fsetxattr 211
589#define SYS_getxattr 212
590#define SYS_lgetxattr 213
591#define SYS_fgetxattr 214
592#define SYS_listxattr 215
593#define SYS_llistxattr 216
594#define SYS_flistxattr 217
595#define SYS_removexattr 218
596#define SYS_lremovexattr 219
597#define SYS_fremovexattr 220
598#define SYS_futex 221
599#define SYS_sched_setaffinity 222
600#define SYS_sched_getaffinity 223
601#define SYS_tuxcall 225
602#define SYS_sendfile64 226
603#define SYS_io_setup 227
604#define SYS_io_destroy 228
605#define SYS_io_getevents 229
606#define SYS_io_submit 230
607#define SYS_io_cancel 231
608#define SYS_set_tid_address 232
609#define SYS_fadvise64 233
610#define SYS_exit_group 234
611#define SYS_lookup_dcookie 235
612#define SYS_epoll_create 236
613#define SYS_epoll_ctl 237
614#define SYS_epoll_wait 238
615#define SYS_remap_file_pages 239
616#define SYS_timer_create 240
617#define SYS_timer_settime 241
618#define SYS_timer_gettime 242
619#define SYS_timer_getoverrun 243
620#define SYS_timer_delete 244
621#define SYS_clock_settime 245
622#define SYS_clock_gettime 246
623#define SYS_clock_getres 247
624#define SYS_clock_nanosleep 248
625#define SYS_swapcontext 249
626#define SYS_tgkill 250
627#define SYS_utimes 251
628#define SYS_statfs64 252
629#define SYS_fstatfs64 253
630#define SYS_fadvise64_64 254
631#define SYS_rtas 255
632#define SYS_sys_debug_setcontext 256
633#define SYS_migrate_pages 258
634#define SYS_mbind 259
635#define SYS_get_mempolicy 260
636#define SYS_set_mempolicy 261
637#define SYS_mq_open 262
638#define SYS_mq_unlink 263
639#define SYS_mq_timedsend 264
640#define SYS_mq_timedreceive 265
641#define SYS_mq_notify 266
642#define SYS_mq_getsetattr 267
643#define SYS_kexec_load 268
644#define SYS_add_key 269
645#define SYS_request_key 270
646#define SYS_keyctl 271
647#define SYS_waitid 272
648#define SYS_ioprio_set 273
649#define SYS_ioprio_get 274
650#define SYS_inotify_init 275
651#define SYS_inotify_add_watch 276
652#define SYS_inotify_rm_watch 277
653#define SYS_spu_run 278
654#define SYS_spu_create 279
655#define SYS_pselect6 280
656#define SYS_ppoll 281
657#define SYS_unshare 282
658#define SYS_splice 283
659#define SYS_tee 284
660#define SYS_vmsplice 285
661#define SYS_openat 286
662#define SYS_mkdirat 287
663#define SYS_mknodat 288
664#define SYS_fchownat 289
665#define SYS_futimesat 290
666#define SYS_fstatat64 291
667#define SYS_unlinkat 292
668#define SYS_renameat 293
669#define SYS_linkat 294
670#define SYS_symlinkat 295
671#define SYS_readlinkat 296
672#define SYS_fchmodat 297
673#define SYS_faccessat 298
674#define SYS_get_robust_list 299
675#define SYS_set_robust_list 300
676#define SYS_move_pages 301
677#define SYS_getcpu 302
678#define SYS_epoll_pwait 303
679#define SYS_utimensat 304
680#define SYS_signalfd 305
681#define SYS_timerfd_create 306
682#define SYS_eventfd 307
683#define SYS_sync_file_range2 308
684#define SYS_fallocate 309
685#define SYS_subpage_prot 310
686#define SYS_timerfd_settime 311
687#define SYS_timerfd_gettime 312
688#define SYS_signalfd4 313
689#define SYS_eventfd2 314
690#define SYS_epoll_create1 315
691#define SYS_dup3 316
692#define SYS_pipe2 317
693#define SYS_inotify_init1 318
694#define SYS_perf_event_open 319
695#define SYS_preadv 320
696#define SYS_pwritev 321
697#define SYS_rt_tgsigqueueinfo 322
698#define SYS_fanotify_init 323
699#define SYS_fanotify_mark 324
700#define SYS_prlimit64 325
701#define SYS_socket 326
702#define SYS_bind 327
703#define SYS_connect 328
704#define SYS_listen 329
705#define SYS_accept 330
706#define SYS_getsockname 331
707#define SYS_getpeername 332
708#define SYS_socketpair 333
709#define SYS_send 334
710#define SYS_sendto 335
711#define SYS_recv 336
712#define SYS_recvfrom 337
713#define SYS_shutdown 338
714#define SYS_setsockopt 339
715#define SYS_getsockopt 340
716#define SYS_sendmsg 341
717#define SYS_recvmsg 342
718#define SYS_recvmmsg 343
719#define SYS_accept4 344
720#define SYS_name_to_handle_at 345
721#define SYS_open_by_handle_at 346
722#define SYS_clock_adjtime 347
723#define SYS_syncfs 348
724#define SYS_sendmmsg 349
725#define SYS_setns 350
726#define SYS_process_vm_readv 351
727#define SYS_process_vm_writev 352
728#define SYS_finit_module 353
729#define SYS_kcmp 354
730#define SYS_sched_setattr 355
731#define SYS_sched_getattr 356
732#define SYS_renameat2 357
733#define SYS_seccomp 358
734#define SYS_getrandom 359
735#define SYS_memfd_create 360
736#define SYS_bpf 361
737#define SYS_execveat 362
738#define SYS_switch_endian 363
739#define SYS_userfaultfd 364
740#define SYS_membarrier 365
741#define SYS_mlock2 378
742#define SYS_copy_file_range 379
743#define SYS_preadv2 380
744#define SYS_pwritev2 381
745#define SYS_kexec_file_load 382
746#define SYS_statx 383
747#define SYS_pkey_alloc 384
748#define SYS_pkey_free 385
749#define SYS_pkey_mprotect 386
750#define SYS_rseq 387
751#define SYS_io_pgetevents 388
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/termios.h+1-1
...@@ -167,5 +167,5 @@ struct termios {...@@ -167,5 +167,5 @@ struct termios {
167#define EXTPROC 0x10000000167#define EXTPROC 0x10000000
168168
169#define XTABS 00006000169#define XTABS 00006000
170#define TIOCSER_TEMT 0x01170#define TIOCSER_TEMT 1
171#endif171#endif
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for powerpc64-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/ioctl.h+1-98
...@@ -78,14 +78,6 @@...@@ -78,14 +78,6 @@
78#define TIOCGSERIAL 0x541E78#define TIOCGSERIAL 0x541E
79#define TIOCSSERIAL 0x541F79#define TIOCSSERIAL 0x541F
80#define TIOCPKT 0x542080#define TIOCPKT 0x5420
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88#define TIOCPKT_IOCTL 64
8981
90#define TIOCNOTTY 0x542282#define TIOCNOTTY 0x5422
91#define TIOCSETD 0x542383#define TIOCSETD 0x5423
...@@ -113,105 +105,16 @@...@@ -113,105 +105,16 @@
113#define TIOCSLCKTRMIOS 0x5457105#define TIOCSLCKTRMIOS 0x5457
114#define TIOCSERGSTRUCT 0x5458106#define TIOCSERGSTRUCT 0x5458
115#define TIOCSERGETLSR 0x5459107#define TIOCSERGETLSR 0x5459
116#define TIOCSER_TEMT 0x01
117#define TIOCSERGETMULTI 0x545A108#define TIOCSERGETMULTI 0x545A
118#define TIOCSERSETMULTI 0x545B109#define TIOCSERSETMULTI 0x545B
119110
120#define TIOCMIWAIT 0x545C111#define TIOCMIWAIT 0x545C
121#define TIOCGICOUNT 0x545D112#define TIOCGICOUNT 0x545D
122113
123
124struct winsize {
125 unsigned short ws_row;
126 unsigned short ws_col;
127 unsigned short ws_xpixel;
128 unsigned short ws_ypixel;
129};
130
131#define N_TTY 0
132#define N_SLIP 1
133#define N_MOUSE 2
134#define N_PPP 3
135#define N_STRIP 4
136#define N_AX25 5
137#define N_X25 6
138#define N_6PACK 7
139#define N_MASC 8
140#define N_R3964 9
141#define N_PROFIBUS_FDL 10
142#define N_IRDA 11
143#define N_SMSBLOCK 12
144#define N_HDLC 13
145#define N_SYNC_PPP 14
146#define N_HCI 15
147
148#define FIOSETOWN 0x8901114#define FIOSETOWN 0x8901
149#define SIOCSPGRP 0x8902115#define SIOCSPGRP 0x8902
150#define FIOGETOWN 0x8903116#define FIOGETOWN 0x8903
151#define SIOCGPGRP 0x8904117#define SIOCGPGRP 0x8904
152#define SIOCATMARK 0x8905118#define SIOCATMARK 0x8905
153#define SIOCGSTAMP 0x8906119#define SIOCGSTAMP 0x8906
154#define SIOCGSTAMPNS 0x8907
155
156#define SIOCADDRT 0x890B
157#define SIOCDELRT 0x890C
158#define SIOCRTMSG 0x890D
159
160#define SIOCGIFNAME 0x8910
161#define SIOCSIFLINK 0x8911
162#define SIOCGIFCONF 0x8912
163#define SIOCGIFFLAGS 0x8913
164#define SIOCSIFFLAGS 0x8914
165#define SIOCGIFADDR 0x8915
166#define SIOCSIFADDR 0x8916
167#define SIOCGIFDSTADDR 0x8917
168#define SIOCSIFDSTADDR 0x8918
169#define SIOCGIFBRDADDR 0x8919
170#define SIOCSIFBRDADDR 0x891a
171#define SIOCGIFNETMASK 0x891b
172#define SIOCSIFNETMASK 0x891c
173#define SIOCGIFMETRIC 0x891d
174#define SIOCSIFMETRIC 0x891e
175#define SIOCGIFMEM 0x891f
176#define SIOCSIFMEM 0x8920
177#define SIOCGIFMTU 0x8921
178#define SIOCSIFMTU 0x8922
179#define SIOCSIFNAME 0x8923
180#define SIOCSIFHWADDR 0x8924
181#define SIOCGIFENCAP 0x8925
182#define SIOCSIFENCAP 0x8926
183#define SIOCGIFHWADDR 0x8927
184#define SIOCGIFSLAVE 0x8929
185#define SIOCSIFSLAVE 0x8930
186#define SIOCADDMULTI 0x8931
187#define SIOCDELMULTI 0x8932
188#define SIOCGIFINDEX 0x8933
189#define SIOGIFINDEX SIOCGIFINDEX
190#define SIOCSIFPFLAGS 0x8934
191#define SIOCGIFPFLAGS 0x8935
192#define SIOCDIFADDR 0x8936
193#define SIOCSIFHWBROADCAST 0x8937
194#define SIOCGIFCOUNT 0x8938
195
196#define SIOCGIFBR 0x8940
197#define SIOCSIFBR 0x8941
198
199#define SIOCGIFTXQLEN 0x8942
200#define SIOCSIFTXQLEN 0x8943
201
202#define SIOCDARP 0x8953
203#define SIOCGARP 0x8954
204#define SIOCSARP 0x8955
205
206#define SIOCDRARP 0x8960
207#define SIOCGRARP 0x8961
208#define SIOCSRARP 0x8962
209
210#define SIOCGIFMAP 0x8970
211#define SIOCSIFMAP 0x8971
212
213#define SIOCADDDLCI 0x8980
214#define SIOCDELDLCI 0x8981
215
216#define SIOCDEVPRIVATE 0x89F0
217#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
120#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/ptrace.h+2
...@@ -8,6 +8,8 @@...@@ -8,6 +8,8 @@
8#define PTRACE_SET_DEBUGREG 0x1a8#define PTRACE_SET_DEBUGREG 0x1a
9#define PTRACE_GETVSRREGS 0x1b9#define PTRACE_GETVSRREGS 0x1b
10#define PTRACE_SETVSRREGS 0x1c10#define PTRACE_SETVSRREGS 0x1c
11#define PTRACE_SYSEMU 0x1d
12#define PTRACE_SYSEMU_SINGLESTEP 0x1e
11#define PTRACE_SINGLEBLOCK 0x10013#define PTRACE_SINGLEBLOCK 0x100
1214
13#define PT_GETVRREGS PTRACE_GETVRREGS15#define PT_GETVRREGS PTRACE_GETVRREGS
lib/libc/include/powerpc64-linux-musl/bits/signal.h+12-5
...@@ -16,11 +16,18 @@ typedef struct {...@@ -16,11 +16,18 @@ typedef struct {
16} fpregset_t;16} fpregset_t;
1717
18typedef struct {18typedef struct {
19 unsigned __int128 vrregs[32];19#ifdef __GNUC__
20 unsigned _pad[3];20 __attribute__((__aligned__(16)))
21 unsigned vrsave;21#endif
22 unsigned vscr;22 unsigned vrregs[32][4];
23 unsigned _pad2[3];23 struct {
24#if __BIG_ENDIAN__
25 unsigned _pad[3], vscr_word;
26#else
27 unsigned vscr_word, _pad[3];
28#endif
29 } vscr;
30 unsigned vrsave, _pad[3];
24} vrregset_t;31} vrregset_t;
2532
26typedef struct sigcontext {33typedef struct sigcontext {
lib/libc/include/powerpc64-linux-musl/bits/syscall.h deleted-733
...@@ -1,733 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76
78#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_query_module 166
168#define __NR_poll 167
169#define __NR_nfsservctl 168
170#define __NR_setresgid 169
171#define __NR_getresgid 170
172#define __NR_prctl 171
173#define __NR_rt_sigreturn 172
174#define __NR_rt_sigaction 173
175#define __NR_rt_sigprocmask 174
176#define __NR_rt_sigpending 175
177#define __NR_rt_sigtimedwait 176
178#define __NR_rt_sigqueueinfo 177
179#define __NR_rt_sigsuspend 178
180#define __NR_pread64 179
181#define __NR_pwrite64 180
182#define __NR_chown 181
183#define __NR_getcwd 182
184#define __NR_capget 183
185#define __NR_capset 184
186#define __NR_sigaltstack 185
187#define __NR_sendfile 186
188#define __NR_getpmsg 187
189#define __NR_putpmsg 188
190#define __NR_vfork 189
191#define __NR_ugetrlimit 190
192#define __NR_readahead 191
193#define __NR_pciconfig_read 198
194#define __NR_pciconfig_write 199
195#define __NR_pciconfig_iobase 200
196#define __NR_multiplexer 201
197#define __NR_getdents64 202
198#define __NR_pivot_root 203
199#define __NR_madvise 205
200#define __NR_mincore 206
201#define __NR_gettid 207
202#define __NR_tkill 208
203#define __NR_setxattr 209
204#define __NR_lsetxattr 210
205#define __NR_fsetxattr 211
206#define __NR_getxattr 212
207#define __NR_lgetxattr 213
208#define __NR_fgetxattr 214
209#define __NR_listxattr 215
210#define __NR_llistxattr 216
211#define __NR_flistxattr 217
212#define __NR_removexattr 218
213#define __NR_lremovexattr 219
214#define __NR_fremovexattr 220
215#define __NR_futex 221
216#define __NR_sched_setaffinity 222
217#define __NR_sched_getaffinity 223
218#define __NR_tuxcall 225
219#define __NR_io_setup 227
220#define __NR_io_destroy 228
221#define __NR_io_getevents 229
222#define __NR_io_submit 230
223#define __NR_io_cancel 231
224#define __NR_set_tid_address 232
225#define __NR_fadvise64 233
226#define __NR_exit_group 234
227#define __NR_lookup_dcookie 235
228#define __NR_epoll_create 236
229#define __NR_epoll_ctl 237
230#define __NR_epoll_wait 238
231#define __NR_remap_file_pages 239
232#define __NR_timer_create 240
233#define __NR_timer_settime 241
234#define __NR_timer_gettime 242
235#define __NR_timer_getoverrun 243
236#define __NR_timer_delete 244
237#define __NR_clock_settime 245
238#define __NR_clock_gettime 246
239#define __NR_clock_getres 247
240#define __NR_clock_nanosleep 248
241#define __NR_swapcontext 249
242#define __NR_tgkill 250
243#define __NR_utimes 251
244#define __NR_statfs64 252
245#define __NR_fstatfs64 253
246#define __NR_rtas 255
247#define __NR_sys_debug_setcontext 256
248#define __NR_migrate_pages 258
249#define __NR_mbind 259
250#define __NR_get_mempolicy 260
251#define __NR_set_mempolicy 261
252#define __NR_mq_open 262
253#define __NR_mq_unlink 263
254#define __NR_mq_timedsend 264
255#define __NR_mq_timedreceive 265
256#define __NR_mq_notify 266
257#define __NR_mq_getsetattr 267
258#define __NR_kexec_load 268
259#define __NR_add_key 269
260#define __NR_request_key 270
261#define __NR_keyctl 271
262#define __NR_waitid 272
263#define __NR_ioprio_set 273
264#define __NR_ioprio_get 274
265#define __NR_inotify_init 275
266#define __NR_inotify_add_watch 276
267#define __NR_inotify_rm_watch 277
268#define __NR_spu_run 278
269#define __NR_spu_create 279
270#define __NR_pselect6 280
271#define __NR_ppoll 281
272#define __NR_unshare 282
273#define __NR_splice 283
274#define __NR_tee 284
275#define __NR_vmsplice 285
276#define __NR_openat 286
277#define __NR_mkdirat 287
278#define __NR_mknodat 288
279#define __NR_fchownat 289
280#define __NR_futimesat 290
281#define __NR_newfstatat 291
282#define __NR_unlinkat 292
283#define __NR_renameat 293
284#define __NR_linkat 294
285#define __NR_symlinkat 295
286#define __NR_readlinkat 296
287#define __NR_fchmodat 297
288#define __NR_faccessat 298
289#define __NR_get_robust_list 299
290#define __NR_set_robust_list 300
291#define __NR_move_pages 301
292#define __NR_getcpu 302
293#define __NR_epoll_pwait 303
294#define __NR_utimensat 304
295#define __NR_signalfd 305
296#define __NR_timerfd_create 306
297#define __NR_eventfd 307
298#define __NR_sync_file_range2 308
299#define __NR_fallocate 309
300#define __NR_subpage_prot 310
301#define __NR_timerfd_settime 311
302#define __NR_timerfd_gettime 312
303#define __NR_signalfd4 313
304#define __NR_eventfd2 314
305#define __NR_epoll_create1 315
306#define __NR_dup3 316
307#define __NR_pipe2 317
308#define __NR_inotify_init1 318
309#define __NR_perf_event_open 319
310#define __NR_preadv 320
311#define __NR_pwritev 321
312#define __NR_rt_tgsigqueueinfo 322
313#define __NR_fanotify_init 323
314#define __NR_fanotify_mark 324
315#define __NR_prlimit64 325
316#define __NR_socket 326
317#define __NR_bind 327
318#define __NR_connect 328
319#define __NR_listen 329
320#define __NR_accept 330
321#define __NR_getsockname 331
322#define __NR_getpeername 332
323#define __NR_socketpair 333
324#define __NR_send 334
325#define __NR_sendto 335
326#define __NR_recv 336
327#define __NR_recvfrom 337
328#define __NR_shutdown 338
329#define __NR_setsockopt 339
330#define __NR_getsockopt 340
331#define __NR_sendmsg 341
332#define __NR_recvmsg 342
333#define __NR_recvmmsg 343
334#define __NR_accept4 344
335#define __NR_name_to_handle_at 345
336#define __NR_open_by_handle_at 346
337#define __NR_clock_adjtime 347
338#define __NR_syncfs 348
339#define __NR_sendmmsg 349
340#define __NR_setns 350
341#define __NR_process_vm_readv 351
342#define __NR_process_vm_writev 352
343#define __NR_finit_module 353
344#define __NR_kcmp 354
345#define __NR_sched_setattr 355
346#define __NR_sched_getattr 356
347#define __NR_renameat2 357
348#define __NR_seccomp 358
349#define __NR_getrandom 359
350#define __NR_memfd_create 360
351#define __NR_bpf 361
352#define __NR_execveat 362
353#define __NR_switch_endian 363
354#define __NR_userfaultfd 364
355#define __NR_membarrier 365
356#define __NR_mlock2 378
357#define __NR_copy_file_range 379
358#define __NR_preadv2 380
359#define __NR_pwritev2 381
360#define __NR_kexec_file_load 382
361#define __NR_statx 383
362#define __NR_pkey_alloc 384
363#define __NR_pkey_free 385
364#define __NR_pkey_mprotect 386
365#define __NR_rseq 387
366#define __NR_io_pgetevents 388
367
368#define SYS_restart_syscall 0
369#define SYS_exit 1
370#define SYS_fork 2
371#define SYS_read 3
372#define SYS_write 4
373#define SYS_open 5
374#define SYS_close 6
375#define SYS_waitpid 7
376#define SYS_creat 8
377#define SYS_link 9
378#define SYS_unlink 10
379#define SYS_execve 11
380#define SYS_chdir 12
381#define SYS_time 13
382#define SYS_mknod 14
383#define SYS_chmod 15
384#define SYS_lchown 16
385#define SYS_break 17
386#define SYS_oldstat 18
387#define SYS_lseek 19
388#define SYS_getpid 20
389#define SYS_mount 21
390#define SYS_umount 22
391#define SYS_setuid 23
392#define SYS_getuid 24
393#define SYS_stime 25
394#define SYS_ptrace 26
395#define SYS_alarm 27
396#define SYS_oldfstat 28
397#define SYS_pause 29
398#define SYS_utime 30
399#define SYS_stty 31
400#define SYS_gtty 32
401#define SYS_access 33
402#define SYS_nice 34
403#define SYS_ftime 35
404#define SYS_sync 36
405#define SYS_kill 37
406#define SYS_rename 38
407#define SYS_mkdir 39
408#define SYS_rmdir 40
409#define SYS_dup 41
410#define SYS_pipe 42
411#define SYS_times 43
412#define SYS_prof 44
413#define SYS_brk 45
414#define SYS_setgid 46
415#define SYS_getgid 47
416#define SYS_signal 48
417#define SYS_geteuid 49
418#define SYS_getegid 50
419#define SYS_acct 51
420#define SYS_umount2 52
421#define SYS_lock 53
422#define SYS_ioctl 54
423#define SYS_fcntl 55
424#define SYS_mpx 56
425#define SYS_setpgid 57
426#define SYS_ulimit 58
427#define SYS_oldolduname 59
428#define SYS_umask 60
429#define SYS_chroot 61
430#define SYS_ustat 62
431#define SYS_dup2 63
432#define SYS_getppid 64
433#define SYS_getpgrp 65
434#define SYS_setsid 66
435#define SYS_sigaction 67
436#define SYS_sgetmask 68
437#define SYS_ssetmask 69
438#define SYS_setreuid 70
439#define SYS_setregid 71
440#define SYS_sigsuspend 72
441#define SYS_sigpending 73
442#define SYS_sethostname 74
443#define SYS_setrlimit 75
444#define SYS_getrlimit 76
445#define SYS_getrusage 77
446#define SYS_gettimeofday 78
447#define SYS_settimeofday 79
448#define SYS_getgroups 80
449#define SYS_setgroups 81
450#define SYS_select 82
451#define SYS_symlink 83
452#define SYS_oldlstat 84
453#define SYS_readlink 85
454#define SYS_uselib 86
455#define SYS_swapon 87
456#define SYS_reboot 88
457#define SYS_readdir 89
458#define SYS_mmap 90
459#define SYS_munmap 91
460#define SYS_truncate 92
461#define SYS_ftruncate 93
462#define SYS_fchmod 94
463#define SYS_fchown 95
464#define SYS_getpriority 96
465#define SYS_setpriority 97
466#define SYS_profil 98
467#define SYS_statfs 99
468#define SYS_fstatfs 100
469#define SYS_ioperm 101
470#define SYS_socketcall 102
471#define SYS_syslog 103
472#define SYS_setitimer 104
473#define SYS_getitimer 105
474#define SYS_stat 106
475#define SYS_lstat 107
476#define SYS_fstat 108
477#define SYS_olduname 109
478#define SYS_iopl 110
479#define SYS_vhangup 111
480#define SYS_idle 112
481#define SYS_vm86 113
482#define SYS_wait4 114
483#define SYS_swapoff 115
484#define SYS_sysinfo 116
485#define SYS_ipc 117
486#define SYS_fsync 118
487#define SYS_sigreturn 119
488#define SYS_clone 120
489#define SYS_setdomainname 121
490#define SYS_uname 122
491#define SYS_modify_ldt 123
492#define SYS_adjtimex 124
493#define SYS_mprotect 125
494#define SYS_sigprocmask 126
495#define SYS_create_module 127
496#define SYS_init_module 128
497#define SYS_delete_module 129
498#define SYS_get_kernel_syms 130
499#define SYS_quotactl 131
500#define SYS_getpgid 132
501#define SYS_fchdir 133
502#define SYS_bdflush 134
503#define SYS_sysfs 135
504#define SYS_personality 136
505#define SYS_afs_syscall 137
506#define SYS_setfsuid 138
507#define SYS_setfsgid 139
508#define SYS__llseek 140
509#define SYS_getdents 141
510#define SYS__newselect 142
511#define SYS_flock 143
512#define SYS_msync 144
513#define SYS_readv 145
514#define SYS_writev 146
515#define SYS_getsid 147
516#define SYS_fdatasync 148
517#define SYS__sysctl 149
518#define SYS_mlock 150
519#define SYS_munlock 151
520#define SYS_mlockall 152
521#define SYS_munlockall 153
522#define SYS_sched_setparam 154
523#define SYS_sched_getparam 155
524#define SYS_sched_setscheduler 156
525#define SYS_sched_getscheduler 157
526#define SYS_sched_yield 158
527#define SYS_sched_get_priority_max 159
528#define SYS_sched_get_priority_min 160
529#define SYS_sched_rr_get_interval 161
530#define SYS_nanosleep 162
531#define SYS_mremap 163
532#define SYS_setresuid 164
533#define SYS_getresuid 165
534#define SYS_query_module 166
535#define SYS_poll 167
536#define SYS_nfsservctl 168
537#define SYS_setresgid 169
538#define SYS_getresgid 170
539#define SYS_prctl 171
540#define SYS_rt_sigreturn 172
541#define SYS_rt_sigaction 173
542#define SYS_rt_sigprocmask 174
543#define SYS_rt_sigpending 175
544#define SYS_rt_sigtimedwait 176
545#define SYS_rt_sigqueueinfo 177
546#define SYS_rt_sigsuspend 178
547#define SYS_pread64 179
548#define SYS_pwrite64 180
549#define SYS_chown 181
550#define SYS_getcwd 182
551#define SYS_capget 183
552#define SYS_capset 184
553#define SYS_sigaltstack 185
554#define SYS_sendfile 186
555#define SYS_getpmsg 187
556#define SYS_putpmsg 188
557#define SYS_vfork 189
558#define SYS_ugetrlimit 190
559#define SYS_readahead 191
560#define SYS_pciconfig_read 198
561#define SYS_pciconfig_write 199
562#define SYS_pciconfig_iobase 200
563#define SYS_multiplexer 201
564#define SYS_getdents64 202
565#define SYS_pivot_root 203
566#define SYS_madvise 205
567#define SYS_mincore 206
568#define SYS_gettid 207
569#define SYS_tkill 208
570#define SYS_setxattr 209
571#define SYS_lsetxattr 210
572#define SYS_fsetxattr 211
573#define SYS_getxattr 212
574#define SYS_lgetxattr 213
575#define SYS_fgetxattr 214
576#define SYS_listxattr 215
577#define SYS_llistxattr 216
578#define SYS_flistxattr 217
579#define SYS_removexattr 218
580#define SYS_lremovexattr 219
581#define SYS_fremovexattr 220
582#define SYS_futex 221
583#define SYS_sched_setaffinity 222
584#define SYS_sched_getaffinity 223
585#define SYS_tuxcall 225
586#define SYS_io_setup 227
587#define SYS_io_destroy 228
588#define SYS_io_getevents 229
589#define SYS_io_submit 230
590#define SYS_io_cancel 231
591#define SYS_set_tid_address 232
592#define SYS_fadvise64 233
593#define SYS_exit_group 234
594#define SYS_lookup_dcookie 235
595#define SYS_epoll_create 236
596#define SYS_epoll_ctl 237
597#define SYS_epoll_wait 238
598#define SYS_remap_file_pages 239
599#define SYS_timer_create 240
600#define SYS_timer_settime 241
601#define SYS_timer_gettime 242
602#define SYS_timer_getoverrun 243
603#define SYS_timer_delete 244
604#define SYS_clock_settime 245
605#define SYS_clock_gettime 246
606#define SYS_clock_getres 247
607#define SYS_clock_nanosleep 248
608#define SYS_swapcontext 249
609#define SYS_tgkill 250
610#define SYS_utimes 251
611#define SYS_statfs64 252
612#define SYS_fstatfs64 253
613#define SYS_rtas 255
614#define SYS_sys_debug_setcontext 256
615#define SYS_migrate_pages 258
616#define SYS_mbind 259
617#define SYS_get_mempolicy 260
618#define SYS_set_mempolicy 261
619#define SYS_mq_open 262
620#define SYS_mq_unlink 263
621#define SYS_mq_timedsend 264
622#define SYS_mq_timedreceive 265
623#define SYS_mq_notify 266
624#define SYS_mq_getsetattr 267
625#define SYS_kexec_load 268
626#define SYS_add_key 269
627#define SYS_request_key 270
628#define SYS_keyctl 271
629#define SYS_waitid 272
630#define SYS_ioprio_set 273
631#define SYS_ioprio_get 274
632#define SYS_inotify_init 275
633#define SYS_inotify_add_watch 276
634#define SYS_inotify_rm_watch 277
635#define SYS_spu_run 278
636#define SYS_spu_create 279
637#define SYS_pselect6 280
638#define SYS_ppoll 281
639#define SYS_unshare 282
640#define SYS_splice 283
641#define SYS_tee 284
642#define SYS_vmsplice 285
643#define SYS_openat 286
644#define SYS_mkdirat 287
645#define SYS_mknodat 288
646#define SYS_fchownat 289
647#define SYS_futimesat 290
648#define SYS_newfstatat 291
649#define SYS_unlinkat 292
650#define SYS_renameat 293
651#define SYS_linkat 294
652#define SYS_symlinkat 295
653#define SYS_readlinkat 296
654#define SYS_fchmodat 297
655#define SYS_faccessat 298
656#define SYS_get_robust_list 299
657#define SYS_set_robust_list 300
658#define SYS_move_pages 301
659#define SYS_getcpu 302
660#define SYS_epoll_pwait 303
661#define SYS_utimensat 304
662#define SYS_signalfd 305
663#define SYS_timerfd_create 306
664#define SYS_eventfd 307
665#define SYS_sync_file_range2 308
666#define SYS_fallocate 309
667#define SYS_subpage_prot 310
668#define SYS_timerfd_settime 311
669#define SYS_timerfd_gettime 312
670#define SYS_signalfd4 313
671#define SYS_eventfd2 314
672#define SYS_epoll_create1 315
673#define SYS_dup3 316
674#define SYS_pipe2 317
675#define SYS_inotify_init1 318
676#define SYS_perf_event_open 319
677#define SYS_preadv 320
678#define SYS_pwritev 321
679#define SYS_rt_tgsigqueueinfo 322
680#define SYS_fanotify_init 323
681#define SYS_fanotify_mark 324
682#define SYS_prlimit64 325
683#define SYS_socket 326
684#define SYS_bind 327
685#define SYS_connect 328
686#define SYS_listen 329
687#define SYS_accept 330
688#define SYS_getsockname 331
689#define SYS_getpeername 332
690#define SYS_socketpair 333
691#define SYS_send 334
692#define SYS_sendto 335
693#define SYS_recv 336
694#define SYS_recvfrom 337
695#define SYS_shutdown 338
696#define SYS_setsockopt 339
697#define SYS_getsockopt 340
698#define SYS_sendmsg 341
699#define SYS_recvmsg 342
700#define SYS_recvmmsg 343
701#define SYS_accept4 344
702#define SYS_name_to_handle_at 345
703#define SYS_open_by_handle_at 346
704#define SYS_clock_adjtime 347
705#define SYS_syncfs 348
706#define SYS_sendmmsg 349
707#define SYS_setns 350
708#define SYS_process_vm_readv 351
709#define SYS_process_vm_writev 352
710#define SYS_finit_module 353
711#define SYS_kcmp 354
712#define SYS_sched_setattr 355
713#define SYS_sched_getattr 356
714#define SYS_renameat2 357
715#define SYS_seccomp 358
716#define SYS_getrandom 359
717#define SYS_memfd_create 360
718#define SYS_bpf 361
719#define SYS_execveat 362
720#define SYS_switch_endian 363
721#define SYS_userfaultfd 364
722#define SYS_membarrier 365
723#define SYS_mlock2 378
724#define SYS_copy_file_range 379
725#define SYS_preadv2 380
726#define SYS_pwritev2 381
727#define SYS_kexec_file_load 382
728#define SYS_statx 383
729#define SYS_pkey_alloc 384
730#define SYS_pkey_free 385
731#define SYS_pkey_mprotect 386
732#define SYS_rseq 387
733#define SYS_io_pgetevents 388
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/termios.h+1-1
...@@ -167,5 +167,5 @@ struct termios {...@@ -167,5 +167,5 @@ struct termios {
167#define EXTPROC 0x10000000167#define EXTPROC 0x10000000
168168
169#define XTABS 00006000169#define XTABS 00006000
170#define TIOCSER_TEMT 0x01170#define TIOCSER_TEMT 1
171#endif171#endif
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for powerpc64le-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if __BIG_ENDIAN__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define EDEADLK 35
36#define ENAMETOOLONG 36
37#define ENOLCK 37
38#define ENOSYS 38
39#define ENOTEMPTY 39
40#define ELOOP 40
41#define EWOULDBLOCK EAGAIN
42#define ENOMSG 42
43#define EIDRM 43
44#define ECHRNG 44
45#define EL2NSYNC 45
46#define EL3HLT 46
47#define EL3RST 47
48#define ELNRNG 48
49#define EUNATCH 49
50#define ENOCSI 50
51#define EL2HLT 51
52#define EBADE 52
53#define EBADR 53
54#define EXFULL 54
55#define ENOANO 55
56#define EBADRQC 56
57#define EBADSLT 57
58#define EDEADLOCK 58
59#define EBFONT 59
60#define ENOSTR 60
61#define ENODATA 61
62#define ETIME 62
63#define ENOSR 63
64#define ENONET 64
65#define ENOPKG 65
66#define EREMOTE 66
67#define ENOLINK 67
68#define EADV 68
69#define ESRMNT 69
70#define ECOMM 70
71#define EPROTO 71
72#define EMULTIHOP 72
73#define EDOTDOT 73
74#define EBADMSG 74
75#define EOVERFLOW 75
76#define ENOTUNIQ 76
77#define EBADFD 77
78#define EREMCHG 78
79#define ELIBACC 79
80#define ELIBBAD 80
81#define ELIBSCN 81
82#define ELIBMAX 82
83#define ELIBEXEC 83
84#define EILSEQ 84
85#define ERESTART 85
86#define ESTRPIPE 86
87#define EUSERS 87
88#define ENOTSOCK 88
89#define EDESTADDRREQ 89
90#define EMSGSIZE 90
91#define EPROTOTYPE 91
92#define ENOPROTOOPT 92
93#define EPROTONOSUPPORT 93
94#define ESOCKTNOSUPPORT 94
95#define EOPNOTSUPP 95
96#define ENOTSUP EOPNOTSUPP
97#define EPFNOSUPPORT 96
98#define EAFNOSUPPORT 97
99#define EADDRINUSE 98
100#define EADDRNOTAVAIL 99
101#define ENETDOWN 100
102#define ENETUNREACH 101
103#define ENETRESET 102
104#define ECONNABORTED 103
105#define ECONNRESET 104
106#define ENOBUFS 105
107#define EISCONN 106
108#define ENOTCONN 107
109#define ESHUTDOWN 108
110#define ETOOMANYREFS 109
111#define ETIMEDOUT 110
112#define ECONNREFUSED 111
113#define EHOSTDOWN 112
114#define EHOSTUNREACH 113
115#define EALREADY 114
116#define EINPROGRESS 115
117#define ESTALE 116
118#define EUCLEAN 117
119#define ENOTNAM 118
120#define ENAVAIL 119
121#define EISNAM 120
122#define EREMOTEIO 121
123#define EDQUOT 122
124#define ENOMEDIUM 123
125#define EMEDIUMTYPE 124
126#define ECANCELED 125
127#define ENOKEY 126
128#define EKEYEXPIRED 127
129#define EKEYREVOKED 128
130#define EKEYREJECTED 129
131#define EOWNERDEAD 130
132#define ENOTRECOVERABLE 131
133#define ERFKILL 132
134#define EHWPOISON 133
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0400000
16#define O_LARGEFILE 0200000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_GETLK 5
29#define F_SETLK 6
30#define F_SETLKW 7
31
32#define F_SETOWN 8
33#define F_GETOWN 9
34#define F_SETSIG 10
35#define F_GETSIG 11
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/fenv.h deleted-31
...@@ -1,31 +0,0 @@
1#define FE_TONEAREST 0
2#define FE_TOWARDZERO 1
3#define FE_UPWARD 2
4#define FE_DOWNWARD 3
5
6#define FE_INEXACT 0x02000000
7#define FE_DIVBYZERO 0x04000000
8#define FE_UNDERFLOW 0x08000000
9#define FE_OVERFLOW 0x10000000
10#define FE_INVALID 0x20000000
11
12#define FE_ALL_EXCEPT 0x3e000000
13
14#ifdef _GNU_SOURCE
15#define FE_INVALID_SNAN 0x01000000
16#define FE_INVALID_ISI 0x00800000
17#define FE_INVALID_IDI 0x00400000
18#define FE_INVALID_ZDZ 0x00200000
19#define FE_INVALID_IMZ 0x00100000
20#define FE_INVALID_COMPARE 0x00080000
21#define FE_INVALID_SOFTWARE 0x00000400
22#define FE_INVALID_SQRT 0x00000200
23#define FE_INVALID_INTEGER_CONVERSION 0x00000100
24
25#define FE_ALL_INVALID 0x01f80700
26#endif
27
28typedef unsigned fexcept_t;
29typedef double fenv_t;
30
31#define FE_DFL_ENV ((const fenv_t *)-1)
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/hwcap.h deleted-43
...@@ -1,43 +0,0 @@
1#define PPC_FEATURE_32 0x80000000
2#define PPC_FEATURE_64 0x40000000
3#define PPC_FEATURE_601_INSTR 0x20000000
4#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
5#define PPC_FEATURE_HAS_FPU 0x08000000
6#define PPC_FEATURE_HAS_MMU 0x04000000
7#define PPC_FEATURE_HAS_4xxMAC 0x02000000
8#define PPC_FEATURE_UNIFIED_CACHE 0x01000000
9#define PPC_FEATURE_HAS_SPE 0x00800000
10#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
11#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
12#define PPC_FEATURE_NO_TB 0x00100000
13#define PPC_FEATURE_POWER4 0x00080000
14#define PPC_FEATURE_POWER5 0x00040000
15#define PPC_FEATURE_POWER5_PLUS 0x00020000
16#define PPC_FEATURE_CELL 0x00010000
17#define PPC_FEATURE_BOOKE 0x00008000
18#define PPC_FEATURE_SMT 0x00004000
19#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
20#define PPC_FEATURE_ARCH_2_05 0x00001000
21#define PPC_FEATURE_PA6T 0x00000800
22#define PPC_FEATURE_HAS_DFP 0x00000400
23#define PPC_FEATURE_POWER6_EXT 0x00000200
24#define PPC_FEATURE_ARCH_2_06 0x00000100
25#define PPC_FEATURE_HAS_VSX 0x00000080
26#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040
27
28#define PPC_FEATURE_TRUE_LE 0x00000002
29#define PPC_FEATURE_PPC_LE 0x00000001
30
31#define PPC_FEATURE2_ARCH_2_07 0x80000000
32#define PPC_FEATURE2_HTM 0x40000000
33#define PPC_FEATURE2_DSCR 0x20000000
34#define PPC_FEATURE2_EBB 0x10000000
35#define PPC_FEATURE2_ISEL 0x08000000
36#define PPC_FEATURE2_TAR 0x04000000
37#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
38#define PPC_FEATURE2_HTM_NOSC 0x01000000
39#define PPC_FEATURE2_ARCH_3_00 0x00800000
40#define PPC_FEATURE2_HAS_IEEE128 0x00400000
41#define PPC_FEATURE2_DARN 0x00200000
42#define PPC_FEATURE2_SCV 0x00100000
43#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/ioctl.h deleted-217
...@@ -1,217 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_WRITE 4U
4#define _IOC_READ 2U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define FIONCLEX _IO('f', 2)
12#define FIOCLEX _IO('f', 1)
13#define FIOASYNC _IOW('f', 125, int)
14#define FIONBIO _IOW('f', 126, int)
15#define FIONREAD _IOR('f', 127, int)
16#define TIOCINQ FIONREAD
17#define FIOQSIZE _IOR('f', 128, char[8])
18#define TIOCGETP _IOR('t', 8, char[6])
19#define TIOCSETP _IOW('t', 9, char[6])
20#define TIOCSETN _IOW('t', 10, char[6])
21
22#define TIOCSETC _IOW('t', 17, char[6])
23#define TIOCGETC _IOR('t', 18, char[6])
24#define TCGETS _IOR('t', 19, char[44])
25#define TCSETS _IOW('t', 20, char[44])
26#define TCSETSW _IOW('t', 21, char[44])
27#define TCSETSF _IOW('t', 22, char[44])
28
29#define TCGETA _IOR('t', 23, char[20])
30#define TCSETA _IOW('t', 24, char[20])
31#define TCSETAW _IOW('t', 25, char[20])
32#define TCSETAF _IOW('t', 28, char[20])
33
34#define TCSBRK _IO('t', 29)
35#define TCXONC _IO('t', 30)
36#define TCFLSH _IO('t', 31)
37
38#define TIOCSWINSZ _IOW('t', 103, char[8])
39#define TIOCGWINSZ _IOR('t', 104, char[8])
40#define TIOCSTART _IO('t', 110)
41#define TIOCSTOP _IO('t', 111)
42
43#define TIOCOUTQ _IOR('t', 115, int)
44
45#define TIOCGLTC _IOR('t', 116, char[6])
46#define TIOCSLTC _IOW('t', 117, char[6])
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49
50#define TIOCEXCL 0x540C
51#define TIOCNXCL 0x540D
52#define TIOCSCTTY 0x540E
53
54#define TIOCSTI 0x5412
55#define TIOCMGET 0x5415
56#define TIOCMBIS 0x5416
57#define TIOCMBIC 0x5417
58#define TIOCMSET 0x5418
59#define TIOCM_LE 0x001
60#define TIOCM_DTR 0x002
61#define TIOCM_RTS 0x004
62#define TIOCM_ST 0x008
63#define TIOCM_SR 0x010
64#define TIOCM_CTS 0x020
65#define TIOCM_CAR 0x040
66#define TIOCM_RNG 0x080
67#define TIOCM_DSR 0x100
68#define TIOCM_CD TIOCM_CAR
69#define TIOCM_RI TIOCM_RNG
70#define TIOCM_OUT1 0x2000
71#define TIOCM_OUT2 0x4000
72#define TIOCM_LOOP 0x8000
73
74#define TIOCGSOFTCAR 0x5419
75#define TIOCSSOFTCAR 0x541A
76#define TIOCLINUX 0x541C
77#define TIOCCONS 0x541D
78#define TIOCGSERIAL 0x541E
79#define TIOCSSERIAL 0x541F
80#define TIOCPKT 0x5420
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88#define TIOCPKT_IOCTL 64
89
90#define TIOCNOTTY 0x5422
91#define TIOCSETD 0x5423
92#define TIOCGETD 0x5424
93#define TCSBRKP 0x5425
94#define TIOCSBRK 0x5427
95#define TIOCCBRK 0x5428
96#define TIOCGSID 0x5429
97#define TIOCGRS485 0x542e
98#define TIOCSRS485 0x542f
99#define TIOCGPTN _IOR('T',0x30, unsigned int)
100#define TIOCSPTLCK _IOW('T',0x31, int)
101#define TIOCGDEV _IOR('T',0x32, unsigned int)
102#define TIOCSIG _IOW('T',0x36, int)
103#define TIOCVHANGUP 0x5437
104#define TIOCGPKT _IOR('T', 0x38, int)
105#define TIOCGPTLCK _IOR('T', 0x39, int)
106#define TIOCGEXCL _IOR('T', 0x40, int)
107#define TIOCGPTPEER _IO('T', 0x41)
108
109#define TIOCSERCONFIG 0x5453
110#define TIOCSERGWILD 0x5454
111#define TIOCSERSWILD 0x5455
112#define TIOCGLCKTRMIOS 0x5456
113#define TIOCSLCKTRMIOS 0x5457
114#define TIOCSERGSTRUCT 0x5458
115#define TIOCSERGETLSR 0x5459
116#define TIOCSER_TEMT 0x01
117#define TIOCSERGETMULTI 0x545A
118#define TIOCSERSETMULTI 0x545B
119
120#define TIOCMIWAIT 0x545C
121#define TIOCGICOUNT 0x545D
122
123
124struct winsize {
125 unsigned short ws_row;
126 unsigned short ws_col;
127 unsigned short ws_xpixel;
128 unsigned short ws_ypixel;
129};
130
131#define N_TTY 0
132#define N_SLIP 1
133#define N_MOUSE 2
134#define N_PPP 3
135#define N_STRIP 4
136#define N_AX25 5
137#define N_X25 6
138#define N_6PACK 7
139#define N_MASC 8
140#define N_R3964 9
141#define N_PROFIBUS_FDL 10
142#define N_IRDA 11
143#define N_SMSBLOCK 12
144#define N_HDLC 13
145#define N_SYNC_PPP 14
146#define N_HCI 15
147
148#define FIOSETOWN 0x8901
149#define SIOCSPGRP 0x8902
150#define FIOGETOWN 0x8903
151#define SIOCGPGRP 0x8904
152#define SIOCATMARK 0x8905
153#define SIOCGSTAMP 0x8906
154#define SIOCGSTAMPNS 0x8907
155
156#define SIOCADDRT 0x890B
157#define SIOCDELRT 0x890C
158#define SIOCRTMSG 0x890D
159
160#define SIOCGIFNAME 0x8910
161#define SIOCSIFLINK 0x8911
162#define SIOCGIFCONF 0x8912
163#define SIOCGIFFLAGS 0x8913
164#define SIOCSIFFLAGS 0x8914
165#define SIOCGIFADDR 0x8915
166#define SIOCSIFADDR 0x8916
167#define SIOCGIFDSTADDR 0x8917
168#define SIOCSIFDSTADDR 0x8918
169#define SIOCGIFBRDADDR 0x8919
170#define SIOCSIFBRDADDR 0x891a
171#define SIOCGIFNETMASK 0x891b
172#define SIOCSIFNETMASK 0x891c
173#define SIOCGIFMETRIC 0x891d
174#define SIOCSIFMETRIC 0x891e
175#define SIOCGIFMEM 0x891f
176#define SIOCSIFMEM 0x8920
177#define SIOCGIFMTU 0x8921
178#define SIOCSIFMTU 0x8922
179#define SIOCSIFNAME 0x8923
180#define SIOCSIFHWADDR 0x8924
181#define SIOCGIFENCAP 0x8925
182#define SIOCSIFENCAP 0x8926
183#define SIOCGIFHWADDR 0x8927
184#define SIOCGIFSLAVE 0x8929
185#define SIOCSIFSLAVE 0x8930
186#define SIOCADDMULTI 0x8931
187#define SIOCDELMULTI 0x8932
188#define SIOCGIFINDEX 0x8933
189#define SIOGIFINDEX SIOCGIFINDEX
190#define SIOCSIFPFLAGS 0x8934
191#define SIOCGIFPFLAGS 0x8935
192#define SIOCDIFADDR 0x8936
193#define SIOCSIFHWBROADCAST 0x8937
194#define SIOCGIFCOUNT 0x8938
195
196#define SIOCGIFBR 0x8940
197#define SIOCSIFBR 0x8941
198
199#define SIOCGIFTXQLEN 0x8942
200#define SIOCSIFTXQLEN 0x8943
201
202#define SIOCDARP 0x8953
203#define SIOCGARP 0x8954
204#define SIOCSARP 0x8955
205
206#define SIOCDRARP 0x8960
207#define SIOCGRARP 0x8961
208#define SIOCSRARP 0x8962
209
210#define SIOCGIFMAP 0x8970
211#define SIOCSIFMAP 0x8971
212
213#define SIOCADDDLCI 0x8980
214#define SIOCDELDLCI 0x8981
215
216#define SIOCDEVPRIVATE 0x89F0
217#define SIOCPROTOPRIVATE 0x89E0
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/ipc.h deleted-14
...@@ -1,14 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 int __ipc_perm_seq;
9 int __pad1;
10 long long __pad2;
11 long long __pad3;
12};
13
14#define IPC_64 0x100
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/limits.h deleted-7
...@@ -1,7 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3#define LONG_BIT 64
4#endif
5
6#define LONG_MAX 0x7fffffffffffffffL
7#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/mman.h deleted-14
...@@ -1,14 +0,0 @@
1#define PROT_SAO 0x10
2
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x40
5#undef MAP_LOCKED
6#define MAP_LOCKED 0x80
7#undef MAP_SYNC
8
9#undef MCL_CURRENT
10#define MCL_CURRENT 0x2000
11#undef MCL_FUTURE
12#define MCL_FUTURE 0x4000
13#undef MCL_ONFAULT
14#define MCL_ONFAULT 0x8000
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/msg.h deleted-12
...@@ -1,12 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 time_t msg_rtime;
5 time_t msg_ctime;
6 unsigned long msg_cbytes;
7 msgqnum_t msg_qnum;
8 msglen_t msg_qbytes;
9 pid_t msg_lspid;
10 pid_t msg_lrpid;
11 unsigned long __unused[2];
12};
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/ptrace.h deleted-23
...@@ -1,23 +0,0 @@
1#define PTRACE_GETVRREGS 0x12
2#define PTRACE_SETVRREGS 0x13
3#define PTRACE_GETEVRREGS 0x14
4#define PTRACE_SETEVRREGS 0x15
5#define PTRACE_GETREGS64 0x16
6#define PTRACE_SETREGS64 0x17
7#define PTRACE_GET_DEBUGREG 0x19
8#define PTRACE_SET_DEBUGREG 0x1a
9#define PTRACE_GETVSRREGS 0x1b
10#define PTRACE_SETVSRREGS 0x1c
11#define PTRACE_SINGLEBLOCK 0x100
12
13#define PT_GETVRREGS PTRACE_GETVRREGS
14#define PT_SETVRREGS PTRACE_SETVRREGS
15#define PT_GETEVRREGS PTRACE_GETEVRREGS
16#define PT_SETEVRREGS PTRACE_SETEVRREGS
17#define PT_GETREGS64 PTRACE_GETREGS64
18#define PT_SETREGS64 PTRACE_SETREGS64
19#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
20#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
21#define PT_GETVSRREGS PTRACE_GETVSRREGS
22#define PT_SETVSRREGS PTRACE_SETVSRREGS
23#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/reg.h deleted-3
...@@ -1,3 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3/* FIXME */
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/sem.h deleted-13
...@@ -1,13 +0,0 @@
1#include <endian.h>
2
3struct semid_ds {
4 struct ipc_perm sem_perm;
5 time_t sem_otime;
6 time_t sem_ctime;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 unsigned short __pad[3], sem_nsems;
9#else
10 unsigned short sem_nsems, __pad[3];
11#endif
12 unsigned long __unused[2];
13};
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned __int128 __jmp_buf[32];
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/shm.h deleted-23
...@@ -1,23 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 time_t shm_atime;
6 time_t shm_dtime;
7 time_t shm_ctime;
8 size_t shm_segsz;
9 pid_t shm_cpid;
10 pid_t shm_lpid;
11 unsigned long shm_nattch;
12 unsigned long __unused[2];
13};
14
15struct shminfo {
16 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
17};
18
19struct shm_info {
20 int __used_ids;
21 unsigned long shm_tot, shm_rss, shm_swp;
22 unsigned long __swap_attempts, __swap_successes;
23};
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/signal.h deleted-107
...@@ -1,107 +0,0 @@
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 4096
6#define SIGSTKSZ 10240
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10
11typedef unsigned long greg_t, gregset_t[48];
12
13typedef struct {
14 double fpregs[32];
15 double fpscr;
16} fpregset_t;
17
18typedef struct {
19 unsigned __int128 vrregs[32];
20 unsigned _pad[3];
21 unsigned vrsave;
22 unsigned vscr;
23 unsigned _pad2[3];
24} vrregset_t;
25
26typedef struct sigcontext {
27 unsigned long _unused[4];
28 int signal;
29 int _pad0;
30 unsigned long handler;
31 unsigned long oldmask;
32 void *regs;
33 gregset_t gp_regs;
34 fpregset_t fp_regs;
35 vrregset_t *v_regs;
36 long vmx_reserve[34+34+32+1];
37} mcontext_t;
38
39#else
40
41typedef struct {
42 long __regs[4+4+48+33+1+34+34+32+1];
43} mcontext_t;
44
45#endif
46
47struct sigaltstack {
48 void *ss_sp;
49 int ss_flags;
50 size_t ss_size;
51};
52
53typedef struct __ucontext {
54 unsigned long uc_flags;
55 struct __ucontext *uc_link;
56 stack_t uc_stack;
57 sigset_t uc_sigmask;
58 mcontext_t uc_mcontext;
59} ucontext_t;
60
61#define SA_NOCLDSTOP 1U
62#define SA_NOCLDWAIT 2U
63#define SA_SIGINFO 4U
64#define SA_ONSTACK 0x08000000U
65#define SA_RESTART 0x10000000U
66#define SA_NODEFER 0x40000000U
67#define SA_RESETHAND 0x80000000U
68#define SA_RESTORER 0x04000000U
69
70#endif
71
72#define SIGHUP 1
73#define SIGINT 2
74#define SIGQUIT 3
75#define SIGILL 4
76#define SIGTRAP 5
77#define SIGABRT 6
78#define SIGIOT SIGABRT
79#define SIGBUS 7
80#define SIGFPE 8
81#define SIGKILL 9
82#define SIGUSR1 10
83#define SIGSEGV 11
84#define SIGUSR2 12
85#define SIGPIPE 13
86#define SIGALRM 14
87#define SIGTERM 15
88#define SIGSTKFLT 16
89#define SIGCHLD 17
90#define SIGCONT 18
91#define SIGSTOP 19
92#define SIGTSTP 20
93#define SIGTTIN 21
94#define SIGTTOU 22
95#define SIGURG 23
96#define SIGXCPU 24
97#define SIGXFSZ 25
98#define SIGVTALRM 26
99#define SIGPROF 27
100#define SIGWINCH 28
101#define SIGIO 29
102#define SIGPOLL SIGIO
103#define SIGPWR 30
104#define SIGSYS 31
105#define SIGUNUSED SIGSYS
106
107#define _NSIG 65
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/socket.h deleted-61
...@@ -1,61 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
34
35#define SO_DEBUG 1
36#define SO_REUSEADDR 2
37#define SO_TYPE 3
38#define SO_ERROR 4
39#define SO_DONTROUTE 5
40#define SO_BROADCAST 6
41#define SO_SNDBUF 7
42#define SO_RCVBUF 8
43#define SO_KEEPALIVE 9
44#define SO_OOBINLINE 10
45#define SO_NO_CHECK 11
46#define SO_PRIORITY 12
47#define SO_LINGER 13
48#define SO_BSDCOMPAT 14
49#define SO_REUSEPORT 15
50#define SO_RCVLOWAT 16
51#define SO_SNDLOWAT 17
52#define SO_RCVTIMEO 18
53#define SO_SNDTIMEO 19
54#define SO_PASSCRED 20
55#define SO_PEERCRED 21
56#define SO_ACCEPTCONN 30
57#define SO_PEERSEC 31
58#define SO_SNDBUFFORCE 32
59#define SO_RCVBUFFORCE 33
60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/stat.h deleted-16
...@@ -1,16 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5 mode_t st_mode;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 off_t st_size;
10 blksize_t st_blksize;
11 blkcnt_t st_blocks;
12 struct timespec st_atim;
13 struct timespec st_mtim;
14 struct timespec st_ctim;
15 unsigned long __unused[3];
16};
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/syscall.h deleted-733
...@@ -1,733 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76
78#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_query_module 166
168#define __NR_poll 167
169#define __NR_nfsservctl 168
170#define __NR_setresgid 169
171#define __NR_getresgid 170
172#define __NR_prctl 171
173#define __NR_rt_sigreturn 172
174#define __NR_rt_sigaction 173
175#define __NR_rt_sigprocmask 174
176#define __NR_rt_sigpending 175
177#define __NR_rt_sigtimedwait 176
178#define __NR_rt_sigqueueinfo 177
179#define __NR_rt_sigsuspend 178
180#define __NR_pread64 179
181#define __NR_pwrite64 180
182#define __NR_chown 181
183#define __NR_getcwd 182
184#define __NR_capget 183
185#define __NR_capset 184
186#define __NR_sigaltstack 185
187#define __NR_sendfile 186
188#define __NR_getpmsg 187
189#define __NR_putpmsg 188
190#define __NR_vfork 189
191#define __NR_ugetrlimit 190
192#define __NR_readahead 191
193#define __NR_pciconfig_read 198
194#define __NR_pciconfig_write 199
195#define __NR_pciconfig_iobase 200
196#define __NR_multiplexer 201
197#define __NR_getdents64 202
198#define __NR_pivot_root 203
199#define __NR_madvise 205
200#define __NR_mincore 206
201#define __NR_gettid 207
202#define __NR_tkill 208
203#define __NR_setxattr 209
204#define __NR_lsetxattr 210
205#define __NR_fsetxattr 211
206#define __NR_getxattr 212
207#define __NR_lgetxattr 213
208#define __NR_fgetxattr 214
209#define __NR_listxattr 215
210#define __NR_llistxattr 216
211#define __NR_flistxattr 217
212#define __NR_removexattr 218
213#define __NR_lremovexattr 219
214#define __NR_fremovexattr 220
215#define __NR_futex 221
216#define __NR_sched_setaffinity 222
217#define __NR_sched_getaffinity 223
218#define __NR_tuxcall 225
219#define __NR_io_setup 227
220#define __NR_io_destroy 228
221#define __NR_io_getevents 229
222#define __NR_io_submit 230
223#define __NR_io_cancel 231
224#define __NR_set_tid_address 232
225#define __NR_fadvise64 233
226#define __NR_exit_group 234
227#define __NR_lookup_dcookie 235
228#define __NR_epoll_create 236
229#define __NR_epoll_ctl 237
230#define __NR_epoll_wait 238
231#define __NR_remap_file_pages 239
232#define __NR_timer_create 240
233#define __NR_timer_settime 241
234#define __NR_timer_gettime 242
235#define __NR_timer_getoverrun 243
236#define __NR_timer_delete 244
237#define __NR_clock_settime 245
238#define __NR_clock_gettime 246
239#define __NR_clock_getres 247
240#define __NR_clock_nanosleep 248
241#define __NR_swapcontext 249
242#define __NR_tgkill 250
243#define __NR_utimes 251
244#define __NR_statfs64 252
245#define __NR_fstatfs64 253
246#define __NR_rtas 255
247#define __NR_sys_debug_setcontext 256
248#define __NR_migrate_pages 258
249#define __NR_mbind 259
250#define __NR_get_mempolicy 260
251#define __NR_set_mempolicy 261
252#define __NR_mq_open 262
253#define __NR_mq_unlink 263
254#define __NR_mq_timedsend 264
255#define __NR_mq_timedreceive 265
256#define __NR_mq_notify 266
257#define __NR_mq_getsetattr 267
258#define __NR_kexec_load 268
259#define __NR_add_key 269
260#define __NR_request_key 270
261#define __NR_keyctl 271
262#define __NR_waitid 272
263#define __NR_ioprio_set 273
264#define __NR_ioprio_get 274
265#define __NR_inotify_init 275
266#define __NR_inotify_add_watch 276
267#define __NR_inotify_rm_watch 277
268#define __NR_spu_run 278
269#define __NR_spu_create 279
270#define __NR_pselect6 280
271#define __NR_ppoll 281
272#define __NR_unshare 282
273#define __NR_splice 283
274#define __NR_tee 284
275#define __NR_vmsplice 285
276#define __NR_openat 286
277#define __NR_mkdirat 287
278#define __NR_mknodat 288
279#define __NR_fchownat 289
280#define __NR_futimesat 290
281#define __NR_newfstatat 291
282#define __NR_unlinkat 292
283#define __NR_renameat 293
284#define __NR_linkat 294
285#define __NR_symlinkat 295
286#define __NR_readlinkat 296
287#define __NR_fchmodat 297
288#define __NR_faccessat 298
289#define __NR_get_robust_list 299
290#define __NR_set_robust_list 300
291#define __NR_move_pages 301
292#define __NR_getcpu 302
293#define __NR_epoll_pwait 303
294#define __NR_utimensat 304
295#define __NR_signalfd 305
296#define __NR_timerfd_create 306
297#define __NR_eventfd 307
298#define __NR_sync_file_range2 308
299#define __NR_fallocate 309
300#define __NR_subpage_prot 310
301#define __NR_timerfd_settime 311
302#define __NR_timerfd_gettime 312
303#define __NR_signalfd4 313
304#define __NR_eventfd2 314
305#define __NR_epoll_create1 315
306#define __NR_dup3 316
307#define __NR_pipe2 317
308#define __NR_inotify_init1 318
309#define __NR_perf_event_open 319
310#define __NR_preadv 320
311#define __NR_pwritev 321
312#define __NR_rt_tgsigqueueinfo 322
313#define __NR_fanotify_init 323
314#define __NR_fanotify_mark 324
315#define __NR_prlimit64 325
316#define __NR_socket 326
317#define __NR_bind 327
318#define __NR_connect 328
319#define __NR_listen 329
320#define __NR_accept 330
321#define __NR_getsockname 331
322#define __NR_getpeername 332
323#define __NR_socketpair 333
324#define __NR_send 334
325#define __NR_sendto 335
326#define __NR_recv 336
327#define __NR_recvfrom 337
328#define __NR_shutdown 338
329#define __NR_setsockopt 339
330#define __NR_getsockopt 340
331#define __NR_sendmsg 341
332#define __NR_recvmsg 342
333#define __NR_recvmmsg 343
334#define __NR_accept4 344
335#define __NR_name_to_handle_at 345
336#define __NR_open_by_handle_at 346
337#define __NR_clock_adjtime 347
338#define __NR_syncfs 348
339#define __NR_sendmmsg 349
340#define __NR_setns 350
341#define __NR_process_vm_readv 351
342#define __NR_process_vm_writev 352
343#define __NR_finit_module 353
344#define __NR_kcmp 354
345#define __NR_sched_setattr 355
346#define __NR_sched_getattr 356
347#define __NR_renameat2 357
348#define __NR_seccomp 358
349#define __NR_getrandom 359
350#define __NR_memfd_create 360
351#define __NR_bpf 361
352#define __NR_execveat 362
353#define __NR_switch_endian 363
354#define __NR_userfaultfd 364
355#define __NR_membarrier 365
356#define __NR_mlock2 378
357#define __NR_copy_file_range 379
358#define __NR_preadv2 380
359#define __NR_pwritev2 381
360#define __NR_kexec_file_load 382
361#define __NR_statx 383
362#define __NR_pkey_alloc 384
363#define __NR_pkey_free 385
364#define __NR_pkey_mprotect 386
365#define __NR_rseq 387
366#define __NR_io_pgetevents 388
367
368#define SYS_restart_syscall 0
369#define SYS_exit 1
370#define SYS_fork 2
371#define SYS_read 3
372#define SYS_write 4
373#define SYS_open 5
374#define SYS_close 6
375#define SYS_waitpid 7
376#define SYS_creat 8
377#define SYS_link 9
378#define SYS_unlink 10
379#define SYS_execve 11
380#define SYS_chdir 12
381#define SYS_time 13
382#define SYS_mknod 14
383#define SYS_chmod 15
384#define SYS_lchown 16
385#define SYS_break 17
386#define SYS_oldstat 18
387#define SYS_lseek 19
388#define SYS_getpid 20
389#define SYS_mount 21
390#define SYS_umount 22
391#define SYS_setuid 23
392#define SYS_getuid 24
393#define SYS_stime 25
394#define SYS_ptrace 26
395#define SYS_alarm 27
396#define SYS_oldfstat 28
397#define SYS_pause 29
398#define SYS_utime 30
399#define SYS_stty 31
400#define SYS_gtty 32
401#define SYS_access 33
402#define SYS_nice 34
403#define SYS_ftime 35
404#define SYS_sync 36
405#define SYS_kill 37
406#define SYS_rename 38
407#define SYS_mkdir 39
408#define SYS_rmdir 40
409#define SYS_dup 41
410#define SYS_pipe 42
411#define SYS_times 43
412#define SYS_prof 44
413#define SYS_brk 45
414#define SYS_setgid 46
415#define SYS_getgid 47
416#define SYS_signal 48
417#define SYS_geteuid 49
418#define SYS_getegid 50
419#define SYS_acct 51
420#define SYS_umount2 52
421#define SYS_lock 53
422#define SYS_ioctl 54
423#define SYS_fcntl 55
424#define SYS_mpx 56
425#define SYS_setpgid 57
426#define SYS_ulimit 58
427#define SYS_oldolduname 59
428#define SYS_umask 60
429#define SYS_chroot 61
430#define SYS_ustat 62
431#define SYS_dup2 63
432#define SYS_getppid 64
433#define SYS_getpgrp 65
434#define SYS_setsid 66
435#define SYS_sigaction 67
436#define SYS_sgetmask 68
437#define SYS_ssetmask 69
438#define SYS_setreuid 70
439#define SYS_setregid 71
440#define SYS_sigsuspend 72
441#define SYS_sigpending 73
442#define SYS_sethostname 74
443#define SYS_setrlimit 75
444#define SYS_getrlimit 76
445#define SYS_getrusage 77
446#define SYS_gettimeofday 78
447#define SYS_settimeofday 79
448#define SYS_getgroups 80
449#define SYS_setgroups 81
450#define SYS_select 82
451#define SYS_symlink 83
452#define SYS_oldlstat 84
453#define SYS_readlink 85
454#define SYS_uselib 86
455#define SYS_swapon 87
456#define SYS_reboot 88
457#define SYS_readdir 89
458#define SYS_mmap 90
459#define SYS_munmap 91
460#define SYS_truncate 92
461#define SYS_ftruncate 93
462#define SYS_fchmod 94
463#define SYS_fchown 95
464#define SYS_getpriority 96
465#define SYS_setpriority 97
466#define SYS_profil 98
467#define SYS_statfs 99
468#define SYS_fstatfs 100
469#define SYS_ioperm 101
470#define SYS_socketcall 102
471#define SYS_syslog 103
472#define SYS_setitimer 104
473#define SYS_getitimer 105
474#define SYS_stat 106
475#define SYS_lstat 107
476#define SYS_fstat 108
477#define SYS_olduname 109
478#define SYS_iopl 110
479#define SYS_vhangup 111
480#define SYS_idle 112
481#define SYS_vm86 113
482#define SYS_wait4 114
483#define SYS_swapoff 115
484#define SYS_sysinfo 116
485#define SYS_ipc 117
486#define SYS_fsync 118
487#define SYS_sigreturn 119
488#define SYS_clone 120
489#define SYS_setdomainname 121
490#define SYS_uname 122
491#define SYS_modify_ldt 123
492#define SYS_adjtimex 124
493#define SYS_mprotect 125
494#define SYS_sigprocmask 126
495#define SYS_create_module 127
496#define SYS_init_module 128
497#define SYS_delete_module 129
498#define SYS_get_kernel_syms 130
499#define SYS_quotactl 131
500#define SYS_getpgid 132
501#define SYS_fchdir 133
502#define SYS_bdflush 134
503#define SYS_sysfs 135
504#define SYS_personality 136
505#define SYS_afs_syscall 137
506#define SYS_setfsuid 138
507#define SYS_setfsgid 139
508#define SYS__llseek 140
509#define SYS_getdents 141
510#define SYS__newselect 142
511#define SYS_flock 143
512#define SYS_msync 144
513#define SYS_readv 145
514#define SYS_writev 146
515#define SYS_getsid 147
516#define SYS_fdatasync 148
517#define SYS__sysctl 149
518#define SYS_mlock 150
519#define SYS_munlock 151
520#define SYS_mlockall 152
521#define SYS_munlockall 153
522#define SYS_sched_setparam 154
523#define SYS_sched_getparam 155
524#define SYS_sched_setscheduler 156
525#define SYS_sched_getscheduler 157
526#define SYS_sched_yield 158
527#define SYS_sched_get_priority_max 159
528#define SYS_sched_get_priority_min 160
529#define SYS_sched_rr_get_interval 161
530#define SYS_nanosleep 162
531#define SYS_mremap 163
532#define SYS_setresuid 164
533#define SYS_getresuid 165
534#define SYS_query_module 166
535#define SYS_poll 167
536#define SYS_nfsservctl 168
537#define SYS_setresgid 169
538#define SYS_getresgid 170
539#define SYS_prctl 171
540#define SYS_rt_sigreturn 172
541#define SYS_rt_sigaction 173
542#define SYS_rt_sigprocmask 174
543#define SYS_rt_sigpending 175
544#define SYS_rt_sigtimedwait 176
545#define SYS_rt_sigqueueinfo 177
546#define SYS_rt_sigsuspend 178
547#define SYS_pread64 179
548#define SYS_pwrite64 180
549#define SYS_chown 181
550#define SYS_getcwd 182
551#define SYS_capget 183
552#define SYS_capset 184
553#define SYS_sigaltstack 185
554#define SYS_sendfile 186
555#define SYS_getpmsg 187
556#define SYS_putpmsg 188
557#define SYS_vfork 189
558#define SYS_ugetrlimit 190
559#define SYS_readahead 191
560#define SYS_pciconfig_read 198
561#define SYS_pciconfig_write 199
562#define SYS_pciconfig_iobase 200
563#define SYS_multiplexer 201
564#define SYS_getdents64 202
565#define SYS_pivot_root 203
566#define SYS_madvise 205
567#define SYS_mincore 206
568#define SYS_gettid 207
569#define SYS_tkill 208
570#define SYS_setxattr 209
571#define SYS_lsetxattr 210
572#define SYS_fsetxattr 211
573#define SYS_getxattr 212
574#define SYS_lgetxattr 213
575#define SYS_fgetxattr 214
576#define SYS_listxattr 215
577#define SYS_llistxattr 216
578#define SYS_flistxattr 217
579#define SYS_removexattr 218
580#define SYS_lremovexattr 219
581#define SYS_fremovexattr 220
582#define SYS_futex 221
583#define SYS_sched_setaffinity 222
584#define SYS_sched_getaffinity 223
585#define SYS_tuxcall 225
586#define SYS_io_setup 227
587#define SYS_io_destroy 228
588#define SYS_io_getevents 229
589#define SYS_io_submit 230
590#define SYS_io_cancel 231
591#define SYS_set_tid_address 232
592#define SYS_fadvise64 233
593#define SYS_exit_group 234
594#define SYS_lookup_dcookie 235
595#define SYS_epoll_create 236
596#define SYS_epoll_ctl 237
597#define SYS_epoll_wait 238
598#define SYS_remap_file_pages 239
599#define SYS_timer_create 240
600#define SYS_timer_settime 241
601#define SYS_timer_gettime 242
602#define SYS_timer_getoverrun 243
603#define SYS_timer_delete 244
604#define SYS_clock_settime 245
605#define SYS_clock_gettime 246
606#define SYS_clock_getres 247
607#define SYS_clock_nanosleep 248
608#define SYS_swapcontext 249
609#define SYS_tgkill 250
610#define SYS_utimes 251
611#define SYS_statfs64 252
612#define SYS_fstatfs64 253
613#define SYS_rtas 255
614#define SYS_sys_debug_setcontext 256
615#define SYS_migrate_pages 258
616#define SYS_mbind 259
617#define SYS_get_mempolicy 260
618#define SYS_set_mempolicy 261
619#define SYS_mq_open 262
620#define SYS_mq_unlink 263
621#define SYS_mq_timedsend 264
622#define SYS_mq_timedreceive 265
623#define SYS_mq_notify 266
624#define SYS_mq_getsetattr 267
625#define SYS_kexec_load 268
626#define SYS_add_key 269
627#define SYS_request_key 270
628#define SYS_keyctl 271
629#define SYS_waitid 272
630#define SYS_ioprio_set 273
631#define SYS_ioprio_get 274
632#define SYS_inotify_init 275
633#define SYS_inotify_add_watch 276
634#define SYS_inotify_rm_watch 277
635#define SYS_spu_run 278
636#define SYS_spu_create 279
637#define SYS_pselect6 280
638#define SYS_ppoll 281
639#define SYS_unshare 282
640#define SYS_splice 283
641#define SYS_tee 284
642#define SYS_vmsplice 285
643#define SYS_openat 286
644#define SYS_mkdirat 287
645#define SYS_mknodat 288
646#define SYS_fchownat 289
647#define SYS_futimesat 290
648#define SYS_newfstatat 291
649#define SYS_unlinkat 292
650#define SYS_renameat 293
651#define SYS_linkat 294
652#define SYS_symlinkat 295
653#define SYS_readlinkat 296
654#define SYS_fchmodat 297
655#define SYS_faccessat 298
656#define SYS_get_robust_list 299
657#define SYS_set_robust_list 300
658#define SYS_move_pages 301
659#define SYS_getcpu 302
660#define SYS_epoll_pwait 303
661#define SYS_utimensat 304
662#define SYS_signalfd 305
663#define SYS_timerfd_create 306
664#define SYS_eventfd 307
665#define SYS_sync_file_range2 308
666#define SYS_fallocate 309
667#define SYS_subpage_prot 310
668#define SYS_timerfd_settime 311
669#define SYS_timerfd_gettime 312
670#define SYS_signalfd4 313
671#define SYS_eventfd2 314
672#define SYS_epoll_create1 315
673#define SYS_dup3 316
674#define SYS_pipe2 317
675#define SYS_inotify_init1 318
676#define SYS_perf_event_open 319
677#define SYS_preadv 320
678#define SYS_pwritev 321
679#define SYS_rt_tgsigqueueinfo 322
680#define SYS_fanotify_init 323
681#define SYS_fanotify_mark 324
682#define SYS_prlimit64 325
683#define SYS_socket 326
684#define SYS_bind 327
685#define SYS_connect 328
686#define SYS_listen 329
687#define SYS_accept 330
688#define SYS_getsockname 331
689#define SYS_getpeername 332
690#define SYS_socketpair 333
691#define SYS_send 334
692#define SYS_sendto 335
693#define SYS_recv 336
694#define SYS_recvfrom 337
695#define SYS_shutdown 338
696#define SYS_setsockopt 339
697#define SYS_getsockopt 340
698#define SYS_sendmsg 341
699#define SYS_recvmsg 342
700#define SYS_recvmmsg 343
701#define SYS_accept4 344
702#define SYS_name_to_handle_at 345
703#define SYS_open_by_handle_at 346
704#define SYS_clock_adjtime 347
705#define SYS_syncfs 348
706#define SYS_sendmmsg 349
707#define SYS_setns 350
708#define SYS_process_vm_readv 351
709#define SYS_process_vm_writev 352
710#define SYS_finit_module 353
711#define SYS_kcmp 354
712#define SYS_sched_setattr 355
713#define SYS_sched_getattr 356
714#define SYS_renameat2 357
715#define SYS_seccomp 358
716#define SYS_getrandom 359
717#define SYS_memfd_create 360
718#define SYS_bpf 361
719#define SYS_execveat 362
720#define SYS_switch_endian 363
721#define SYS_userfaultfd 364
722#define SYS_membarrier 365
723#define SYS_mlock2 378
724#define SYS_copy_file_range 379
725#define SYS_preadv2 380
726#define SYS_pwritev2 381
727#define SYS_kexec_file_load 382
728#define SYS_statx 383
729#define SYS_pkey_alloc 384
730#define SYS_pkey_free 385
731#define SYS_pkey_mprotect 386
732#define SYS_rseq 387
733#define SYS_io_pgetevents 388
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/termios.h deleted-171
...@@ -1,171 +0,0 @@
1#undef NCCS
2#define NCCS 19
3struct termios {
4 tcflag_t c_iflag;
5 tcflag_t c_oflag;
6 tcflag_t c_cflag;
7 tcflag_t c_lflag;
8 cc_t c_cc[NCCS];
9 cc_t c_line;
10 speed_t __c_ispeed;
11 speed_t __c_ospeed;
12};
13
14#define VINTR 0
15#define VQUIT 1
16#define VERASE 2
17#define VKILL 3
18#define VEOF 4
19#define VMIN 5
20#define VEOL 6
21#define VTIME 7
22#define VEOL2 8
23#define VSWTC 9
24#define VWERASE 10
25#define VREPRINT 11
26#define VSUSP 12
27#define VSTART 13
28#define VSTOP 14
29#define VLNEXT 15
30#define VDISCARD 16
31
32#define IGNBRK 0000001
33#define BRKINT 0000002
34#define IGNPAR 0000004
35#define PARMRK 0000010
36#define INPCK 0000020
37#define ISTRIP 0000040
38#define INLCR 0000100
39#define IGNCR 0000200
40#define ICRNL 0000400
41#define IXON 0001000
42#define IXOFF 0002000
43#define IXANY 0004000
44#define IUCLC 0010000
45#define IMAXBEL 0020000
46#define IUTF8 0040000
47
48#define OPOST 0000001
49#define ONLCR 0000002
50#define OLCUC 0000004
51#define OCRNL 0000010
52#define ONOCR 0000020
53#define ONLRET 0000040
54#define OFILL 0000100
55#define OFDEL 0000200
56#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
57#define NLDLY 0001400
58#define NL0 0000000
59#define NL1 0000400
60#define NL2 0001000
61#define NL3 0001400
62#define TABDLY 0006000
63#define TAB0 0000000
64#define TAB1 0002000
65#define TAB2 0004000
66#define TAB3 0006000
67#define CRDLY 0030000
68#define CR0 0000000
69#define CR1 0010000
70#define CR2 0020000
71#define CR3 0030000
72#define FFDLY 0040000
73#define FF0 0000000
74#define FF1 0040000
75#define BSDLY 0100000
76#define BS0 0000000
77#define BS1 0100000
78#endif
79
80#define VTDLY 0200000
81#define VT0 0000000
82#define VT1 0200000
83
84#define B0 0000000
85#define B50 0000001
86#define B75 0000002
87#define B110 0000003
88#define B134 0000004
89#define B150 0000005
90#define B200 0000006
91#define B300 0000007
92#define B600 0000010
93#define B1200 0000011
94#define B1800 0000012
95#define B2400 0000013
96#define B4800 0000014
97#define B9600 0000015
98#define B19200 0000016
99#define B38400 0000017
100
101#define B57600 00020
102#define B115200 00021
103#define B230400 00022
104#define B460800 00023
105#define B500000 00024
106#define B576000 00025
107#define B921600 00026
108#define B1000000 00027
109#define B1152000 00030
110#define B1500000 00031
111#define B2000000 00032
112#define B2500000 00033
113#define B3000000 00034
114#define B3500000 00035
115#define B4000000 00036
116
117#define CSIZE 00001400
118#define CS5 00000000
119#define CS6 00000400
120#define CS7 00001000
121#define CS8 00001400
122#define CSTOPB 00002000
123#define CREAD 00004000
124#define PARENB 00010000
125#define PARODD 00020000
126#define HUPCL 00040000
127#define CLOCAL 00100000
128
129#define ECHOE 0x00000002
130#define ECHOK 0x00000004
131#define ECHO 0x00000008
132#define ECHONL 0x00000010
133#define ISIG 0x00000080
134#define ICANON 0x00000100
135#define IEXTEN 0x00000400
136#define TOSTOP 0x00400000
137#define NOFLSH 0x80000000
138
139#define TCOOFF 0
140#define TCOON 1
141#define TCIOFF 2
142#define TCION 3
143
144#define TCIFLUSH 0
145#define TCOFLUSH 1
146#define TCIOFLUSH 2
147
148#define TCSANOW 0
149#define TCSADRAIN 1
150#define TCSAFLUSH 2
151
152#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
153#define EXTA 0000016
154#define EXTB 0000017
155#define CBAUD 00377
156#define CBAUDEX 0000020
157#define CIBAUD 077600000
158#define CMSPAR 010000000000
159#define CRTSCTS 020000000000
160
161#define XCASE 0x00004000
162#define ECHOCTL 0x00000040
163#define ECHOPRT 0x00000020
164#define ECHOKE 0x00000001
165#define FLUSHO 0x00800000
166#define PENDIN 0x20000000
167#define EXTPROC 0x10000000
168
169#define XTABS 00006000
170#define TIOCSER_TEMT 0x01
171#endif
\ No newline at end of file
lib/libc/include/powerpc64le-linux-musl/bits/user.h deleted-25
...@@ -1,25 +0,0 @@
1struct pt_regs {
2 unsigned long gpr[32], nip, msr, orig_gpr3, ctr, link, xer, ccr, softe;
3 unsigned long trap, dar, dsisr, result;
4};
5
6struct user {
7 struct pt_regs regs;
8 unsigned long u_tsize, u_dsize, u_ssize;
9 unsigned long start_code, start_data, start_stack;
10 long signal;
11 void *u_ar0;
12 unsigned long magic;
13 char u_comm[32];
14};
15
16#define ELF_NGREG 48
17#define ELF_NFPREG 33
18#define ELF_NVRREG 34
19typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
20typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
21typedef struct { unsigned u[4]; }
22#ifdef __GNUC__
23__attribute__((__aligned__(16)))
24#endif
25 elf_vrreg_t, elf_vrregset_t[ELF_NVRREG];
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bfd.h deleted-8034
...@@ -1,8034 +0,0 @@
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
5 "linker.c", "simple.c" and "compress.c".
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
9
10 Copyright (C) 1990-2019 Free Software Foundation, Inc.
11
12 Contributed by Cygnus Support.
13
14 This file is part of BFD, the Binary File Descriptor library.
15
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29
30#ifndef __BFD_H_SEEN__
31#define __BFD_H_SEEN__
32
33/* PR 14072: Ensure that config.h is included first. */
34#if !defined PACKAGE && !defined PACKAGE_VERSION
35#error config.h must be included before this header
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include "ansidecl.h"
43#include "symcat.h"
44#include "bfd_stdint.h"
45#include "diagnostics.h"
46#include <stdarg.h>
47#include <sys/stat.h>
48
49#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
50#ifndef SABER
51/* This hack is to avoid a problem with some strict ANSI C preprocessors.
52 The problem is, "32_" is not a valid preprocessing token, and we don't
53 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
54 cause the inner CONCAT2 macros to be evaluated first, producing
55 still-valid pp-tokens. Then the final concatenation can be done. */
56#undef CONCAT4
57#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
58#endif
59#endif
60
61/* This is a utility macro to handle the situation where the code
62 wants to place a constant string into the code, followed by a
63 comma and then the length of the string. Doing this by hand
64 is error prone, so using this macro is safer. */
65#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
66/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
67 to create the arguments to another macro, since the preprocessor
68 will mis-count the number of arguments to the outer macro (by not
69 evaluating STRING_COMMA_LEN and so missing the comma). This is a
70 problem for example when trying to use STRING_COMMA_LEN to build
71 the arguments to the strncmp() macro. Hence this alternative
72 definition of strncmp is provided here.
73
74 Note - these macros do NOT work if STR2 is not a constant string. */
75#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
76 /* strcpy() can have a similar problem, but since we know we are
77 copying a constant string, we can use memcpy which will be faster
78 since there is no need to check for a NUL byte inside STR. We
79 can also save time if we do not need to copy the terminating NUL. */
80#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
81#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
82
83
84#define BFD_SUPPORTS_PLUGINS 1
85
86/* The word size used by BFD on the host. This may be 64 with a 32
87 bit target if the host is 64 bit, or if other 64 bit targets have
88 been selected with --enable-targets, or if --enable-64-bit-bfd. */
89#define BFD_ARCH_SIZE 64
90
91/* The word size of the default bfd target. */
92#define BFD_DEFAULT_TARGET_SIZE 32
93
94#define BFD_HOST_64BIT_LONG 0
95#define BFD_HOST_64BIT_LONG_LONG 1
96#if 1
97#define BFD_HOST_64_BIT long long
98#define BFD_HOST_U_64_BIT unsigned long long
99typedef BFD_HOST_64_BIT bfd_int64_t;
100typedef BFD_HOST_U_64_BIT bfd_uint64_t;
101#endif
102
103#ifdef HAVE_INTTYPES_H
104# include <inttypes.h>
105#else
106# if BFD_HOST_64BIT_LONG
107# define BFD_PRI64 "l"
108# elif defined (__MSVCRT__)
109# define BFD_PRI64 "I64"
110# else
111# define BFD_PRI64 "ll"
112# endif
113# undef PRId64
114# define PRId64 BFD_PRI64 "d"
115# undef PRIu64
116# define PRIu64 BFD_PRI64 "u"
117# undef PRIx64
118# define PRIx64 BFD_PRI64 "x"
119#endif
120
121#if BFD_ARCH_SIZE >= 64
122#define BFD64
123#endif
124
125#ifndef INLINE
126#if __GNUC__ >= 2
127#define INLINE __inline__
128#else
129#define INLINE
130#endif
131#endif
132
133/* Declaring a type wide enough to hold a host long and a host pointer. */
134#define BFD_HOSTPTR_T unsigned long
135typedef BFD_HOSTPTR_T bfd_hostptr_t;
136
137/* Forward declaration. */
138typedef struct bfd bfd;
139
140/* Boolean type used in bfd. Too many systems define their own
141 versions of "boolean" for us to safely typedef a "boolean" of
142 our own. Using an enum for "bfd_boolean" has its own set of
143 problems, with strange looking casts required to avoid warnings
144 on some older compilers. Thus we just use an int.
145
146 General rule: Functions which are bfd_boolean return TRUE on
147 success and FALSE on failure (unless they're a predicate). */
148
149typedef int bfd_boolean;
150#undef FALSE
151#undef TRUE
152#define FALSE 0
153#define TRUE 1
154
155#ifdef BFD64
156
157#ifndef BFD_HOST_64_BIT
158 #error No 64 bit integer type available
159#endif /* ! defined (BFD_HOST_64_BIT) */
160
161typedef BFD_HOST_U_64_BIT bfd_vma;
162typedef BFD_HOST_64_BIT bfd_signed_vma;
163typedef BFD_HOST_U_64_BIT bfd_size_type;
164typedef BFD_HOST_U_64_BIT symvalue;
165
166#if BFD_HOST_64BIT_LONG
167#define BFD_VMA_FMT "l"
168#elif defined (__MSVCRT__)
169#define BFD_VMA_FMT "I64"
170#else
171#define BFD_VMA_FMT "ll"
172#endif
173
174#ifndef fprintf_vma
175#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
176#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
177#endif
178
179#else /* not BFD64 */
180
181/* Represent a target address. Also used as a generic unsigned type
182 which is guaranteed to be big enough to hold any arithmetic types
183 we need to deal with. */
184typedef unsigned long bfd_vma;
185
186/* A generic signed type which is guaranteed to be big enough to hold any
187 arithmetic types we need to deal with. Can be assumed to be compatible
188 with bfd_vma in the same way that signed and unsigned ints are compatible
189 (as parameters, in assignment, etc). */
190typedef long bfd_signed_vma;
191
192typedef unsigned long symvalue;
193typedef unsigned long bfd_size_type;
194
195/* Print a bfd_vma x on stream s. */
196#define BFD_VMA_FMT "l"
197#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
198#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
199
200#endif /* not BFD64 */
201
202#define HALF_BFD_SIZE_TYPE \
203 (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
204
205#ifndef BFD_HOST_64_BIT
206/* Fall back on a 32 bit type. The idea is to make these types always
207 available for function return types, but in the case that
208 BFD_HOST_64_BIT is undefined such a function should abort or
209 otherwise signal an error. */
210typedef bfd_signed_vma bfd_int64_t;
211typedef bfd_vma bfd_uint64_t;
212#endif
213
214/* An offset into a file. BFD always uses the largest possible offset
215 based on the build time availability of fseek, fseeko, or fseeko64. */
216typedef BFD_HOST_64_BIT file_ptr;
217typedef unsigned BFD_HOST_64_BIT ufile_ptr;
218
219extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
220extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
221
222#define printf_vma(x) fprintf_vma(stdout,x)
223#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
224
225typedef unsigned int flagword; /* 32 bits of flags */
226typedef unsigned char bfd_byte;
227
228/* File formats. */
229
230typedef enum bfd_format
231{
232 bfd_unknown = 0, /* File format is unknown. */
233 bfd_object, /* Linker/assembler/compiler output. */
234 bfd_archive, /* Object archive file. */
235 bfd_core, /* Core dump. */
236 bfd_type_end /* Marks the end; don't use it! */
237}
238bfd_format;
239
240/* Symbols and relocation. */
241
242/* A count of carsyms (canonical archive symbols). */
243typedef unsigned long symindex;
244
245#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
246
247/* General purpose part of a symbol X;
248 target specific parts are in libcoff.h, libaout.h, etc. */
249
250#define bfd_get_section(x) ((x)->section)
251#define bfd_get_output_section(x) ((x)->section->output_section)
252#define bfd_set_section(x,y) ((x)->section) = (y)
253#define bfd_asymbol_base(x) ((x)->section->vma)
254#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
255#define bfd_asymbol_name(x) ((x)->name)
256/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
257#define bfd_asymbol_bfd(x) ((x)->the_bfd)
258#define bfd_asymbol_flavour(x) \
259 (((x)->flags & BSF_SYNTHETIC) != 0 \
260 ? bfd_target_unknown_flavour \
261 : bfd_asymbol_bfd (x)->xvec->flavour)
262
263/* A canonical archive symbol. */
264/* This is a type pun with struct ranlib on purpose! */
265typedef struct carsym
266{
267 char *name;
268 file_ptr file_offset; /* Look here to find the file. */
269}
270carsym; /* To make these you call a carsymogen. */
271
272/* Used in generating armaps (archive tables of contents).
273 Perhaps just a forward definition would do? */
274struct orl /* Output ranlib. */
275{
276 char **name; /* Symbol name. */
277 union
278 {
279 file_ptr pos;
280 bfd *abfd;
281 } u; /* bfd* or file position. */
282 int namidx; /* Index into string table. */
283};
284
285/* Linenumber stuff. */
286typedef struct lineno_cache_entry
287{
288 unsigned int line_number; /* Linenumber from start of function. */
289 union
290 {
291 struct bfd_symbol *sym; /* Function name. */
292 bfd_vma offset; /* Offset into section. */
293 } u;
294}
295alent;
296
297/* Object and core file sections. */
298typedef struct bfd_section *sec_ptr;
299
300#define align_power(addr, align) \
301 (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
302
303/* Align an address upward to a boundary, expressed as a number of bytes.
304 E.g. align to an 8-byte boundary with argument of 8. Take care never
305 to wrap around if the address is within boundary-1 of the end of the
306 address space. */
307#define BFD_ALIGN(this, boundary) \
308 ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
309 ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
310 : ~ (bfd_vma) 0)
311
312#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
313#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
314#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
315#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
316 (ptr)->alignment_power)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) ((ptr)->size)
319#define bfd_get_section_size(ptr) ((ptr)->size)
320#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
321#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
322#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
323#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
324#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
325
326#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
327
328#define bfd_get_section_limit_octets(bfd, sec) \
329 ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
330 ? (sec)->rawsize : (sec)->size)
331
332/* Find the address one past the end of SEC. */
333#define bfd_get_section_limit(bfd, sec) \
334 (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
335
336/* Return TRUE if input section SEC has been discarded. */
337#define discarded_section(sec) \
338 (!bfd_is_abs_section (sec) \
339 && bfd_is_abs_section ((sec)->output_section) \
340 && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \
341 && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
342
343typedef enum bfd_print_symbol
344{
345 bfd_print_symbol_name,
346 bfd_print_symbol_more,
347 bfd_print_symbol_all
348} bfd_print_symbol_type;
349
350/* Information about a symbol that nm needs. */
351
352typedef struct _symbol_info
353{
354 symvalue value;
355 char type;
356 const char *name; /* Symbol name. */
357 unsigned char stab_type; /* Stab type. */
358 char stab_other; /* Stab other. */
359 short stab_desc; /* Stab desc. */
360 const char *stab_name; /* String for stab type. */
361} symbol_info;
362
363/* Get the name of a stabs type code. */
364
365extern const char *bfd_get_stab_name (int);
366
367/* Hash table routines. There is no way to free up a hash table. */
368
369/* An element in the hash table. Most uses will actually use a larger
370 structure, and an instance of this will be the first field. */
371
372struct bfd_hash_entry
373{
374 /* Next entry for this hash code. */
375 struct bfd_hash_entry *next;
376 /* String being hashed. */
377 const char *string;
378 /* Hash code. This is the full hash code, not the index into the
379 table. */
380 unsigned long hash;
381};
382
383/* A hash table. */
384
385struct bfd_hash_table
386{
387 /* The hash array. */
388 struct bfd_hash_entry **table;
389 /* A function used to create new elements in the hash table. The
390 first entry is itself a pointer to an element. When this
391 function is first invoked, this pointer will be NULL. However,
392 having the pointer permits a hierarchy of method functions to be
393 built each of which calls the function in the superclass. Thus
394 each function should be written to allocate a new block of memory
395 only if the argument is NULL. */
396 struct bfd_hash_entry *(*newfunc)
397 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
398 /* An objalloc for this hash table. This is a struct objalloc *,
399 but we use void * to avoid requiring the inclusion of objalloc.h. */
400 void *memory;
401 /* The number of slots in the hash table. */
402 unsigned int size;
403 /* The number of entries in the hash table. */
404 unsigned int count;
405 /* The size of elements. */
406 unsigned int entsize;
407 /* If non-zero, don't grow the hash table. */
408 unsigned int frozen:1;
409};
410
411/* Initialize a hash table. */
412extern bfd_boolean bfd_hash_table_init
413 (struct bfd_hash_table *,
414 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
415 struct bfd_hash_table *,
416 const char *),
417 unsigned int);
418
419/* Initialize a hash table specifying a size. */
420extern bfd_boolean bfd_hash_table_init_n
421 (struct bfd_hash_table *,
422 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
423 struct bfd_hash_table *,
424 const char *),
425 unsigned int, unsigned int);
426
427/* Free up a hash table. */
428extern void bfd_hash_table_free
429 (struct bfd_hash_table *);
430
431/* Look up a string in a hash table. If CREATE is TRUE, a new entry
432 will be created for this string if one does not already exist. The
433 COPY argument must be TRUE if this routine should copy the string
434 into newly allocated memory when adding an entry. */
435extern struct bfd_hash_entry *bfd_hash_lookup
436 (struct bfd_hash_table *, const char *, bfd_boolean create,
437 bfd_boolean copy);
438
439/* Insert an entry in a hash table. */
440extern struct bfd_hash_entry *bfd_hash_insert
441 (struct bfd_hash_table *, const char *, unsigned long);
442
443/* Rename an entry in a hash table. */
444extern void bfd_hash_rename
445 (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
446
447/* Replace an entry in a hash table. */
448extern void bfd_hash_replace
449 (struct bfd_hash_table *, struct bfd_hash_entry *old,
450 struct bfd_hash_entry *nw);
451
452/* Base method for creating a hash table entry. */
453extern struct bfd_hash_entry *bfd_hash_newfunc
454 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
455
456/* Grab some space for a hash table entry. */
457extern void *bfd_hash_allocate
458 (struct bfd_hash_table *, unsigned int);
459
460/* Traverse a hash table in a random order, calling a function on each
461 element. If the function returns FALSE, the traversal stops. The
462 INFO argument is passed to the function. */
463extern void bfd_hash_traverse
464 (struct bfd_hash_table *,
465 bfd_boolean (*) (struct bfd_hash_entry *, void *),
466 void *info);
467
468/* Allows the default size of a hash table to be configured. New hash
469 tables allocated using bfd_hash_table_init will be created with
470 this size. */
471extern unsigned long bfd_hash_set_default_size (unsigned long);
472
473/* Types of compressed DWARF debug sections. We currently support
474 zlib. */
475enum compressed_debug_section_type
476{
477 COMPRESS_DEBUG_NONE = 0,
478 COMPRESS_DEBUG = 1 << 0,
479 COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
480 COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
481};
482
483/* This structure is used to keep track of stabs in sections
484 information while linking. */
485
486struct stab_info
487{
488 /* A hash table used to hold stabs strings. */
489 struct bfd_strtab_hash *strings;
490 /* The header file hash table. */
491 struct bfd_hash_table includes;
492 /* The first .stabstr section. */
493 struct bfd_section *stabstr;
494};
495
496#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
497
498/* User program access to BFD facilities. */
499
500/* Direct I/O routines, for programs which know more about the object
501 file than BFD does. Use higher level routines if possible. */
502
503extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
504extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
505extern int bfd_seek (bfd *, file_ptr, int);
506extern file_ptr bfd_tell (bfd *);
507extern int bfd_flush (bfd *);
508extern int bfd_stat (bfd *, struct stat *);
509
510/* Deprecated old routines. */
511#if __GNUC__
512#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
513 (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
514 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
515#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
516 (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
517 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
518#else
519#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
520 (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
521 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
522#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
523 (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
524 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
525#endif
526extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
527
528/* Cast from const char * to char * so that caller can assign to
529 a char * without a warning. */
530#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
531#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
532#define bfd_get_format(abfd) ((abfd)->format)
533#define bfd_get_target(abfd) ((abfd)->xvec->name)
534#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
535#define bfd_family_coff(abfd) \
536 (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
537 bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
538#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
539#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
540#define bfd_header_big_endian(abfd) \
541 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
542#define bfd_header_little_endian(abfd) \
543 ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
544#define bfd_get_file_flags(abfd) ((abfd)->flags)
545#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
546#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
547#define bfd_has_map(abfd) ((abfd)->has_armap)
548#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
549
550#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
551#define bfd_usrdata(abfd) ((abfd)->usrdata)
552
553#define bfd_get_start_address(abfd) ((abfd)->start_address)
554#define bfd_get_symcount(abfd) ((abfd)->symcount)
555#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
556#define bfd_count_sections(abfd) ((abfd)->section_count)
557
558#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
559
560#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
561
562extern bfd_boolean bfd_cache_close
563 (bfd *abfd);
564/* NB: This declaration should match the autogenerated one in libbfd.h. */
565
566extern bfd_boolean bfd_cache_close_all (void);
567
568extern bfd_boolean bfd_record_phdr
569 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
570 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
571
572/* Byte swapping routines. */
573
574bfd_uint64_t bfd_getb64 (const void *);
575bfd_uint64_t bfd_getl64 (const void *);
576bfd_int64_t bfd_getb_signed_64 (const void *);
577bfd_int64_t bfd_getl_signed_64 (const void *);
578bfd_vma bfd_getb32 (const void *);
579bfd_vma bfd_getl32 (const void *);
580bfd_signed_vma bfd_getb_signed_32 (const void *);
581bfd_signed_vma bfd_getl_signed_32 (const void *);
582bfd_vma bfd_getb16 (const void *);
583bfd_vma bfd_getl16 (const void *);
584bfd_signed_vma bfd_getb_signed_16 (const void *);
585bfd_signed_vma bfd_getl_signed_16 (const void *);
586void bfd_putb64 (bfd_uint64_t, void *);
587void bfd_putl64 (bfd_uint64_t, void *);
588void bfd_putb32 (bfd_vma, void *);
589void bfd_putl32 (bfd_vma, void *);
590void bfd_putb24 (bfd_vma, void *);
591void bfd_putl24 (bfd_vma, void *);
592void bfd_putb16 (bfd_vma, void *);
593void bfd_putl16 (bfd_vma, void *);
594
595/* Byte swapping routines which take size and endiannes as arguments. */
596
597bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
598void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
599
600#if defined(__STDC__) || defined(ALMOST_STDC)
601struct ecoff_debug_info;
602struct ecoff_debug_swap;
603struct ecoff_extr;
604struct bfd_symbol;
605struct bfd_link_info;
606struct bfd_link_hash_entry;
607struct bfd_section_already_linked;
608struct bfd_elf_version_tree;
609#endif
610
611extern bfd_boolean bfd_section_already_linked_table_init (void);
612extern void bfd_section_already_linked_table_free (void);
613extern bfd_boolean _bfd_handle_already_linked
614 (struct bfd_section *, struct bfd_section_already_linked *,
615 struct bfd_link_info *);
616
617/* Externally visible ECOFF routines. */
618
619extern bfd_boolean bfd_ecoff_set_gp_value
620 (bfd *abfd, bfd_vma gp_value);
621extern bfd_boolean bfd_ecoff_set_regmasks
622 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
623 unsigned long *cprmask);
624extern void *bfd_ecoff_debug_init
625 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
626 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
627extern void bfd_ecoff_debug_free
628 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
629 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
630extern bfd_boolean bfd_ecoff_debug_accumulate
631 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
632 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
633 struct ecoff_debug_info *input_debug,
634 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
635extern bfd_boolean bfd_ecoff_debug_accumulate_other
636 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
637 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
638 struct bfd_link_info *);
639extern bfd_boolean bfd_ecoff_debug_externals
640 (bfd *abfd, struct ecoff_debug_info *debug,
641 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
642 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
643 void (*set_index) (struct bfd_symbol *, bfd_size_type));
644extern bfd_boolean bfd_ecoff_debug_one_external
645 (bfd *abfd, struct ecoff_debug_info *debug,
646 const struct ecoff_debug_swap *swap, const char *name,
647 struct ecoff_extr *esym);
648extern bfd_size_type bfd_ecoff_debug_size
649 (bfd *abfd, struct ecoff_debug_info *debug,
650 const struct ecoff_debug_swap *swap);
651extern bfd_boolean bfd_ecoff_write_debug
652 (bfd *abfd, struct ecoff_debug_info *debug,
653 const struct ecoff_debug_swap *swap, file_ptr where);
654extern bfd_boolean bfd_ecoff_write_accumulated_debug
655 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
656 const struct ecoff_debug_swap *swap,
657 struct bfd_link_info *info, file_ptr where);
658
659/* Externally visible ELF routines. */
660
661struct bfd_link_needed_list
662{
663 struct bfd_link_needed_list *next;
664 bfd *by;
665 const char *name;
666};
667
668enum dynamic_lib_link_class {
669 DYN_NORMAL = 0,
670 DYN_AS_NEEDED = 1,
671 DYN_DT_NEEDED = 2,
672 DYN_NO_ADD_NEEDED = 4,
673 DYN_NO_NEEDED = 8
674};
675
676enum notice_asneeded_action {
677 notice_as_needed,
678 notice_not_needed,
679 notice_needed
680};
681
682extern bfd_boolean bfd_elf_record_link_assignment
683 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
684 bfd_boolean);
685extern struct bfd_link_needed_list *bfd_elf_get_needed_list
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_elf_get_bfd_needed_list
688 (bfd *, struct bfd_link_needed_list **);
689extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
690 const char *, bfd_vma);
691extern bfd_boolean bfd_elf_size_dynamic_sections
692 (bfd *, const char *, const char *, const char *, const char *, const char *,
693 const char * const *, struct bfd_link_info *, struct bfd_section **);
694extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
695 (bfd *, struct bfd_link_info *);
696extern void bfd_elf_set_dt_needed_name
697 (bfd *, const char *);
698extern const char *bfd_elf_get_dt_soname
699 (bfd *);
700extern void bfd_elf_set_dyn_lib_class
701 (bfd *, enum dynamic_lib_link_class);
702extern int bfd_elf_get_dyn_lib_class
703 (bfd *);
704extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
705 (bfd *, struct bfd_link_info *);
706extern int bfd_elf_discard_info
707 (bfd *, struct bfd_link_info *);
708extern unsigned int _bfd_elf_default_action_discarded
709 (struct bfd_section *);
710
711/* Return an upper bound on the number of bytes required to store a
712 copy of ABFD's program header table entries. Return -1 if an error
713 occurs; bfd_get_error will return an appropriate code. */
714extern long bfd_get_elf_phdr_upper_bound
715 (bfd *abfd);
716
717/* Copy ABFD's program header table entries to *PHDRS. The entries
718 will be stored as an array of Elf_Internal_Phdr structures, as
719 defined in include/elf/internal.h. To find out how large the
720 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
721
722 Return the number of program header table entries read, or -1 if an
723 error occurs; bfd_get_error will return an appropriate code. */
724extern int bfd_get_elf_phdrs
725 (bfd *abfd, void *phdrs);
726
727/* Create a new BFD as if by bfd_openr. Rather than opening a file,
728 reconstruct an ELF file by reading the segments out of remote
729 memory based on the ELF file header at EHDR_VMA and the ELF program
730 headers it points to. If non-zero, SIZE is the known extent of the
731 object. If not null, *LOADBASEP is filled in with the difference
732 between the VMAs from which the segments were read, and the VMAs
733 the file headers (and hence BFD's idea of each section's VMA) put
734 them at.
735
736 The function TARGET_READ_MEMORY is called to copy LEN bytes from
737 the remote memory at target address VMA into the local buffer at
738 MYADDR; it should return zero on success or an `errno' code on
739 failure. TEMPL must be a BFD for a target with the word size and
740 byte order found in the remote memory. */
741extern bfd *bfd_elf_bfd_from_remote_memory
742 (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
743 int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
744 bfd_size_type len));
745
746extern struct bfd_section *_bfd_elf_tls_setup
747 (bfd *, struct bfd_link_info *);
748
749extern struct bfd_section *
750_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
751
752extern void _bfd_fix_excluded_sec_syms
753 (bfd *, struct bfd_link_info *);
754
755extern unsigned bfd_m68k_mach_to_features (int);
756
757extern int bfd_m68k_features_to_mach (unsigned);
758
759extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
760 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
761 char **);
762
763extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
764
765extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
766 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
767 char **);
768
769extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
770 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
771 char **);
772
773/* SunOS shared library support routines for the linker. */
774
775extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
776 (bfd *, struct bfd_link_info *);
777extern bfd_boolean bfd_sunos_record_link_assignment
778 (bfd *, struct bfd_link_info *, const char *);
779extern bfd_boolean bfd_sunos_size_dynamic_sections
780 (bfd *, struct bfd_link_info *, struct bfd_section **,
781 struct bfd_section **, struct bfd_section **);
782
783/* Linux shared library support routines for the linker. */
784
785extern bfd_boolean bfd_i386linux_size_dynamic_sections
786 (bfd *, struct bfd_link_info *);
787extern bfd_boolean bfd_sparclinux_size_dynamic_sections
788 (bfd *, struct bfd_link_info *);
789
790/* mmap hacks */
791
792struct _bfd_window_internal;
793typedef struct _bfd_window_internal bfd_window_internal;
794
795typedef struct _bfd_window
796{
797 /* What the user asked for. */
798 void *data;
799 bfd_size_type size;
800 /* The actual window used by BFD. Small user-requested read-only
801 regions sharing a page may share a single window into the object
802 file. Read-write versions shouldn't until I've fixed things to
803 keep track of which portions have been claimed by the
804 application; don't want to give the same region back when the
805 application wants two writable copies! */
806 struct _bfd_window_internal *i;
807}
808bfd_window;
809
810extern void bfd_init_window
811 (bfd_window *);
812extern void bfd_free_window
813 (bfd_window *);
814extern bfd_boolean bfd_get_file_window
815 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
816
817/* XCOFF support routines for the linker. */
818
819extern bfd_boolean bfd_xcoff_split_import_path
820 (bfd *, const char *, const char **, const char **);
821extern bfd_boolean bfd_xcoff_set_archive_import_path
822 (struct bfd_link_info *, bfd *, const char *);
823extern bfd_boolean bfd_xcoff_link_record_set
824 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
825extern bfd_boolean bfd_xcoff_import_symbol
826 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
827 const char *, const char *, const char *, unsigned int);
828extern bfd_boolean bfd_xcoff_export_symbol
829 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
830extern bfd_boolean bfd_xcoff_link_count_reloc
831 (bfd *, struct bfd_link_info *, const char *);
832extern bfd_boolean bfd_xcoff_record_link_assignment
833 (bfd *, struct bfd_link_info *, const char *);
834extern bfd_boolean bfd_xcoff_size_dynamic_sections
835 (bfd *, struct bfd_link_info *, const char *, const char *,
836 unsigned long, unsigned long, unsigned long, bfd_boolean,
837 int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
838extern bfd_boolean bfd_xcoff_link_generate_rtinit
839 (bfd *, const char *, const char *, bfd_boolean);
840
841/* XCOFF support routines for ar. */
842extern bfd_boolean bfd_xcoff_ar_archive_set_magic
843 (bfd *, char *);
844
845/* Externally visible COFF routines. */
846
847#if defined(__STDC__) || defined(ALMOST_STDC)
848struct internal_syment;
849union internal_auxent;
850#endif
851
852extern bfd_boolean bfd_coff_set_symbol_class
853 (bfd *, struct bfd_symbol *, unsigned int);
854
855/* ARM VFP11 erratum workaround support. */
856typedef enum
857{
858 BFD_ARM_VFP11_FIX_DEFAULT,
859 BFD_ARM_VFP11_FIX_NONE,
860 BFD_ARM_VFP11_FIX_SCALAR,
861 BFD_ARM_VFP11_FIX_VECTOR
862} bfd_arm_vfp11_fix;
863
864extern void bfd_elf32_arm_init_maps
865 (bfd *);
866
867extern void bfd_elf32_arm_set_vfp11_fix
868 (bfd *, struct bfd_link_info *);
869
870extern void bfd_elf32_arm_set_cortex_a8_fix
871 (bfd *, struct bfd_link_info *);
872
873extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
874 (bfd *, struct bfd_link_info *);
875
876extern void bfd_elf32_arm_vfp11_fix_veneer_locations
877 (bfd *, struct bfd_link_info *);
878
879/* ARM STM STM32L4XX erratum workaround support. */
880typedef enum
881{
882 BFD_ARM_STM32L4XX_FIX_NONE,
883 BFD_ARM_STM32L4XX_FIX_DEFAULT,
884 BFD_ARM_STM32L4XX_FIX_ALL
885} bfd_arm_stm32l4xx_fix;
886
887extern void bfd_elf32_arm_set_stm32l4xx_fix
888 (bfd *, struct bfd_link_info *);
889
890extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
891 (bfd *, struct bfd_link_info *);
892
893extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
894 (bfd *, struct bfd_link_info *);
895
896/* ARM Interworking support. Called from linker. */
897extern bfd_boolean bfd_arm_allocate_interworking_sections
898 (struct bfd_link_info *);
899
900extern bfd_boolean bfd_arm_process_before_allocation
901 (bfd *, struct bfd_link_info *, int);
902
903extern bfd_boolean bfd_arm_get_bfd_for_interworking
904 (bfd *, struct bfd_link_info *);
905
906/* PE ARM Interworking support. Called from linker. */
907extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
908 (struct bfd_link_info *);
909
910extern bfd_boolean bfd_arm_pe_process_before_allocation
911 (bfd *, struct bfd_link_info *, int);
912
913extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
914 (bfd *, struct bfd_link_info *);
915
916/* ELF ARM Interworking support. Called from linker. */
917extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
918 (struct bfd_link_info *);
919
920extern bfd_boolean bfd_elf32_arm_process_before_allocation
921 (bfd *, struct bfd_link_info *);
922
923struct elf32_arm_params {
924 char *thumb_entry_symbol;
925 int byteswap_code;
926 int target1_is_rel;
927 char * target2_type;
928 int fix_v4bx;
929 int use_blx;
930 bfd_arm_vfp11_fix vfp11_denorm_fix;
931 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
932 int no_enum_size_warning;
933 int no_wchar_size_warning;
934 int pic_veneer;
935 int fix_cortex_a8;
936 int fix_arm1176;
937 int merge_exidx_entries;
938 int cmse_implib;
939 bfd *in_implib_bfd;
940};
941
942void bfd_elf32_arm_set_target_params
943 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
944
945extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
946 (bfd *, struct bfd_link_info *);
947
948extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
949 (bfd *, struct bfd_link_info *);
950
951extern void bfd_elf32_arm_keep_private_stub_output_sections
952 (struct bfd_link_info *);
953
954/* ELF ARM mapping symbol support. */
955#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
956#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
957#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
958#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
959
960extern bfd_boolean bfd_is_arm_special_symbol_name
961 (const char *, int);
962
963extern void bfd_elf32_arm_set_byteswap_code
964 (struct bfd_link_info *, int);
965
966extern void bfd_elf32_arm_use_long_plt (void);
967
968/* ARM Note section processing. */
969extern bfd_boolean bfd_arm_merge_machines
970 (bfd *, bfd *);
971
972extern bfd_boolean bfd_arm_update_notes
973 (bfd *, const char *);
974
975extern unsigned int bfd_arm_get_mach_from_notes
976 (bfd *, const char *);
977
978/* ARM stub generation support. Called from the linker. */
979extern int elf32_arm_setup_section_lists
980 (bfd *, struct bfd_link_info *);
981extern void elf32_arm_next_input_section
982 (struct bfd_link_info *, struct bfd_section *);
983extern bfd_boolean elf32_arm_size_stubs
984 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
985 struct bfd_section * (*) (const char *, struct bfd_section *,
986 struct bfd_section *, unsigned int),
987 void (*) (void));
988extern bfd_boolean elf32_arm_build_stubs
989 (struct bfd_link_info *);
990
991/* ARM unwind section editing support. */
992extern bfd_boolean elf32_arm_fix_exidx_coverage
993(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
994
995/* C6x unwind section editing support. */
996extern bfd_boolean elf32_tic6x_fix_exidx_coverage
997(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
998
999extern void bfd_elf64_aarch64_init_maps
1000 (bfd *);
1001
1002extern void bfd_elf32_aarch64_init_maps
1003 (bfd *);
1004
1005extern void bfd_elf64_aarch64_set_options
1006 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1007
1008extern void bfd_elf32_aarch64_set_options
1009 (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
1010
1011/* ELF AArch64 mapping symbol support. */
1012#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
1013#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1)
1014#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2)
1015#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0)
1016extern bfd_boolean bfd_is_aarch64_special_symbol_name
1017 (const char * name, int type);
1018
1019/* AArch64 stub generation support for ELF64. Called from the linker. */
1020extern int elf64_aarch64_setup_section_lists
1021 (bfd *, struct bfd_link_info *);
1022extern void elf64_aarch64_next_input_section
1023 (struct bfd_link_info *, struct bfd_section *);
1024extern bfd_boolean elf64_aarch64_size_stubs
1025 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1026 struct bfd_section * (*) (const char *, struct bfd_section *),
1027 void (*) (void));
1028extern bfd_boolean elf64_aarch64_build_stubs
1029 (struct bfd_link_info *);
1030/* AArch64 stub generation support for ELF32. Called from the linker. */
1031extern int elf32_aarch64_setup_section_lists
1032 (bfd *, struct bfd_link_info *);
1033extern void elf32_aarch64_next_input_section
1034 (struct bfd_link_info *, struct bfd_section *);
1035extern bfd_boolean elf32_aarch64_size_stubs
1036 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1037 struct bfd_section * (*) (const char *, struct bfd_section *),
1038 void (*) (void));
1039extern bfd_boolean elf32_aarch64_build_stubs
1040 (struct bfd_link_info *);
1041
1042
1043/* TI COFF load page support. */
1044extern void bfd_ticoff_set_section_load_page
1045 (struct bfd_section *, int);
1046
1047extern int bfd_ticoff_get_section_load_page
1048 (struct bfd_section *);
1049
1050/* H8/300 functions. */
1051extern bfd_vma bfd_h8300_pad_address
1052 (bfd *, bfd_vma);
1053
1054/* IA64 Itanium code generation. Called from linker. */
1055extern void bfd_elf32_ia64_after_parse
1056 (int);
1057
1058extern void bfd_elf64_ia64_after_parse
1059 (int);
1060
1061/* V850 Note manipulation routines. */
1062extern bfd_boolean v850_elf_create_sections
1063 (struct bfd_link_info *);
1064
1065extern bfd_boolean v850_elf_set_note
1066 (bfd *, unsigned int, unsigned int);
1067
1068/* MIPS ABI flags data access. For the disassembler. */
1069struct elf_internal_abiflags_v0;
1070extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
1071
1072/* C-SKY functions. */
1073extern bfd_boolean elf32_csky_build_stubs
1074 (struct bfd_link_info *);
1075extern bfd_boolean elf32_csky_size_stubs
1076 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
1077 struct bfd_section *(*) (const char*, struct bfd_section*),
1078 void (*) (void));
1079extern void elf32_csky_next_input_section
1080 (struct bfd_link_info *, struct bfd_section *);
1081extern int elf32_csky_setup_section_lists
1082 (bfd *, struct bfd_link_info *);
1083/* Extracted from init.c. */
1084unsigned int bfd_init (void);
1085
1086
1087/* Value returned by bfd_init. */
1088
1089#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
1090/* Extracted from opncls.c. */
1091/* Set to N to open the next N BFDs using an alternate id space. */
1092extern unsigned int bfd_use_reserved_id;
1093bfd *bfd_fopen (const char *filename, const char *target,
1094 const char *mode, int fd);
1095
1096bfd *bfd_openr (const char *filename, const char *target);
1097
1098bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1099
1100bfd *bfd_openstreamr (const char * filename, const char * target,
1101 void * stream);
1102
1103bfd *bfd_openr_iovec (const char *filename, const char *target,
1104 void *(*open_func) (struct bfd *nbfd,
1105 void *open_closure),
1106 void *open_closure,
1107 file_ptr (*pread_func) (struct bfd *nbfd,
1108 void *stream,
1109 void *buf,
1110 file_ptr nbytes,
1111 file_ptr offset),
1112 int (*close_func) (struct bfd *nbfd,
1113 void *stream),
1114 int (*stat_func) (struct bfd *abfd,
1115 void *stream,
1116 struct stat *sb));
1117
1118bfd *bfd_openw (const char *filename, const char *target);
1119
1120bfd_boolean bfd_close (bfd *abfd);
1121
1122bfd_boolean bfd_close_all_done (bfd *);
1123
1124bfd *bfd_create (const char *filename, bfd *templ);
1125
1126bfd_boolean bfd_make_writable (bfd *abfd);
1127
1128bfd_boolean bfd_make_readable (bfd *abfd);
1129
1130void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
1131
1132void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
1133
1134unsigned long bfd_calc_gnu_debuglink_crc32
1135 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1136
1137char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
1138
1139char *bfd_get_alt_debug_link_info (bfd * abfd,
1140 bfd_size_type *buildid_len,
1141 bfd_byte **buildid_out);
1142
1143char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1144
1145char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
1146
1147struct bfd_section *bfd_create_gnu_debuglink_section
1148 (bfd *abfd, const char *filename);
1149
1150bfd_boolean bfd_fill_in_gnu_debuglink_section
1151 (bfd *abfd, struct bfd_section *sect, const char *filename);
1152
1153char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
1154
1155/* Extracted from libbfd.c. */
1156
1157/* Byte swapping macros for user section data. */
1158
1159#define bfd_put_8(abfd, val, ptr) \
1160 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1161#define bfd_put_signed_8 \
1162 bfd_put_8
1163#define bfd_get_8(abfd, ptr) \
1164 (*(const unsigned char *) (ptr) & 0xff)
1165#define bfd_get_signed_8(abfd, ptr) \
1166 (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1167
1168#define bfd_put_16(abfd, val, ptr) \
1169 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1170#define bfd_put_signed_16 \
1171 bfd_put_16
1172#define bfd_get_16(abfd, ptr) \
1173 BFD_SEND (abfd, bfd_getx16, (ptr))
1174#define bfd_get_signed_16(abfd, ptr) \
1175 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1176
1177#define bfd_put_24(abfd, val, ptr) \
1178 do \
1179 if (bfd_big_endian (abfd)) \
1180 bfd_putb24 ((val), (ptr)); \
1181 else \
1182 bfd_putl24 ((val), (ptr)); \
1183 while (0)
1184
1185bfd_vma bfd_getb24 (const void *p);
1186bfd_vma bfd_getl24 (const void *p);
1187
1188#define bfd_get_24(abfd, ptr) \
1189 (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
1190
1191#define bfd_put_32(abfd, val, ptr) \
1192 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1193#define bfd_put_signed_32 \
1194 bfd_put_32
1195#define bfd_get_32(abfd, ptr) \
1196 BFD_SEND (abfd, bfd_getx32, (ptr))
1197#define bfd_get_signed_32(abfd, ptr) \
1198 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1199
1200#define bfd_put_64(abfd, val, ptr) \
1201 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1202#define bfd_put_signed_64 \
1203 bfd_put_64
1204#define bfd_get_64(abfd, ptr) \
1205 BFD_SEND (abfd, bfd_getx64, (ptr))
1206#define bfd_get_signed_64(abfd, ptr) \
1207 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1208
1209#define bfd_get(bits, abfd, ptr) \
1210 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1211 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1212 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1213 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1214 : (abort (), (bfd_vma) - 1))
1215
1216#define bfd_put(bits, abfd, val, ptr) \
1217 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1218 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1219 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1220 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1221 : (abort (), (void) 0))
1222
1223
1224/* Byte swapping macros for file header data. */
1225
1226#define bfd_h_put_8(abfd, val, ptr) \
1227 bfd_put_8 (abfd, val, ptr)
1228#define bfd_h_put_signed_8(abfd, val, ptr) \
1229 bfd_put_8 (abfd, val, ptr)
1230#define bfd_h_get_8(abfd, ptr) \
1231 bfd_get_8 (abfd, ptr)
1232#define bfd_h_get_signed_8(abfd, ptr) \
1233 bfd_get_signed_8 (abfd, ptr)
1234
1235#define bfd_h_put_16(abfd, val, ptr) \
1236 BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1237#define bfd_h_put_signed_16 \
1238 bfd_h_put_16
1239#define bfd_h_get_16(abfd, ptr) \
1240 BFD_SEND (abfd, bfd_h_getx16, (ptr))
1241#define bfd_h_get_signed_16(abfd, ptr) \
1242 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1243
1244#define bfd_h_put_32(abfd, val, ptr) \
1245 BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1246#define bfd_h_put_signed_32 \
1247 bfd_h_put_32
1248#define bfd_h_get_32(abfd, ptr) \
1249 BFD_SEND (abfd, bfd_h_getx32, (ptr))
1250#define bfd_h_get_signed_32(abfd, ptr) \
1251 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1252
1253#define bfd_h_put_64(abfd, val, ptr) \
1254 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1255#define bfd_h_put_signed_64 \
1256 bfd_h_put_64
1257#define bfd_h_get_64(abfd, ptr) \
1258 BFD_SEND (abfd, bfd_h_getx64, (ptr))
1259#define bfd_h_get_signed_64(abfd, ptr) \
1260 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1261
1262/* Aliases for the above, which should eventually go away. */
1263
1264#define H_PUT_64 bfd_h_put_64
1265#define H_PUT_32 bfd_h_put_32
1266#define H_PUT_16 bfd_h_put_16
1267#define H_PUT_8 bfd_h_put_8
1268#define H_PUT_S64 bfd_h_put_signed_64
1269#define H_PUT_S32 bfd_h_put_signed_32
1270#define H_PUT_S16 bfd_h_put_signed_16
1271#define H_PUT_S8 bfd_h_put_signed_8
1272#define H_GET_64 bfd_h_get_64
1273#define H_GET_32 bfd_h_get_32
1274#define H_GET_16 bfd_h_get_16
1275#define H_GET_8 bfd_h_get_8
1276#define H_GET_S64 bfd_h_get_signed_64
1277#define H_GET_S32 bfd_h_get_signed_32
1278#define H_GET_S16 bfd_h_get_signed_16
1279#define H_GET_S8 bfd_h_get_signed_8
1280
1281
1282/* Extracted from bfdio.c. */
1283long bfd_get_mtime (bfd *abfd);
1284
1285ufile_ptr bfd_get_size (bfd *abfd);
1286
1287ufile_ptr bfd_get_file_size (bfd *abfd);
1288
1289void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1290 int prot, int flags, file_ptr offset,
1291 void **map_addr, bfd_size_type *map_len);
1292
1293/* Extracted from bfdwin.c. */
1294/* Extracted from section.c. */
1295
1296typedef struct bfd_section
1297{
1298 /* The name of the section; the name isn't a copy, the pointer is
1299 the same as that passed to bfd_make_section. */
1300 const char *name;
1301
1302 /* A unique sequence number. */
1303 unsigned int id;
1304
1305 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1306 unsigned int index;
1307
1308 /* The next section in the list belonging to the BFD, or NULL. */
1309 struct bfd_section *next;
1310
1311 /* The previous section in the list belonging to the BFD, or NULL. */
1312 struct bfd_section *prev;
1313
1314 /* The field flags contains attributes of the section. Some
1315 flags are read in from the object file, and some are
1316 synthesized from other information. */
1317 flagword flags;
1318
1319#define SEC_NO_FLAGS 0x0
1320
1321 /* Tells the OS to allocate space for this section when loading.
1322 This is clear for a section containing debug information only. */
1323#define SEC_ALLOC 0x1
1324
1325 /* Tells the OS to load the section from the file when loading.
1326 This is clear for a .bss section. */
1327#define SEC_LOAD 0x2
1328
1329 /* The section contains data still to be relocated, so there is
1330 some relocation information too. */
1331#define SEC_RELOC 0x4
1332
1333 /* A signal to the OS that the section contains read only data. */
1334#define SEC_READONLY 0x8
1335
1336 /* The section contains code only. */
1337#define SEC_CODE 0x10
1338
1339 /* The section contains data only. */
1340#define SEC_DATA 0x20
1341
1342 /* The section will reside in ROM. */
1343#define SEC_ROM 0x40
1344
1345 /* The section contains constructor information. This section
1346 type is used by the linker to create lists of constructors and
1347 destructors used by <<g++>>. When a back end sees a symbol
1348 which should be used in a constructor list, it creates a new
1349 section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1350 the symbol to it, and builds a relocation. To build the lists
1351 of constructors, all the linker has to do is catenate all the
1352 sections called <<__CTOR_LIST__>> and relocate the data
1353 contained within - exactly the operations it would peform on
1354 standard data. */
1355#define SEC_CONSTRUCTOR 0x80
1356
1357 /* The section has contents - a data section could be
1358 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1359 <<SEC_HAS_CONTENTS>> */
1360#define SEC_HAS_CONTENTS 0x100
1361
1362 /* An instruction to the linker to not output the section
1363 even if it has information which would normally be written. */
1364#define SEC_NEVER_LOAD 0x200
1365
1366 /* The section contains thread local data. */
1367#define SEC_THREAD_LOCAL 0x400
1368
1369 /* The section's size is fixed. Generic linker code will not
1370 recalculate it and it is up to whoever has set this flag to
1371 get the size right. */
1372#define SEC_FIXED_SIZE 0x800
1373
1374 /* The section contains common symbols (symbols may be defined
1375 multiple times, the value of a symbol is the amount of
1376 space it requires, and the largest symbol value is the one
1377 used). Most targets have exactly one of these (which we
1378 translate to bfd_com_section_ptr), but ECOFF has two. */
1379#define SEC_IS_COMMON 0x1000
1380
1381 /* The section contains only debugging information. For
1382 example, this is set for ELF .debug and .stab sections.
1383 strip tests this flag to see if a section can be
1384 discarded. */
1385#define SEC_DEBUGGING 0x2000
1386
1387 /* The contents of this section are held in memory pointed to
1388 by the contents field. This is checked by bfd_get_section_contents,
1389 and the data is retrieved from memory if appropriate. */
1390#define SEC_IN_MEMORY 0x4000
1391
1392 /* The contents of this section are to be excluded by the
1393 linker for executable and shared objects unless those
1394 objects are to be further relocated. */
1395#define SEC_EXCLUDE 0x8000
1396
1397 /* The contents of this section are to be sorted based on the sum of
1398 the symbol and addend values specified by the associated relocation
1399 entries. Entries without associated relocation entries will be
1400 appended to the end of the section in an unspecified order. */
1401#define SEC_SORT_ENTRIES 0x10000
1402
1403 /* When linking, duplicate sections of the same name should be
1404 discarded, rather than being combined into a single section as
1405 is usually done. This is similar to how common symbols are
1406 handled. See SEC_LINK_DUPLICATES below. */
1407#define SEC_LINK_ONCE 0x20000
1408
1409 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1410 should handle duplicate sections. */
1411#define SEC_LINK_DUPLICATES 0xc0000
1412
1413 /* This value for SEC_LINK_DUPLICATES means that duplicate
1414 sections with the same name should simply be discarded. */
1415#define SEC_LINK_DUPLICATES_DISCARD 0x0
1416
1417 /* This value for SEC_LINK_DUPLICATES means that the linker
1418 should warn if there are any duplicate sections, although
1419 it should still only link one copy. */
1420#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
1421
1422 /* This value for SEC_LINK_DUPLICATES means that the linker
1423 should warn if any duplicate sections are a different size. */
1424#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
1425
1426 /* This value for SEC_LINK_DUPLICATES means that the linker
1427 should warn if any duplicate sections contain different
1428 contents. */
1429#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1430 (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1431
1432 /* This section was created by the linker as part of dynamic
1433 relocation or other arcane processing. It is skipped when
1434 going through the first-pass output, trusting that someone
1435 else up the line will take care of it later. */
1436#define SEC_LINKER_CREATED 0x100000
1437
1438 /* This section should not be subject to garbage collection.
1439 Also set to inform the linker that this section should not be
1440 listed in the link map as discarded. */
1441#define SEC_KEEP 0x200000
1442
1443 /* This section contains "short" data, and should be placed
1444 "near" the GP. */
1445#define SEC_SMALL_DATA 0x400000
1446
1447 /* Attempt to merge identical entities in the section.
1448 Entity size is given in the entsize field. */
1449#define SEC_MERGE 0x800000
1450
1451 /* If given with SEC_MERGE, entities to merge are zero terminated
1452 strings where entsize specifies character size instead of fixed
1453 size entries. */
1454#define SEC_STRINGS 0x1000000
1455
1456 /* This section contains data about section groups. */
1457#define SEC_GROUP 0x2000000
1458
1459 /* The section is a COFF shared library section. This flag is
1460 only for the linker. If this type of section appears in
1461 the input file, the linker must copy it to the output file
1462 without changing the vma or size. FIXME: Although this
1463 was originally intended to be general, it really is COFF
1464 specific (and the flag was renamed to indicate this). It
1465 might be cleaner to have some more general mechanism to
1466 allow the back end to control what the linker does with
1467 sections. */
1468#define SEC_COFF_SHARED_LIBRARY 0x4000000
1469
1470 /* This input section should be copied to output in reverse order
1471 as an array of pointers. This is for ELF linker internal use
1472 only. */
1473#define SEC_ELF_REVERSE_COPY 0x4000000
1474
1475 /* This section contains data which may be shared with other
1476 executables or shared objects. This is for COFF only. */
1477#define SEC_COFF_SHARED 0x8000000
1478
1479 /* This section should be compressed. This is for ELF linker
1480 internal use only. */
1481#define SEC_ELF_COMPRESS 0x8000000
1482
1483 /* When a section with this flag is being linked, then if the size of
1484 the input section is less than a page, it should not cross a page
1485 boundary. If the size of the input section is one page or more,
1486 it should be aligned on a page boundary. This is for TI
1487 TMS320C54X only. */
1488#define SEC_TIC54X_BLOCK 0x10000000
1489
1490 /* This section should be renamed. This is for ELF linker
1491 internal use only. */
1492#define SEC_ELF_RENAME 0x10000000
1493
1494 /* Conditionally link this section; do not link if there are no
1495 references found to any symbol in the section. This is for TI
1496 TMS320C54X only. */
1497#define SEC_TIC54X_CLINK 0x20000000
1498
1499 /* This section contains vliw code. This is for Toshiba MeP only. */
1500#define SEC_MEP_VLIW 0x20000000
1501
1502 /* Indicate that section has the no read flag set. This happens
1503 when memory read flag isn't set. */
1504#define SEC_COFF_NOREAD 0x40000000
1505
1506 /* Indicate that section has the purecode flag set. */
1507#define SEC_ELF_PURECODE 0x80000000
1508
1509 /* End of section flags. */
1510
1511 /* Some internal packed boolean fields. */
1512
1513 /* See the vma field. */
1514 unsigned int user_set_vma : 1;
1515
1516 /* A mark flag used by some of the linker backends. */
1517 unsigned int linker_mark : 1;
1518
1519 /* Another mark flag used by some of the linker backends. Set for
1520 output sections that have an input section. */
1521 unsigned int linker_has_input : 1;
1522
1523 /* Mark flag used by some linker backends for garbage collection. */
1524 unsigned int gc_mark : 1;
1525
1526 /* Section compression status. */
1527 unsigned int compress_status : 2;
1528#define COMPRESS_SECTION_NONE 0
1529#define COMPRESS_SECTION_DONE 1
1530#define DECOMPRESS_SECTION_SIZED 2
1531
1532 /* The following flags are used by the ELF linker. */
1533
1534 /* Mark sections which have been allocated to segments. */
1535 unsigned int segment_mark : 1;
1536
1537 /* Type of sec_info information. */
1538 unsigned int sec_info_type:3;
1539#define SEC_INFO_TYPE_NONE 0
1540#define SEC_INFO_TYPE_STABS 1
1541#define SEC_INFO_TYPE_MERGE 2
1542#define SEC_INFO_TYPE_EH_FRAME 3
1543#define SEC_INFO_TYPE_JUST_SYMS 4
1544#define SEC_INFO_TYPE_TARGET 5
1545#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1546
1547 /* Nonzero if this section uses RELA relocations, rather than REL. */
1548 unsigned int use_rela_p:1;
1549
1550 /* Bits used by various backends. The generic code doesn't touch
1551 these fields. */
1552
1553 unsigned int sec_flg0:1;
1554 unsigned int sec_flg1:1;
1555 unsigned int sec_flg2:1;
1556 unsigned int sec_flg3:1;
1557 unsigned int sec_flg4:1;
1558 unsigned int sec_flg5:1;
1559
1560 /* End of internal packed boolean fields. */
1561
1562 /* The virtual memory address of the section - where it will be
1563 at run time. The symbols are relocated against this. The
1564 user_set_vma flag is maintained by bfd; if it's not set, the
1565 backend can assign addresses (for example, in <<a.out>>, where
1566 the default address for <<.data>> is dependent on the specific
1567 target and various flags). */
1568 bfd_vma vma;
1569
1570 /* The load address of the section - where it would be in a
1571 rom image; really only used for writing section header
1572 information. */
1573 bfd_vma lma;
1574
1575 /* The size of the section in *octets*, as it will be output.
1576 Contains a value even if the section has no contents (e.g., the
1577 size of <<.bss>>). */
1578 bfd_size_type size;
1579
1580 /* For input sections, the original size on disk of the section, in
1581 octets. This field should be set for any section whose size is
1582 changed by linker relaxation. It is required for sections where
1583 the linker relaxation scheme doesn't cache altered section and
1584 reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1585 targets), and thus the original size needs to be kept to read the
1586 section multiple times. For output sections, rawsize holds the
1587 section size calculated on a previous linker relaxation pass. */
1588 bfd_size_type rawsize;
1589
1590 /* The compressed size of the section in octets. */
1591 bfd_size_type compressed_size;
1592
1593 /* Relaxation table. */
1594 struct relax_table *relax;
1595
1596 /* Count of used relaxation table entries. */
1597 int relax_count;
1598
1599
1600 /* If this section is going to be output, then this value is the
1601 offset in *bytes* into the output section of the first byte in the
1602 input section (byte ==> smallest addressable unit on the
1603 target). In most cases, if this was going to start at the
1604 100th octet (8-bit quantity) in the output section, this value
1605 would be 100. However, if the target byte size is 16 bits
1606 (bfd_octets_per_byte is "2"), this value would be 50. */
1607 bfd_vma output_offset;
1608
1609 /* The output section through which to map on output. */
1610 struct bfd_section *output_section;
1611
1612 /* The alignment requirement of the section, as an exponent of 2 -
1613 e.g., 3 aligns to 2^3 (or 8). */
1614 unsigned int alignment_power;
1615
1616 /* If an input section, a pointer to a vector of relocation
1617 records for the data in this section. */
1618 struct reloc_cache_entry *relocation;
1619
1620 /* If an output section, a pointer to a vector of pointers to
1621 relocation records for the data in this section. */
1622 struct reloc_cache_entry **orelocation;
1623
1624 /* The number of relocation records in one of the above. */
1625 unsigned reloc_count;
1626
1627 /* Information below is back end specific - and not always used
1628 or updated. */
1629
1630 /* File position of section data. */
1631 file_ptr filepos;
1632
1633 /* File position of relocation info. */
1634 file_ptr rel_filepos;
1635
1636 /* File position of line data. */
1637 file_ptr line_filepos;
1638
1639 /* Pointer to data for applications. */
1640 void *userdata;
1641
1642 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1643 contents. */
1644 unsigned char *contents;
1645
1646 /* Attached line number information. */
1647 alent *lineno;
1648
1649 /* Number of line number records. */
1650 unsigned int lineno_count;
1651
1652 /* Entity size for merging purposes. */
1653 unsigned int entsize;
1654
1655 /* Points to the kept section if this section is a link-once section,
1656 and is discarded. */
1657 struct bfd_section *kept_section;
1658
1659 /* When a section is being output, this value changes as more
1660 linenumbers are written out. */
1661 file_ptr moving_line_filepos;
1662
1663 /* What the section number is in the target world. */
1664 int target_index;
1665
1666 void *used_by_bfd;
1667
1668 /* If this is a constructor section then here is a list of the
1669 relocations created to relocate items within it. */
1670 struct relent_chain *constructor_chain;
1671
1672 /* The BFD which owns the section. */
1673 bfd *owner;
1674
1675 /* A symbol which points at this section only. */
1676 struct bfd_symbol *symbol;
1677 struct bfd_symbol **symbol_ptr_ptr;
1678
1679 /* Early in the link process, map_head and map_tail are used to build
1680 a list of input sections attached to an output section. Later,
1681 output sections use these fields for a list of bfd_link_order
1682 structs. */
1683 union {
1684 struct bfd_link_order *link_order;
1685 struct bfd_section *s;
1686 } map_head, map_tail;
1687} asection;
1688
1689/* Relax table contains information about instructions which can
1690 be removed by relaxation -- replacing a long address with a
1691 short address. */
1692struct relax_table {
1693 /* Address where bytes may be deleted. */
1694 bfd_vma addr;
1695
1696 /* Number of bytes to be deleted. */
1697 int size;
1698};
1699
1700/* Note: the following are provided as inline functions rather than macros
1701 because not all callers use the return value. A macro implementation
1702 would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1703 compilers will complain about comma expressions that have no effect. */
1704static inline bfd_boolean
1705bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1706 void * val)
1707{
1708 ptr->userdata = val;
1709 return TRUE;
1710}
1711
1712static inline bfd_boolean
1713bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
1714{
1715 ptr->vma = ptr->lma = val;
1716 ptr->user_set_vma = TRUE;
1717 return TRUE;
1718}
1719
1720static inline bfd_boolean
1721bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
1722 unsigned int val)
1723{
1724 ptr->alignment_power = val;
1725 return TRUE;
1726}
1727
1728/* These sections are global, and are managed by BFD. The application
1729 and target back end are not permitted to change the values in
1730 these sections. */
1731extern asection _bfd_std_section[4];
1732
1733#define BFD_ABS_SECTION_NAME "*ABS*"
1734#define BFD_UND_SECTION_NAME "*UND*"
1735#define BFD_COM_SECTION_NAME "*COM*"
1736#define BFD_IND_SECTION_NAME "*IND*"
1737
1738/* Pointer to the common section. */
1739#define bfd_com_section_ptr (&_bfd_std_section[0])
1740/* Pointer to the undefined section. */
1741#define bfd_und_section_ptr (&_bfd_std_section[1])
1742/* Pointer to the absolute section. */
1743#define bfd_abs_section_ptr (&_bfd_std_section[2])
1744/* Pointer to the indirect section. */
1745#define bfd_ind_section_ptr (&_bfd_std_section[3])
1746
1747#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1748#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1749#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1750
1751#define bfd_is_const_section(SEC) \
1752 ( ((SEC) == bfd_abs_section_ptr) \
1753 || ((SEC) == bfd_und_section_ptr) \
1754 || ((SEC) == bfd_com_section_ptr) \
1755 || ((SEC) == bfd_ind_section_ptr))
1756
1757/* Macros to handle insertion and deletion of a bfd's sections. These
1758 only handle the list pointers, ie. do not adjust section_count,
1759 target_index etc. */
1760#define bfd_section_list_remove(ABFD, S) \
1761 do \
1762 { \
1763 asection *_s = S; \
1764 asection *_next = _s->next; \
1765 asection *_prev = _s->prev; \
1766 if (_prev) \
1767 _prev->next = _next; \
1768 else \
1769 (ABFD)->sections = _next; \
1770 if (_next) \
1771 _next->prev = _prev; \
1772 else \
1773 (ABFD)->section_last = _prev; \
1774 } \
1775 while (0)
1776#define bfd_section_list_append(ABFD, S) \
1777 do \
1778 { \
1779 asection *_s = S; \
1780 bfd *_abfd = ABFD; \
1781 _s->next = NULL; \
1782 if (_abfd->section_last) \
1783 { \
1784 _s->prev = _abfd->section_last; \
1785 _abfd->section_last->next = _s; \
1786 } \
1787 else \
1788 { \
1789 _s->prev = NULL; \
1790 _abfd->sections = _s; \
1791 } \
1792 _abfd->section_last = _s; \
1793 } \
1794 while (0)
1795#define bfd_section_list_prepend(ABFD, S) \
1796 do \
1797 { \
1798 asection *_s = S; \
1799 bfd *_abfd = ABFD; \
1800 _s->prev = NULL; \
1801 if (_abfd->sections) \
1802 { \
1803 _s->next = _abfd->sections; \
1804 _abfd->sections->prev = _s; \
1805 } \
1806 else \
1807 { \
1808 _s->next = NULL; \
1809 _abfd->section_last = _s; \
1810 } \
1811 _abfd->sections = _s; \
1812 } \
1813 while (0)
1814#define bfd_section_list_insert_after(ABFD, A, S) \
1815 do \
1816 { \
1817 asection *_a = A; \
1818 asection *_s = S; \
1819 asection *_next = _a->next; \
1820 _s->next = _next; \
1821 _s->prev = _a; \
1822 _a->next = _s; \
1823 if (_next) \
1824 _next->prev = _s; \
1825 else \
1826 (ABFD)->section_last = _s; \
1827 } \
1828 while (0)
1829#define bfd_section_list_insert_before(ABFD, B, S) \
1830 do \
1831 { \
1832 asection *_b = B; \
1833 asection *_s = S; \
1834 asection *_prev = _b->prev; \
1835 _s->prev = _prev; \
1836 _s->next = _b; \
1837 _b->prev = _s; \
1838 if (_prev) \
1839 _prev->next = _s; \
1840 else \
1841 (ABFD)->sections = _s; \
1842 } \
1843 while (0)
1844#define bfd_section_removed_from_list(ABFD, S) \
1845 ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1846
1847#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \
1848 /* name, id, index, next, prev, flags, user_set_vma, */ \
1849 { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
1850 \
1851 /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
1852 0, 0, 1, 0, \
1853 \
1854 /* segment_mark, sec_info_type, use_rela_p, */ \
1855 0, 0, 0, \
1856 \
1857 /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
1858 0, 0, 0, 0, 0, 0, \
1859 \
1860 /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
1861 0, 0, 0, 0, 0, 0, 0, \
1862 \
1863 /* output_offset, output_section, alignment_power, */ \
1864 0, &SEC, 0, \
1865 \
1866 /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
1867 NULL, NULL, 0, 0, 0, \
1868 \
1869 /* line_filepos, userdata, contents, lineno, lineno_count, */ \
1870 0, NULL, NULL, NULL, 0, \
1871 \
1872 /* entsize, kept_section, moving_line_filepos, */ \
1873 0, NULL, 0, \
1874 \
1875 /* target_index, used_by_bfd, constructor_chain, owner, */ \
1876 0, NULL, NULL, NULL, \
1877 \
1878 /* symbol, symbol_ptr_ptr, */ \
1879 (struct bfd_symbol *) SYM, &SEC.symbol, \
1880 \
1881 /* map_head, map_tail */ \
1882 { NULL }, { NULL } \
1883 }
1884
1885/* We use a macro to initialize the static asymbol structures because
1886 traditional C does not permit us to initialize a union member while
1887 gcc warns if we don't initialize it.
1888 the_bfd, name, value, attr, section [, udata] */
1889#ifdef __STDC__
1890#define GLOBAL_SYM_INIT(NAME, SECTION) \
1891 { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
1892#else
1893#define GLOBAL_SYM_INIT(NAME, SECTION) \
1894 { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
1895#endif
1896
1897void bfd_section_list_clear (bfd *);
1898
1899asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1900
1901asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1902
1903asection *bfd_get_linker_section (bfd *abfd, const char *name);
1904
1905asection *bfd_get_section_by_name_if
1906 (bfd *abfd,
1907 const char *name,
1908 bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1909 void *obj);
1910
1911char *bfd_get_unique_section_name
1912 (bfd *abfd, const char *templat, int *count);
1913
1914asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1915
1916asection *bfd_make_section_anyway_with_flags
1917 (bfd *abfd, const char *name, flagword flags);
1918
1919asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1920
1921asection *bfd_make_section_with_flags
1922 (bfd *, const char *name, flagword flags);
1923
1924asection *bfd_make_section (bfd *, const char *name);
1925
1926bfd_boolean bfd_set_section_flags
1927 (bfd *abfd, asection *sec, flagword flags);
1928
1929void bfd_rename_section
1930 (bfd *abfd, asection *sec, const char *newname);
1931
1932void bfd_map_over_sections
1933 (bfd *abfd,
1934 void (*func) (bfd *abfd, asection *sect, void *obj),
1935 void *obj);
1936
1937asection *bfd_sections_find_if
1938 (bfd *abfd,
1939 bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1940 void *obj);
1941
1942bfd_boolean bfd_set_section_size
1943 (bfd *abfd, asection *sec, bfd_size_type val);
1944
1945bfd_boolean bfd_set_section_contents
1946 (bfd *abfd, asection *section, const void *data,
1947 file_ptr offset, bfd_size_type count);
1948
1949bfd_boolean bfd_get_section_contents
1950 (bfd *abfd, asection *section, void *location, file_ptr offset,
1951 bfd_size_type count);
1952
1953bfd_boolean bfd_malloc_and_get_section
1954 (bfd *abfd, asection *section, bfd_byte **buf);
1955
1956bfd_boolean bfd_copy_private_section_data
1957 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1958
1959#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1960 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1961 (ibfd, isection, obfd, osection))
1962bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1963
1964bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1965
1966/* Extracted from archures.c. */
1967enum bfd_architecture
1968{
1969 bfd_arch_unknown, /* File arch not known. */
1970 bfd_arch_obscure, /* Arch known, not one of these. */
1971 bfd_arch_m68k, /* Motorola 68xxx. */
1972#define bfd_mach_m68000 1
1973#define bfd_mach_m68008 2
1974#define bfd_mach_m68010 3
1975#define bfd_mach_m68020 4
1976#define bfd_mach_m68030 5
1977#define bfd_mach_m68040 6
1978#define bfd_mach_m68060 7
1979#define bfd_mach_cpu32 8
1980#define bfd_mach_fido 9
1981#define bfd_mach_mcf_isa_a_nodiv 10
1982#define bfd_mach_mcf_isa_a 11
1983#define bfd_mach_mcf_isa_a_mac 12
1984#define bfd_mach_mcf_isa_a_emac 13
1985#define bfd_mach_mcf_isa_aplus 14
1986#define bfd_mach_mcf_isa_aplus_mac 15
1987#define bfd_mach_mcf_isa_aplus_emac 16
1988#define bfd_mach_mcf_isa_b_nousp 17
1989#define bfd_mach_mcf_isa_b_nousp_mac 18
1990#define bfd_mach_mcf_isa_b_nousp_emac 19
1991#define bfd_mach_mcf_isa_b 20
1992#define bfd_mach_mcf_isa_b_mac 21
1993#define bfd_mach_mcf_isa_b_emac 22
1994#define bfd_mach_mcf_isa_b_float 23
1995#define bfd_mach_mcf_isa_b_float_mac 24
1996#define bfd_mach_mcf_isa_b_float_emac 25
1997#define bfd_mach_mcf_isa_c 26
1998#define bfd_mach_mcf_isa_c_mac 27
1999#define bfd_mach_mcf_isa_c_emac 28
2000#define bfd_mach_mcf_isa_c_nodiv 29
2001#define bfd_mach_mcf_isa_c_nodiv_mac 30
2002#define bfd_mach_mcf_isa_c_nodiv_emac 31
2003 bfd_arch_vax, /* DEC Vax. */
2004
2005 bfd_arch_or1k, /* OpenRISC 1000. */
2006#define bfd_mach_or1k 1
2007#define bfd_mach_or1knd 2
2008
2009 bfd_arch_sparc, /* SPARC. */
2010#define bfd_mach_sparc 1
2011/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
2012#define bfd_mach_sparc_sparclet 2
2013#define bfd_mach_sparc_sparclite 3
2014#define bfd_mach_sparc_v8plus 4
2015#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
2016#define bfd_mach_sparc_sparclite_le 6
2017#define bfd_mach_sparc_v9 7
2018#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
2019#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
2020#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
2021#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */
2022#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */
2023#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */
2024#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */
2025#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */
2026#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */
2027#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2028#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */
2029#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */
2030#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */
2031#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */
2032#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */
2033/* Nonzero if MACH has the v9 instruction set. */
2034#define bfd_mach_sparc_v9_p(mach) \
2035 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
2036 && (mach) != bfd_mach_sparc_sparclite_le)
2037/* Nonzero if MACH is a 64 bit sparc architecture. */
2038#define bfd_mach_sparc_64bit_p(mach) \
2039 ((mach) >= bfd_mach_sparc_v9 \
2040 && (mach) != bfd_mach_sparc_v8plusb \
2041 && (mach) != bfd_mach_sparc_v8plusc \
2042 && (mach) != bfd_mach_sparc_v8plusd \
2043 && (mach) != bfd_mach_sparc_v8pluse \
2044 && (mach) != bfd_mach_sparc_v8plusv \
2045 && (mach) != bfd_mach_sparc_v8plusm \
2046 && (mach) != bfd_mach_sparc_v8plusm8)
2047 bfd_arch_spu, /* PowerPC SPU. */
2048#define bfd_mach_spu 256
2049 bfd_arch_mips, /* MIPS Rxxxx. */
2050#define bfd_mach_mips3000 3000
2051#define bfd_mach_mips3900 3900
2052#define bfd_mach_mips4000 4000
2053#define bfd_mach_mips4010 4010
2054#define bfd_mach_mips4100 4100
2055#define bfd_mach_mips4111 4111
2056#define bfd_mach_mips4120 4120
2057#define bfd_mach_mips4300 4300
2058#define bfd_mach_mips4400 4400
2059#define bfd_mach_mips4600 4600
2060#define bfd_mach_mips4650 4650
2061#define bfd_mach_mips5000 5000
2062#define bfd_mach_mips5400 5400
2063#define bfd_mach_mips5500 5500
2064#define bfd_mach_mips5900 5900
2065#define bfd_mach_mips6000 6000
2066#define bfd_mach_mips7000 7000
2067#define bfd_mach_mips8000 8000
2068#define bfd_mach_mips9000 9000
2069#define bfd_mach_mips10000 10000
2070#define bfd_mach_mips12000 12000
2071#define bfd_mach_mips14000 14000
2072#define bfd_mach_mips16000 16000
2073#define bfd_mach_mips16 16
2074#define bfd_mach_mips5 5
2075#define bfd_mach_mips_loongson_2e 3001
2076#define bfd_mach_mips_loongson_2f 3002
2077#define bfd_mach_mips_gs464 3003
2078#define bfd_mach_mips_gs464e 3004
2079#define bfd_mach_mips_gs264e 3005
2080#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
2081#define bfd_mach_mips_octeon 6501
2082#define bfd_mach_mips_octeonp 6601
2083#define bfd_mach_mips_octeon2 6502
2084#define bfd_mach_mips_octeon3 6503
2085#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
2086#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
2087#define bfd_mach_mipsisa32 32
2088#define bfd_mach_mipsisa32r2 33
2089#define bfd_mach_mipsisa32r3 34
2090#define bfd_mach_mipsisa32r5 36
2091#define bfd_mach_mipsisa32r6 37
2092#define bfd_mach_mipsisa64 64
2093#define bfd_mach_mipsisa64r2 65
2094#define bfd_mach_mipsisa64r3 66
2095#define bfd_mach_mipsisa64r5 68
2096#define bfd_mach_mipsisa64r6 69
2097#define bfd_mach_mips_micromips 96
2098 bfd_arch_i386, /* Intel 386. */
2099#define bfd_mach_i386_intel_syntax (1 << 0)
2100#define bfd_mach_i386_i8086 (1 << 1)
2101#define bfd_mach_i386_i386 (1 << 2)
2102#define bfd_mach_x86_64 (1 << 3)
2103#define bfd_mach_x64_32 (1 << 4)
2104#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
2105#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
2106#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
2107 bfd_arch_l1om, /* Intel L1OM. */
2108#define bfd_mach_l1om (1 << 5)
2109#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
2110 bfd_arch_k1om, /* Intel K1OM. */
2111#define bfd_mach_k1om (1 << 6)
2112#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
2113#define bfd_mach_i386_nacl (1 << 7)
2114#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
2115#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
2116#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
2117 bfd_arch_iamcu, /* Intel MCU. */
2118#define bfd_mach_iamcu (1 << 8)
2119#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
2120#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
2121 bfd_arch_romp, /* IBM ROMP PC/RT. */
2122 bfd_arch_convex, /* Convex. */
2123 bfd_arch_m98k, /* Motorola 98xxx. */
2124 bfd_arch_pyramid, /* Pyramid Technology. */
2125 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
2126#define bfd_mach_h8300 1
2127#define bfd_mach_h8300h 2
2128#define bfd_mach_h8300s 3
2129#define bfd_mach_h8300hn 4
2130#define bfd_mach_h8300sn 5
2131#define bfd_mach_h8300sx 6
2132#define bfd_mach_h8300sxn 7
2133 bfd_arch_pdp11, /* DEC PDP-11. */
2134 bfd_arch_plugin,
2135 bfd_arch_powerpc, /* PowerPC. */
2136#define bfd_mach_ppc 32
2137#define bfd_mach_ppc64 64
2138#define bfd_mach_ppc_403 403
2139#define bfd_mach_ppc_403gc 4030
2140#define bfd_mach_ppc_405 405
2141#define bfd_mach_ppc_505 505
2142#define bfd_mach_ppc_601 601
2143#define bfd_mach_ppc_602 602
2144#define bfd_mach_ppc_603 603
2145#define bfd_mach_ppc_ec603e 6031
2146#define bfd_mach_ppc_604 604
2147#define bfd_mach_ppc_620 620
2148#define bfd_mach_ppc_630 630
2149#define bfd_mach_ppc_750 750
2150#define bfd_mach_ppc_860 860
2151#define bfd_mach_ppc_a35 35
2152#define bfd_mach_ppc_rs64ii 642
2153#define bfd_mach_ppc_rs64iii 643
2154#define bfd_mach_ppc_7400 7400
2155#define bfd_mach_ppc_e500 500
2156#define bfd_mach_ppc_e500mc 5001
2157#define bfd_mach_ppc_e500mc64 5005
2158#define bfd_mach_ppc_e5500 5006
2159#define bfd_mach_ppc_e6500 5007
2160#define bfd_mach_ppc_titan 83
2161#define bfd_mach_ppc_vle 84
2162 bfd_arch_rs6000, /* IBM RS/6000. */
2163#define bfd_mach_rs6k 6000
2164#define bfd_mach_rs6k_rs1 6001
2165#define bfd_mach_rs6k_rsc 6003
2166#define bfd_mach_rs6k_rs2 6002
2167 bfd_arch_hppa, /* HP PA RISC. */
2168#define bfd_mach_hppa10 10
2169#define bfd_mach_hppa11 11
2170#define bfd_mach_hppa20 20
2171#define bfd_mach_hppa20w 25
2172 bfd_arch_d10v, /* Mitsubishi D10V. */
2173#define bfd_mach_d10v 1
2174#define bfd_mach_d10v_ts2 2
2175#define bfd_mach_d10v_ts3 3
2176 bfd_arch_d30v, /* Mitsubishi D30V. */
2177 bfd_arch_dlx, /* DLX. */
2178 bfd_arch_m68hc11, /* Motorola 68HC11. */
2179 bfd_arch_m68hc12, /* Motorola 68HC12. */
2180#define bfd_mach_m6812_default 0
2181#define bfd_mach_m6812 1
2182#define bfd_mach_m6812s 2
2183 bfd_arch_m9s12x, /* Freescale S12X. */
2184 bfd_arch_m9s12xg, /* Freescale XGATE. */
2185 bfd_arch_s12z, /* Freescale S12Z. */
2186#define bfd_mach_s12z_default 0
2187 bfd_arch_z8k, /* Zilog Z8000. */
2188#define bfd_mach_z8001 1
2189#define bfd_mach_z8002 2
2190 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
2191#define bfd_mach_sh 1
2192#define bfd_mach_sh2 0x20
2193#define bfd_mach_sh_dsp 0x2d
2194#define bfd_mach_sh2a 0x2a
2195#define bfd_mach_sh2a_nofpu 0x2b
2196#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
2197#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
2198#define bfd_mach_sh2a_or_sh4 0x2a3
2199#define bfd_mach_sh2a_or_sh3e 0x2a4
2200#define bfd_mach_sh2e 0x2e
2201#define bfd_mach_sh3 0x30
2202#define bfd_mach_sh3_nommu 0x31
2203#define bfd_mach_sh3_dsp 0x3d
2204#define bfd_mach_sh3e 0x3e
2205#define bfd_mach_sh4 0x40
2206#define bfd_mach_sh4_nofpu 0x41
2207#define bfd_mach_sh4_nommu_nofpu 0x42
2208#define bfd_mach_sh4a 0x4a
2209#define bfd_mach_sh4a_nofpu 0x4b
2210#define bfd_mach_sh4al_dsp 0x4d
2211 bfd_arch_alpha, /* Dec Alpha. */
2212#define bfd_mach_alpha_ev4 0x10
2213#define bfd_mach_alpha_ev5 0x20
2214#define bfd_mach_alpha_ev6 0x30
2215 bfd_arch_arm, /* Advanced Risc Machines ARM. */
2216#define bfd_mach_arm_unknown 0
2217#define bfd_mach_arm_2 1
2218#define bfd_mach_arm_2a 2
2219#define bfd_mach_arm_3 3
2220#define bfd_mach_arm_3M 4
2221#define bfd_mach_arm_4 5
2222#define bfd_mach_arm_4T 6
2223#define bfd_mach_arm_5 7
2224#define bfd_mach_arm_5T 8
2225#define bfd_mach_arm_5TE 9
2226#define bfd_mach_arm_XScale 10
2227#define bfd_mach_arm_ep9312 11
2228#define bfd_mach_arm_iWMMXt 12
2229#define bfd_mach_arm_iWMMXt2 13
2230#define bfd_mach_arm_5TEJ 14
2231#define bfd_mach_arm_6 15
2232#define bfd_mach_arm_6KZ 16
2233#define bfd_mach_arm_6T2 17
2234#define bfd_mach_arm_6K 18
2235#define bfd_mach_arm_7 19
2236#define bfd_mach_arm_6M 20
2237#define bfd_mach_arm_6SM 21
2238#define bfd_mach_arm_7EM 22
2239#define bfd_mach_arm_8 23
2240#define bfd_mach_arm_8R 24
2241#define bfd_mach_arm_8M_BASE 25
2242#define bfd_mach_arm_8M_MAIN 26
2243 bfd_arch_nds32, /* Andes NDS32. */
2244#define bfd_mach_n1 1
2245#define bfd_mach_n1h 2
2246#define bfd_mach_n1h_v2 3
2247#define bfd_mach_n1h_v3 4
2248#define bfd_mach_n1h_v3m 5
2249 bfd_arch_ns32k, /* National Semiconductors ns32000. */
2250 bfd_arch_tic30, /* Texas Instruments TMS320C30. */
2251 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
2252#define bfd_mach_tic3x 30
2253#define bfd_mach_tic4x 40
2254 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
2255 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
2256 bfd_arch_tic80, /* TI TMS320c80 (MVP). */
2257 bfd_arch_v850, /* NEC V850. */
2258 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
2259#define bfd_mach_v850 1
2260#define bfd_mach_v850e 'E'
2261#define bfd_mach_v850e1 '1'
2262#define bfd_mach_v850e2 0x4532
2263#define bfd_mach_v850e2v3 0x45325633
2264#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
2265 bfd_arch_arc, /* ARC Cores. */
2266#define bfd_mach_arc_a4 0
2267#define bfd_mach_arc_a5 1
2268#define bfd_mach_arc_arc600 2
2269#define bfd_mach_arc_arc601 4
2270#define bfd_mach_arc_arc700 3
2271#define bfd_mach_arc_arcv2 5
2272 bfd_arch_m32c, /* Renesas M16C/M32C. */
2273#define bfd_mach_m16c 0x75
2274#define bfd_mach_m32c 0x78
2275 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
2276#define bfd_mach_m32r 1 /* For backwards compatibility. */
2277#define bfd_mach_m32rx 'x'
2278#define bfd_mach_m32r2 '2'
2279 bfd_arch_mn10200, /* Matsushita MN10200. */
2280 bfd_arch_mn10300, /* Matsushita MN10300. */
2281#define bfd_mach_mn10300 300
2282#define bfd_mach_am33 330
2283#define bfd_mach_am33_2 332
2284 bfd_arch_fr30,
2285#define bfd_mach_fr30 0x46523330
2286 bfd_arch_frv,
2287#define bfd_mach_frv 1
2288#define bfd_mach_frvsimple 2
2289#define bfd_mach_fr300 300
2290#define bfd_mach_fr400 400
2291#define bfd_mach_fr450 450
2292#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
2293#define bfd_mach_fr500 500
2294#define bfd_mach_fr550 550
2295 bfd_arch_moxie, /* The moxie processor. */
2296#define bfd_mach_moxie 1
2297 bfd_arch_ft32, /* The ft32 processor. */
2298#define bfd_mach_ft32 1
2299#define bfd_mach_ft32b 2
2300 bfd_arch_mcore,
2301 bfd_arch_mep,
2302#define bfd_mach_mep 1
2303#define bfd_mach_mep_h1 0x6831
2304#define bfd_mach_mep_c5 0x6335
2305 bfd_arch_metag,
2306#define bfd_mach_metag 1
2307 bfd_arch_ia64, /* HP/Intel ia64. */
2308#define bfd_mach_ia64_elf64 64
2309#define bfd_mach_ia64_elf32 32
2310 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
2311#define bfd_mach_ip2022 1
2312#define bfd_mach_ip2022ext 2
2313 bfd_arch_iq2000, /* Vitesse IQ2000. */
2314#define bfd_mach_iq2000 1
2315#define bfd_mach_iq10 2
2316 bfd_arch_epiphany, /* Adapteva EPIPHANY. */
2317#define bfd_mach_epiphany16 1
2318#define bfd_mach_epiphany32 2
2319 bfd_arch_mt,
2320#define bfd_mach_ms1 1
2321#define bfd_mach_mrisc2 2
2322#define bfd_mach_ms2 3
2323 bfd_arch_pj,
2324 bfd_arch_avr, /* Atmel AVR microcontrollers. */
2325#define bfd_mach_avr1 1
2326#define bfd_mach_avr2 2
2327#define bfd_mach_avr25 25
2328#define bfd_mach_avr3 3
2329#define bfd_mach_avr31 31
2330#define bfd_mach_avr35 35
2331#define bfd_mach_avr4 4
2332#define bfd_mach_avr5 5
2333#define bfd_mach_avr51 51
2334#define bfd_mach_avr6 6
2335#define bfd_mach_avrtiny 100
2336#define bfd_mach_avrxmega1 101
2337#define bfd_mach_avrxmega2 102
2338#define bfd_mach_avrxmega3 103
2339#define bfd_mach_avrxmega4 104
2340#define bfd_mach_avrxmega5 105
2341#define bfd_mach_avrxmega6 106
2342#define bfd_mach_avrxmega7 107
2343 bfd_arch_bfin, /* ADI Blackfin. */
2344#define bfd_mach_bfin 1
2345 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
2346#define bfd_mach_cr16 1
2347 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
2348#define bfd_mach_cr16c 1
2349 bfd_arch_crx, /* National Semiconductor CRX. */
2350#define bfd_mach_crx 1
2351 bfd_arch_cris, /* Axis CRIS. */
2352#define bfd_mach_cris_v0_v10 255
2353#define bfd_mach_cris_v32 32
2354#define bfd_mach_cris_v10_v32 1032
2355 bfd_arch_riscv,
2356#define bfd_mach_riscv32 132
2357#define bfd_mach_riscv64 164
2358 bfd_arch_rl78,
2359#define bfd_mach_rl78 0x75
2360 bfd_arch_rx, /* Renesas RX. */
2361#define bfd_mach_rx 0x75
2362#define bfd_mach_rx_v2 0x76
2363#define bfd_mach_rx_v3 0x77
2364 bfd_arch_s390, /* IBM s390. */
2365#define bfd_mach_s390_31 31
2366#define bfd_mach_s390_64 64
2367 bfd_arch_score, /* Sunplus score. */
2368#define bfd_mach_score3 3
2369#define bfd_mach_score7 7
2370 bfd_arch_mmix, /* Donald Knuth's educational processor. */
2371 bfd_arch_xstormy16,
2372#define bfd_mach_xstormy16 1
2373 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
2374#define bfd_mach_msp11 11
2375#define bfd_mach_msp110 110
2376#define bfd_mach_msp12 12
2377#define bfd_mach_msp13 13
2378#define bfd_mach_msp14 14
2379#define bfd_mach_msp15 15
2380#define bfd_mach_msp16 16
2381#define bfd_mach_msp20 20
2382#define bfd_mach_msp21 21
2383#define bfd_mach_msp22 22
2384#define bfd_mach_msp23 23
2385#define bfd_mach_msp24 24
2386#define bfd_mach_msp26 26
2387#define bfd_mach_msp31 31
2388#define bfd_mach_msp32 32
2389#define bfd_mach_msp33 33
2390#define bfd_mach_msp41 41
2391#define bfd_mach_msp42 42
2392#define bfd_mach_msp43 43
2393#define bfd_mach_msp44 44
2394#define bfd_mach_msp430x 45
2395#define bfd_mach_msp46 46
2396#define bfd_mach_msp47 47
2397#define bfd_mach_msp54 54
2398 bfd_arch_xc16x, /* Infineon's XC16X Series. */
2399#define bfd_mach_xc16x 1
2400#define bfd_mach_xc16xl 2
2401#define bfd_mach_xc16xs 3
2402 bfd_arch_xgate, /* Freescale XGATE. */
2403#define bfd_mach_xgate 1
2404 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
2405#define bfd_mach_xtensa 1
2406 bfd_arch_z80,
2407#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
2408#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
2409#define bfd_mach_z80full 7 /* All undocumented instructions. */
2410#define bfd_mach_r800 11 /* R800: successor with multiplication. */
2411 bfd_arch_lm32, /* Lattice Mico32. */
2412#define bfd_mach_lm32 1
2413 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2414 bfd_arch_tilepro, /* Tilera TILEPro. */
2415 bfd_arch_tilegx, /* Tilera TILE-Gx. */
2416#define bfd_mach_tilepro 1
2417#define bfd_mach_tilegx 1
2418#define bfd_mach_tilegx32 2
2419 bfd_arch_aarch64, /* AArch64. */
2420#define bfd_mach_aarch64 0
2421#define bfd_mach_aarch64_ilp32 32
2422 bfd_arch_nios2, /* Nios II. */
2423#define bfd_mach_nios2 0
2424#define bfd_mach_nios2r1 1
2425#define bfd_mach_nios2r2 2
2426 bfd_arch_visium, /* Visium. */
2427#define bfd_mach_visium 1
2428 bfd_arch_wasm32, /* WebAssembly. */
2429#define bfd_mach_wasm32 1
2430 bfd_arch_pru, /* PRU. */
2431#define bfd_mach_pru 0
2432 bfd_arch_nfp, /* Netronome Flow Processor */
2433#define bfd_mach_nfp3200 0x3200
2434#define bfd_mach_nfp6000 0x6000
2435 bfd_arch_csky, /* C-SKY. */
2436#define bfd_mach_ck_unknown 0
2437#define bfd_mach_ck510 1
2438#define bfd_mach_ck610 2
2439#define bfd_mach_ck801 3
2440#define bfd_mach_ck802 4
2441#define bfd_mach_ck803 5
2442#define bfd_mach_ck807 6
2443#define bfd_mach_ck810 7
2444 bfd_arch_last
2445 };
2446
2447typedef struct bfd_arch_info
2448{
2449 int bits_per_word;
2450 int bits_per_address;
2451 int bits_per_byte;
2452 enum bfd_architecture arch;
2453 unsigned long mach;
2454 const char *arch_name;
2455 const char *printable_name;
2456 unsigned int section_align_power;
2457 /* TRUE if this is the default machine for the architecture.
2458 The default arch should be the first entry for an arch so that
2459 all the entries for that arch can be accessed via <<next>>. */
2460 bfd_boolean the_default;
2461 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
2462 const struct bfd_arch_info *);
2463
2464 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2465
2466 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If
2467 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is
2468 TRUE, the buffer contains code. */
2469 void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2470 bfd_boolean code);
2471
2472 const struct bfd_arch_info *next;
2473}
2474bfd_arch_info_type;
2475
2476const char *bfd_printable_name (bfd *abfd);
2477
2478const bfd_arch_info_type *bfd_scan_arch (const char *string);
2479
2480const char **bfd_arch_list (void);
2481
2482const bfd_arch_info_type *bfd_arch_get_compatible
2483 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2484
2485void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2486
2487bfd_boolean bfd_default_set_arch_mach
2488 (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2489
2490enum bfd_architecture bfd_get_arch (bfd *abfd);
2491
2492unsigned long bfd_get_mach (bfd *abfd);
2493
2494unsigned int bfd_arch_bits_per_byte (bfd *abfd);
2495
2496unsigned int bfd_arch_bits_per_address (bfd *abfd);
2497
2498const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2499
2500const bfd_arch_info_type *bfd_lookup_arch
2501 (enum bfd_architecture arch, unsigned long machine);
2502
2503const char *bfd_printable_arch_mach
2504 (enum bfd_architecture arch, unsigned long machine);
2505
2506unsigned int bfd_octets_per_byte (bfd *abfd);
2507
2508unsigned int bfd_arch_mach_octets_per_byte
2509 (enum bfd_architecture arch, unsigned long machine);
2510
2511/* Extracted from reloc.c. */
2512
2513typedef enum bfd_reloc_status
2514{
2515 /* No errors detected. Note - the value 2 is used so that it
2516 will not be mistaken for the boolean TRUE or FALSE values. */
2517 bfd_reloc_ok = 2,
2518
2519 /* The relocation was performed, but there was an overflow. */
2520 bfd_reloc_overflow,
2521
2522 /* The address to relocate was not within the section supplied. */
2523 bfd_reloc_outofrange,
2524
2525 /* Used by special functions. */
2526 bfd_reloc_continue,
2527
2528 /* Unsupported relocation size requested. */
2529 bfd_reloc_notsupported,
2530
2531 /* Unused. */
2532 bfd_reloc_other,
2533
2534 /* The symbol to relocate against was undefined. */
2535 bfd_reloc_undefined,
2536
2537 /* The relocation was performed, but may not be ok. If this type is
2538 returned, the error_message argument to bfd_perform_relocation
2539 will be set. */
2540 bfd_reloc_dangerous
2541 }
2542 bfd_reloc_status_type;
2543
2544typedef const struct reloc_howto_struct reloc_howto_type;
2545
2546typedef struct reloc_cache_entry
2547{
2548 /* A pointer into the canonical table of pointers. */
2549 struct bfd_symbol **sym_ptr_ptr;
2550
2551 /* offset in section. */
2552 bfd_size_type address;
2553
2554 /* addend for relocation value. */
2555 bfd_vma addend;
2556
2557 /* Pointer to how to perform the required relocation. */
2558 reloc_howto_type *howto;
2559
2560}
2561arelent;
2562
2563
2564enum complain_overflow
2565{
2566 /* Do not complain on overflow. */
2567 complain_overflow_dont,
2568
2569 /* Complain if the value overflows when considered as a signed
2570 number one bit larger than the field. ie. A bitfield of N bits
2571 is allowed to represent -2**n to 2**n-1. */
2572 complain_overflow_bitfield,
2573
2574 /* Complain if the value overflows when considered as a signed
2575 number. */
2576 complain_overflow_signed,
2577
2578 /* Complain if the value overflows when considered as an
2579 unsigned number. */
2580 complain_overflow_unsigned
2581};
2582struct reloc_howto_struct
2583{
2584 /* The type field has mainly a documentary use - the back end can
2585 do what it wants with it, though normally the back end's idea of
2586 an external reloc number is stored in this field. */
2587 unsigned int type;
2588
2589 /* The encoded size of the item to be relocated. This is *not* a
2590 power-of-two measure. Use bfd_get_reloc_size to find the size
2591 of the item in bytes. */
2592 unsigned int size:3;
2593
2594 /* The number of bits in the field to be relocated. This is used
2595 when doing overflow checking. */
2596 unsigned int bitsize:7;
2597
2598 /* The value the final relocation is shifted right by. This drops
2599 unwanted data from the relocation. */
2600 unsigned int rightshift:6;
2601
2602 /* The bit position of the reloc value in the destination.
2603 The relocated value is left shifted by this amount. */
2604 unsigned int bitpos:6;
2605
2606 /* What type of overflow error should be checked for when
2607 relocating. */
2608 ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2609
2610 /* The relocation value should be negated before applying. */
2611 unsigned int negate:1;
2612
2613 /* The relocation is relative to the item being relocated. */
2614 unsigned int pc_relative:1;
2615
2616 /* Some formats record a relocation addend in the section contents
2617 rather than with the relocation. For ELF formats this is the
2618 distinction between USE_REL and USE_RELA (though the code checks
2619 for USE_REL == 1/0). The value of this field is TRUE if the
2620 addend is recorded with the section contents; when performing a
2621 partial link (ld -r) the section contents (the data) will be
2622 modified. The value of this field is FALSE if addends are
2623 recorded with the relocation (in arelent.addend); when performing
2624 a partial link the relocation will be modified.
2625 All relocations for all ELF USE_RELA targets should set this field
2626 to FALSE (values of TRUE should be looked on with suspicion).
2627 However, the converse is not true: not all relocations of all ELF
2628 USE_REL targets set this field to TRUE. Why this is so is peculiar
2629 to each particular target. For relocs that aren't used in partial
2630 links (e.g. GOT stuff) it doesn't matter what this is set to. */
2631 unsigned int partial_inplace:1;
2632
2633 /* When some formats create PC relative instructions, they leave
2634 the value of the pc of the place being relocated in the offset
2635 slot of the instruction, so that a PC relative relocation can
2636 be made just by adding in an ordinary offset (e.g., sun3 a.out).
2637 Some formats leave the displacement part of an instruction
2638 empty (e.g., ELF); this flag signals the fact. */
2639 unsigned int pcrel_offset:1;
2640
2641 /* src_mask selects the part of the instruction (or data) to be used
2642 in the relocation sum. If the target relocations don't have an
2643 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2644 dst_mask to extract the addend from the section contents. If
2645 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2646 field should normally be zero. Non-zero values for ELF USE_RELA
2647 targets should be viewed with suspicion as normally the value in
2648 the dst_mask part of the section contents should be ignored. */
2649 bfd_vma src_mask;
2650
2651 /* dst_mask selects which parts of the instruction (or data) are
2652 replaced with a relocated value. */
2653 bfd_vma dst_mask;
2654
2655 /* If this field is non null, then the supplied function is
2656 called rather than the normal function. This allows really
2657 strange relocation methods to be accommodated. */
2658 bfd_reloc_status_type (*special_function)
2659 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2660 bfd *, char **);
2661
2662 /* The textual name of the relocation type. */
2663 char *name;
2664};
2665
2666#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
2667 inplace, src_mask, dst_mask, pcrel_off) \
2668 { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
2669 size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2670#define EMPTY_HOWTO(C) \
2671 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2672 NULL, FALSE, 0, 0, FALSE)
2673
2674unsigned int bfd_get_reloc_size (reloc_howto_type *);
2675
2676typedef struct relent_chain
2677{
2678 arelent relent;
2679 struct relent_chain *next;
2680}
2681arelent_chain;
2682
2683bfd_reloc_status_type bfd_check_overflow
2684 (enum complain_overflow how,
2685 unsigned int bitsize,
2686 unsigned int rightshift,
2687 unsigned int addrsize,
2688 bfd_vma relocation);
2689
2690bfd_boolean bfd_reloc_offset_in_range
2691 (reloc_howto_type *howto,
2692 bfd *abfd,
2693 asection *section,
2694 bfd_size_type offset);
2695
2696bfd_reloc_status_type bfd_perform_relocation
2697 (bfd *abfd,
2698 arelent *reloc_entry,
2699 void *data,
2700 asection *input_section,
2701 bfd *output_bfd,
2702 char **error_message);
2703
2704bfd_reloc_status_type bfd_install_relocation
2705 (bfd *abfd,
2706 arelent *reloc_entry,
2707 void *data, bfd_vma data_start,
2708 asection *input_section,
2709 char **error_message);
2710
2711enum bfd_reloc_code_real {
2712 _dummy_first_bfd_reloc_code_real,
2713
2714
2715/* Basic absolute relocations of N bits. */
2716 BFD_RELOC_64,
2717 BFD_RELOC_32,
2718 BFD_RELOC_26,
2719 BFD_RELOC_24,
2720 BFD_RELOC_16,
2721 BFD_RELOC_14,
2722 BFD_RELOC_8,
2723
2724/* PC-relative relocations. Sometimes these are relative to the address
2725of the relocation itself; sometimes they are relative to the start of
2726the section containing the relocation. It depends on the specific target. */
2727 BFD_RELOC_64_PCREL,
2728 BFD_RELOC_32_PCREL,
2729 BFD_RELOC_24_PCREL,
2730 BFD_RELOC_16_PCREL,
2731 BFD_RELOC_12_PCREL,
2732 BFD_RELOC_8_PCREL,
2733
2734/* Section relative relocations. Some targets need this for DWARF2. */
2735 BFD_RELOC_32_SECREL,
2736
2737/* For ELF. */
2738 BFD_RELOC_32_GOT_PCREL,
2739 BFD_RELOC_16_GOT_PCREL,
2740 BFD_RELOC_8_GOT_PCREL,
2741 BFD_RELOC_32_GOTOFF,
2742 BFD_RELOC_16_GOTOFF,
2743 BFD_RELOC_LO16_GOTOFF,
2744 BFD_RELOC_HI16_GOTOFF,
2745 BFD_RELOC_HI16_S_GOTOFF,
2746 BFD_RELOC_8_GOTOFF,
2747 BFD_RELOC_64_PLT_PCREL,
2748 BFD_RELOC_32_PLT_PCREL,
2749 BFD_RELOC_24_PLT_PCREL,
2750 BFD_RELOC_16_PLT_PCREL,
2751 BFD_RELOC_8_PLT_PCREL,
2752 BFD_RELOC_64_PLTOFF,
2753 BFD_RELOC_32_PLTOFF,
2754 BFD_RELOC_16_PLTOFF,
2755 BFD_RELOC_LO16_PLTOFF,
2756 BFD_RELOC_HI16_PLTOFF,
2757 BFD_RELOC_HI16_S_PLTOFF,
2758 BFD_RELOC_8_PLTOFF,
2759
2760/* Size relocations. */
2761 BFD_RELOC_SIZE32,
2762 BFD_RELOC_SIZE64,
2763
2764/* Relocations used by 68K ELF. */
2765 BFD_RELOC_68K_GLOB_DAT,
2766 BFD_RELOC_68K_JMP_SLOT,
2767 BFD_RELOC_68K_RELATIVE,
2768 BFD_RELOC_68K_TLS_GD32,
2769 BFD_RELOC_68K_TLS_GD16,
2770 BFD_RELOC_68K_TLS_GD8,
2771 BFD_RELOC_68K_TLS_LDM32,
2772 BFD_RELOC_68K_TLS_LDM16,
2773 BFD_RELOC_68K_TLS_LDM8,
2774 BFD_RELOC_68K_TLS_LDO32,
2775 BFD_RELOC_68K_TLS_LDO16,
2776 BFD_RELOC_68K_TLS_LDO8,
2777 BFD_RELOC_68K_TLS_IE32,
2778 BFD_RELOC_68K_TLS_IE16,
2779 BFD_RELOC_68K_TLS_IE8,
2780 BFD_RELOC_68K_TLS_LE32,
2781 BFD_RELOC_68K_TLS_LE16,
2782 BFD_RELOC_68K_TLS_LE8,
2783
2784/* Linkage-table relative. */
2785 BFD_RELOC_32_BASEREL,
2786 BFD_RELOC_16_BASEREL,
2787 BFD_RELOC_LO16_BASEREL,
2788 BFD_RELOC_HI16_BASEREL,
2789 BFD_RELOC_HI16_S_BASEREL,
2790 BFD_RELOC_8_BASEREL,
2791 BFD_RELOC_RVA,
2792
2793/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
2794 BFD_RELOC_8_FFnn,
2795
2796/* These PC-relative relocations are stored as word displacements --
2797i.e., byte displacements shifted right two bits. The 30-bit word
2798displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2799SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
2800signed 16-bit displacement is used on the MIPS, and the 23-bit
2801displacement is used on the Alpha. */
2802 BFD_RELOC_32_PCREL_S2,
2803 BFD_RELOC_16_PCREL_S2,
2804 BFD_RELOC_23_PCREL_S2,
2805
2806/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2807the target word. These are used on the SPARC. */
2808 BFD_RELOC_HI22,
2809 BFD_RELOC_LO10,
2810
2811/* For systems that allocate a Global Pointer register, these are
2812displacements off that register. These relocation types are
2813handled specially, because the value the register will have is
2814decided relatively late. */
2815 BFD_RELOC_GPREL16,
2816 BFD_RELOC_GPREL32,
2817
2818/* SPARC ELF relocations. There is probably some overlap with other
2819relocation types already defined. */
2820 BFD_RELOC_NONE,
2821 BFD_RELOC_SPARC_WDISP22,
2822 BFD_RELOC_SPARC22,
2823 BFD_RELOC_SPARC13,
2824 BFD_RELOC_SPARC_GOT10,
2825 BFD_RELOC_SPARC_GOT13,
2826 BFD_RELOC_SPARC_GOT22,
2827 BFD_RELOC_SPARC_PC10,
2828 BFD_RELOC_SPARC_PC22,
2829 BFD_RELOC_SPARC_WPLT30,
2830 BFD_RELOC_SPARC_COPY,
2831 BFD_RELOC_SPARC_GLOB_DAT,
2832 BFD_RELOC_SPARC_JMP_SLOT,
2833 BFD_RELOC_SPARC_RELATIVE,
2834 BFD_RELOC_SPARC_UA16,
2835 BFD_RELOC_SPARC_UA32,
2836 BFD_RELOC_SPARC_UA64,
2837 BFD_RELOC_SPARC_GOTDATA_HIX22,
2838 BFD_RELOC_SPARC_GOTDATA_LOX10,
2839 BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2840 BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2841 BFD_RELOC_SPARC_GOTDATA_OP,
2842 BFD_RELOC_SPARC_JMP_IREL,
2843 BFD_RELOC_SPARC_IRELATIVE,
2844
2845/* I think these are specific to SPARC a.out (e.g., Sun 4). */
2846 BFD_RELOC_SPARC_BASE13,
2847 BFD_RELOC_SPARC_BASE22,
2848
2849/* SPARC64 relocations */
2850#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2851 BFD_RELOC_SPARC_10,
2852 BFD_RELOC_SPARC_11,
2853 BFD_RELOC_SPARC_OLO10,
2854 BFD_RELOC_SPARC_HH22,
2855 BFD_RELOC_SPARC_HM10,
2856 BFD_RELOC_SPARC_LM22,
2857 BFD_RELOC_SPARC_PC_HH22,
2858 BFD_RELOC_SPARC_PC_HM10,
2859 BFD_RELOC_SPARC_PC_LM22,
2860 BFD_RELOC_SPARC_WDISP16,
2861 BFD_RELOC_SPARC_WDISP19,
2862 BFD_RELOC_SPARC_7,
2863 BFD_RELOC_SPARC_6,
2864 BFD_RELOC_SPARC_5,
2865#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2866 BFD_RELOC_SPARC_PLT32,
2867 BFD_RELOC_SPARC_PLT64,
2868 BFD_RELOC_SPARC_HIX22,
2869 BFD_RELOC_SPARC_LOX10,
2870 BFD_RELOC_SPARC_H44,
2871 BFD_RELOC_SPARC_M44,
2872 BFD_RELOC_SPARC_L44,
2873 BFD_RELOC_SPARC_REGISTER,
2874 BFD_RELOC_SPARC_H34,
2875 BFD_RELOC_SPARC_SIZE32,
2876 BFD_RELOC_SPARC_SIZE64,
2877 BFD_RELOC_SPARC_WDISP10,
2878
2879/* SPARC little endian relocation */
2880 BFD_RELOC_SPARC_REV32,
2881
2882/* SPARC TLS relocations */
2883 BFD_RELOC_SPARC_TLS_GD_HI22,
2884 BFD_RELOC_SPARC_TLS_GD_LO10,
2885 BFD_RELOC_SPARC_TLS_GD_ADD,
2886 BFD_RELOC_SPARC_TLS_GD_CALL,
2887 BFD_RELOC_SPARC_TLS_LDM_HI22,
2888 BFD_RELOC_SPARC_TLS_LDM_LO10,
2889 BFD_RELOC_SPARC_TLS_LDM_ADD,
2890 BFD_RELOC_SPARC_TLS_LDM_CALL,
2891 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2892 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2893 BFD_RELOC_SPARC_TLS_LDO_ADD,
2894 BFD_RELOC_SPARC_TLS_IE_HI22,
2895 BFD_RELOC_SPARC_TLS_IE_LO10,
2896 BFD_RELOC_SPARC_TLS_IE_LD,
2897 BFD_RELOC_SPARC_TLS_IE_LDX,
2898 BFD_RELOC_SPARC_TLS_IE_ADD,
2899 BFD_RELOC_SPARC_TLS_LE_HIX22,
2900 BFD_RELOC_SPARC_TLS_LE_LOX10,
2901 BFD_RELOC_SPARC_TLS_DTPMOD32,
2902 BFD_RELOC_SPARC_TLS_DTPMOD64,
2903 BFD_RELOC_SPARC_TLS_DTPOFF32,
2904 BFD_RELOC_SPARC_TLS_DTPOFF64,
2905 BFD_RELOC_SPARC_TLS_TPOFF32,
2906 BFD_RELOC_SPARC_TLS_TPOFF64,
2907
2908/* SPU Relocations. */
2909 BFD_RELOC_SPU_IMM7,
2910 BFD_RELOC_SPU_IMM8,
2911 BFD_RELOC_SPU_IMM10,
2912 BFD_RELOC_SPU_IMM10W,
2913 BFD_RELOC_SPU_IMM16,
2914 BFD_RELOC_SPU_IMM16W,
2915 BFD_RELOC_SPU_IMM18,
2916 BFD_RELOC_SPU_PCREL9a,
2917 BFD_RELOC_SPU_PCREL9b,
2918 BFD_RELOC_SPU_PCREL16,
2919 BFD_RELOC_SPU_LO16,
2920 BFD_RELOC_SPU_HI16,
2921 BFD_RELOC_SPU_PPU32,
2922 BFD_RELOC_SPU_PPU64,
2923 BFD_RELOC_SPU_ADD_PIC,
2924
2925/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2926"addend" in some special way.
2927For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2928writing; when reading, it will be the absolute section symbol. The
2929addend is the displacement in bytes of the "lda" instruction from
2930the "ldah" instruction (which is at the address of this reloc). */
2931 BFD_RELOC_ALPHA_GPDISP_HI16,
2932
2933/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2934with GPDISP_HI16 relocs. The addend is ignored when writing the
2935relocations out, and is filled in with the file's GP value on
2936reading, for convenience. */
2937 BFD_RELOC_ALPHA_GPDISP_LO16,
2938
2939/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2940relocation except that there is no accompanying GPDISP_LO16
2941relocation. */
2942 BFD_RELOC_ALPHA_GPDISP,
2943
2944/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2945the assembler turns it into a LDQ instruction to load the address of
2946the symbol, and then fills in a register in the real instruction.
2947
2948The LITERAL reloc, at the LDQ instruction, refers to the .lita
2949section symbol. The addend is ignored when writing, but is filled
2950in with the file's GP value on reading, for convenience, as with the
2951GPDISP_LO16 reloc.
2952
2953The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2954It should refer to the symbol to be referenced, as with 16_GOTOFF,
2955but it generates output not based on the position within the .got
2956section, but relative to the GP value chosen for the file during the
2957final link stage.
2958
2959The LITUSE reloc, on the instruction using the loaded address, gives
2960information to the linker that it might be able to use to optimize
2961away some literal section references. The symbol is ignored (read
2962as the absolute section symbol), and the "addend" indicates the type
2963of instruction using the register:
29641 - "memory" fmt insn
29652 - byte-manipulation (byte offset reg)
29663 - jsr (target of branch) */
2967 BFD_RELOC_ALPHA_LITERAL,
2968 BFD_RELOC_ALPHA_ELF_LITERAL,
2969 BFD_RELOC_ALPHA_LITUSE,
2970
2971/* The HINT relocation indicates a value that should be filled into the
2972"hint" field of a jmp/jsr/ret instruction, for possible branch-
2973prediction logic which may be provided on some processors. */
2974 BFD_RELOC_ALPHA_HINT,
2975
2976/* The LINKAGE relocation outputs a linkage pair in the object file,
2977which is filled by the linker. */
2978 BFD_RELOC_ALPHA_LINKAGE,
2979
2980/* The CODEADDR relocation outputs a STO_CA in the object file,
2981which is filled by the linker. */
2982 BFD_RELOC_ALPHA_CODEADDR,
2983
2984/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2985GP register. */
2986 BFD_RELOC_ALPHA_GPREL_HI16,
2987 BFD_RELOC_ALPHA_GPREL_LO16,
2988
2989/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2990share a common GP, and the target address is adjusted for
2991STO_ALPHA_STD_GPLOAD. */
2992 BFD_RELOC_ALPHA_BRSGP,
2993
2994/* The NOP relocation outputs a NOP if the longword displacement
2995between two procedure entry points is < 2^21. */
2996 BFD_RELOC_ALPHA_NOP,
2997
2998/* The BSR relocation outputs a BSR if the longword displacement
2999between two procedure entry points is < 2^21. */
3000 BFD_RELOC_ALPHA_BSR,
3001
3002/* The LDA relocation outputs a LDA if the longword displacement
3003between two procedure entry points is < 2^16. */
3004 BFD_RELOC_ALPHA_LDA,
3005
3006/* The BOH relocation outputs a BSR if the longword displacement
3007between two procedure entry points is < 2^21, or else a hint. */
3008 BFD_RELOC_ALPHA_BOH,
3009
3010/* Alpha thread-local storage relocations. */
3011 BFD_RELOC_ALPHA_TLSGD,
3012 BFD_RELOC_ALPHA_TLSLDM,
3013 BFD_RELOC_ALPHA_DTPMOD64,
3014 BFD_RELOC_ALPHA_GOTDTPREL16,
3015 BFD_RELOC_ALPHA_DTPREL64,
3016 BFD_RELOC_ALPHA_DTPREL_HI16,
3017 BFD_RELOC_ALPHA_DTPREL_LO16,
3018 BFD_RELOC_ALPHA_DTPREL16,
3019 BFD_RELOC_ALPHA_GOTTPREL16,
3020 BFD_RELOC_ALPHA_TPREL64,
3021 BFD_RELOC_ALPHA_TPREL_HI16,
3022 BFD_RELOC_ALPHA_TPREL_LO16,
3023 BFD_RELOC_ALPHA_TPREL16,
3024
3025/* The MIPS jump instruction. */
3026 BFD_RELOC_MIPS_JMP,
3027 BFD_RELOC_MICROMIPS_JMP,
3028
3029/* The MIPS16 jump instruction. */
3030 BFD_RELOC_MIPS16_JMP,
3031
3032/* MIPS16 GP relative reloc. */
3033 BFD_RELOC_MIPS16_GPREL,
3034
3035/* High 16 bits of 32-bit value; simple reloc. */
3036 BFD_RELOC_HI16,
3037
3038/* High 16 bits of 32-bit value but the low 16 bits will be sign
3039extended and added to form the final result. If the low 16
3040bits form a negative number, we need to add one to the high value
3041to compensate for the borrow when the low bits are added. */
3042 BFD_RELOC_HI16_S,
3043
3044/* Low 16 bits. */
3045 BFD_RELOC_LO16,
3046
3047/* High 16 bits of 32-bit pc-relative value */
3048 BFD_RELOC_HI16_PCREL,
3049
3050/* High 16 bits of 32-bit pc-relative value, adjusted */
3051 BFD_RELOC_HI16_S_PCREL,
3052
3053/* Low 16 bits of pc-relative value */
3054 BFD_RELOC_LO16_PCREL,
3055
3056/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
305716-bit immediate fields */
3058 BFD_RELOC_MIPS16_GOT16,
3059 BFD_RELOC_MIPS16_CALL16,
3060
3061/* MIPS16 high 16 bits of 32-bit value. */
3062 BFD_RELOC_MIPS16_HI16,
3063
3064/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
3065extended and added to form the final result. If the low 16
3066bits form a negative number, we need to add one to the high value
3067to compensate for the borrow when the low bits are added. */
3068 BFD_RELOC_MIPS16_HI16_S,
3069
3070/* MIPS16 low 16 bits. */
3071 BFD_RELOC_MIPS16_LO16,
3072
3073/* MIPS16 TLS relocations */
3074 BFD_RELOC_MIPS16_TLS_GD,
3075 BFD_RELOC_MIPS16_TLS_LDM,
3076 BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
3077 BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
3078 BFD_RELOC_MIPS16_TLS_GOTTPREL,
3079 BFD_RELOC_MIPS16_TLS_TPREL_HI16,
3080 BFD_RELOC_MIPS16_TLS_TPREL_LO16,
3081
3082/* Relocation against a MIPS literal section. */
3083 BFD_RELOC_MIPS_LITERAL,
3084 BFD_RELOC_MICROMIPS_LITERAL,
3085
3086/* microMIPS PC-relative relocations. */
3087 BFD_RELOC_MICROMIPS_7_PCREL_S1,
3088 BFD_RELOC_MICROMIPS_10_PCREL_S1,
3089 BFD_RELOC_MICROMIPS_16_PCREL_S1,
3090
3091/* MIPS16 PC-relative relocation. */
3092 BFD_RELOC_MIPS16_16_PCREL_S1,
3093
3094/* MIPS PC-relative relocations. */
3095 BFD_RELOC_MIPS_21_PCREL_S2,
3096 BFD_RELOC_MIPS_26_PCREL_S2,
3097 BFD_RELOC_MIPS_18_PCREL_S3,
3098 BFD_RELOC_MIPS_19_PCREL_S2,
3099
3100/* microMIPS versions of generic BFD relocs. */
3101 BFD_RELOC_MICROMIPS_GPREL16,
3102 BFD_RELOC_MICROMIPS_HI16,
3103 BFD_RELOC_MICROMIPS_HI16_S,
3104 BFD_RELOC_MICROMIPS_LO16,
3105
3106/* MIPS ELF relocations. */
3107 BFD_RELOC_MIPS_GOT16,
3108 BFD_RELOC_MICROMIPS_GOT16,
3109 BFD_RELOC_MIPS_CALL16,
3110 BFD_RELOC_MICROMIPS_CALL16,
3111 BFD_RELOC_MIPS_GOT_HI16,
3112 BFD_RELOC_MICROMIPS_GOT_HI16,
3113 BFD_RELOC_MIPS_GOT_LO16,
3114 BFD_RELOC_MICROMIPS_GOT_LO16,
3115 BFD_RELOC_MIPS_CALL_HI16,
3116 BFD_RELOC_MICROMIPS_CALL_HI16,
3117 BFD_RELOC_MIPS_CALL_LO16,
3118 BFD_RELOC_MICROMIPS_CALL_LO16,
3119 BFD_RELOC_MIPS_SUB,
3120 BFD_RELOC_MICROMIPS_SUB,
3121 BFD_RELOC_MIPS_GOT_PAGE,
3122 BFD_RELOC_MICROMIPS_GOT_PAGE,
3123 BFD_RELOC_MIPS_GOT_OFST,
3124 BFD_RELOC_MICROMIPS_GOT_OFST,
3125 BFD_RELOC_MIPS_GOT_DISP,
3126 BFD_RELOC_MICROMIPS_GOT_DISP,
3127 BFD_RELOC_MIPS_SHIFT5,
3128 BFD_RELOC_MIPS_SHIFT6,
3129 BFD_RELOC_MIPS_INSERT_A,
3130 BFD_RELOC_MIPS_INSERT_B,
3131 BFD_RELOC_MIPS_DELETE,
3132 BFD_RELOC_MIPS_HIGHEST,
3133 BFD_RELOC_MICROMIPS_HIGHEST,
3134 BFD_RELOC_MIPS_HIGHER,
3135 BFD_RELOC_MICROMIPS_HIGHER,
3136 BFD_RELOC_MIPS_SCN_DISP,
3137 BFD_RELOC_MICROMIPS_SCN_DISP,
3138 BFD_RELOC_MIPS_REL16,
3139 BFD_RELOC_MIPS_RELGOT,
3140 BFD_RELOC_MIPS_JALR,
3141 BFD_RELOC_MICROMIPS_JALR,
3142 BFD_RELOC_MIPS_TLS_DTPMOD32,
3143 BFD_RELOC_MIPS_TLS_DTPREL32,
3144 BFD_RELOC_MIPS_TLS_DTPMOD64,
3145 BFD_RELOC_MIPS_TLS_DTPREL64,
3146 BFD_RELOC_MIPS_TLS_GD,
3147 BFD_RELOC_MICROMIPS_TLS_GD,
3148 BFD_RELOC_MIPS_TLS_LDM,
3149 BFD_RELOC_MICROMIPS_TLS_LDM,
3150 BFD_RELOC_MIPS_TLS_DTPREL_HI16,
3151 BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
3152 BFD_RELOC_MIPS_TLS_DTPREL_LO16,
3153 BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
3154 BFD_RELOC_MIPS_TLS_GOTTPREL,
3155 BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
3156 BFD_RELOC_MIPS_TLS_TPREL32,
3157 BFD_RELOC_MIPS_TLS_TPREL64,
3158 BFD_RELOC_MIPS_TLS_TPREL_HI16,
3159 BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
3160 BFD_RELOC_MIPS_TLS_TPREL_LO16,
3161 BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
3162 BFD_RELOC_MIPS_EH,
3163
3164
3165/* MIPS ELF relocations (VxWorks and PLT extensions). */
3166 BFD_RELOC_MIPS_COPY,
3167 BFD_RELOC_MIPS_JUMP_SLOT,
3168
3169
3170/* Moxie ELF relocations. */
3171 BFD_RELOC_MOXIE_10_PCREL,
3172
3173
3174/* FT32 ELF relocations. */
3175 BFD_RELOC_FT32_10,
3176 BFD_RELOC_FT32_20,
3177 BFD_RELOC_FT32_17,
3178 BFD_RELOC_FT32_18,
3179 BFD_RELOC_FT32_RELAX,
3180 BFD_RELOC_FT32_SC0,
3181 BFD_RELOC_FT32_SC1,
3182 BFD_RELOC_FT32_15,
3183 BFD_RELOC_FT32_DIFF32,
3184
3185
3186/* Fujitsu Frv Relocations. */
3187 BFD_RELOC_FRV_LABEL16,
3188 BFD_RELOC_FRV_LABEL24,
3189 BFD_RELOC_FRV_LO16,
3190 BFD_RELOC_FRV_HI16,
3191 BFD_RELOC_FRV_GPREL12,
3192 BFD_RELOC_FRV_GPRELU12,
3193 BFD_RELOC_FRV_GPREL32,
3194 BFD_RELOC_FRV_GPRELHI,
3195 BFD_RELOC_FRV_GPRELLO,
3196 BFD_RELOC_FRV_GOT12,
3197 BFD_RELOC_FRV_GOTHI,
3198 BFD_RELOC_FRV_GOTLO,
3199 BFD_RELOC_FRV_FUNCDESC,
3200 BFD_RELOC_FRV_FUNCDESC_GOT12,
3201 BFD_RELOC_FRV_FUNCDESC_GOTHI,
3202 BFD_RELOC_FRV_FUNCDESC_GOTLO,
3203 BFD_RELOC_FRV_FUNCDESC_VALUE,
3204 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
3205 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
3206 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
3207 BFD_RELOC_FRV_GOTOFF12,
3208 BFD_RELOC_FRV_GOTOFFHI,
3209 BFD_RELOC_FRV_GOTOFFLO,
3210 BFD_RELOC_FRV_GETTLSOFF,
3211 BFD_RELOC_FRV_TLSDESC_VALUE,
3212 BFD_RELOC_FRV_GOTTLSDESC12,
3213 BFD_RELOC_FRV_GOTTLSDESCHI,
3214 BFD_RELOC_FRV_GOTTLSDESCLO,
3215 BFD_RELOC_FRV_TLSMOFF12,
3216 BFD_RELOC_FRV_TLSMOFFHI,
3217 BFD_RELOC_FRV_TLSMOFFLO,
3218 BFD_RELOC_FRV_GOTTLSOFF12,
3219 BFD_RELOC_FRV_GOTTLSOFFHI,
3220 BFD_RELOC_FRV_GOTTLSOFFLO,
3221 BFD_RELOC_FRV_TLSOFF,
3222 BFD_RELOC_FRV_TLSDESC_RELAX,
3223 BFD_RELOC_FRV_GETTLSOFF_RELAX,
3224 BFD_RELOC_FRV_TLSOFF_RELAX,
3225 BFD_RELOC_FRV_TLSMOFF,
3226
3227
3228/* This is a 24bit GOT-relative reloc for the mn10300. */
3229 BFD_RELOC_MN10300_GOTOFF24,
3230
3231/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
3232in the instruction. */
3233 BFD_RELOC_MN10300_GOT32,
3234
3235/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
3236in the instruction. */
3237 BFD_RELOC_MN10300_GOT24,
3238
3239/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
3240in the instruction. */
3241 BFD_RELOC_MN10300_GOT16,
3242
3243/* Copy symbol at runtime. */
3244 BFD_RELOC_MN10300_COPY,
3245
3246/* Create GOT entry. */
3247 BFD_RELOC_MN10300_GLOB_DAT,
3248
3249/* Create PLT entry. */
3250 BFD_RELOC_MN10300_JMP_SLOT,
3251
3252/* Adjust by program base. */
3253 BFD_RELOC_MN10300_RELATIVE,
3254
3255/* Together with another reloc targeted at the same location,
3256allows for a value that is the difference of two symbols
3257in the same section. */
3258 BFD_RELOC_MN10300_SYM_DIFF,
3259
3260/* The addend of this reloc is an alignment power that must
3261be honoured at the offset's location, regardless of linker
3262relaxation. */
3263 BFD_RELOC_MN10300_ALIGN,
3264
3265/* Various TLS-related relocations. */
3266 BFD_RELOC_MN10300_TLS_GD,
3267 BFD_RELOC_MN10300_TLS_LD,
3268 BFD_RELOC_MN10300_TLS_LDO,
3269 BFD_RELOC_MN10300_TLS_GOTIE,
3270 BFD_RELOC_MN10300_TLS_IE,
3271 BFD_RELOC_MN10300_TLS_LE,
3272 BFD_RELOC_MN10300_TLS_DTPMOD,
3273 BFD_RELOC_MN10300_TLS_DTPOFF,
3274 BFD_RELOC_MN10300_TLS_TPOFF,
3275
3276/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3277instruction. */
3278 BFD_RELOC_MN10300_32_PCREL,
3279
3280/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3281instruction. */
3282 BFD_RELOC_MN10300_16_PCREL,
3283
3284
3285/* i386/elf relocations */
3286 BFD_RELOC_386_GOT32,
3287 BFD_RELOC_386_PLT32,
3288 BFD_RELOC_386_COPY,
3289 BFD_RELOC_386_GLOB_DAT,
3290 BFD_RELOC_386_JUMP_SLOT,
3291 BFD_RELOC_386_RELATIVE,
3292 BFD_RELOC_386_GOTOFF,
3293 BFD_RELOC_386_GOTPC,
3294 BFD_RELOC_386_TLS_TPOFF,
3295 BFD_RELOC_386_TLS_IE,
3296 BFD_RELOC_386_TLS_GOTIE,
3297 BFD_RELOC_386_TLS_LE,
3298 BFD_RELOC_386_TLS_GD,
3299 BFD_RELOC_386_TLS_LDM,
3300 BFD_RELOC_386_TLS_LDO_32,
3301 BFD_RELOC_386_TLS_IE_32,
3302 BFD_RELOC_386_TLS_LE_32,
3303 BFD_RELOC_386_TLS_DTPMOD32,
3304 BFD_RELOC_386_TLS_DTPOFF32,
3305 BFD_RELOC_386_TLS_TPOFF32,
3306 BFD_RELOC_386_TLS_GOTDESC,
3307 BFD_RELOC_386_TLS_DESC_CALL,
3308 BFD_RELOC_386_TLS_DESC,
3309 BFD_RELOC_386_IRELATIVE,
3310 BFD_RELOC_386_GOT32X,
3311
3312/* x86-64/elf relocations */
3313 BFD_RELOC_X86_64_GOT32,
3314 BFD_RELOC_X86_64_PLT32,
3315 BFD_RELOC_X86_64_COPY,
3316 BFD_RELOC_X86_64_GLOB_DAT,
3317 BFD_RELOC_X86_64_JUMP_SLOT,
3318 BFD_RELOC_X86_64_RELATIVE,
3319 BFD_RELOC_X86_64_GOTPCREL,
3320 BFD_RELOC_X86_64_32S,
3321 BFD_RELOC_X86_64_DTPMOD64,
3322 BFD_RELOC_X86_64_DTPOFF64,
3323 BFD_RELOC_X86_64_TPOFF64,
3324 BFD_RELOC_X86_64_TLSGD,
3325 BFD_RELOC_X86_64_TLSLD,
3326 BFD_RELOC_X86_64_DTPOFF32,
3327 BFD_RELOC_X86_64_GOTTPOFF,
3328 BFD_RELOC_X86_64_TPOFF32,
3329 BFD_RELOC_X86_64_GOTOFF64,
3330 BFD_RELOC_X86_64_GOTPC32,
3331 BFD_RELOC_X86_64_GOT64,
3332 BFD_RELOC_X86_64_GOTPCREL64,
3333 BFD_RELOC_X86_64_GOTPC64,
3334 BFD_RELOC_X86_64_GOTPLT64,
3335 BFD_RELOC_X86_64_PLTOFF64,
3336 BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3337 BFD_RELOC_X86_64_TLSDESC_CALL,
3338 BFD_RELOC_X86_64_TLSDESC,
3339 BFD_RELOC_X86_64_IRELATIVE,
3340 BFD_RELOC_X86_64_PC32_BND,
3341 BFD_RELOC_X86_64_PLT32_BND,
3342 BFD_RELOC_X86_64_GOTPCRELX,
3343 BFD_RELOC_X86_64_REX_GOTPCRELX,
3344
3345/* ns32k relocations */
3346 BFD_RELOC_NS32K_IMM_8,
3347 BFD_RELOC_NS32K_IMM_16,
3348 BFD_RELOC_NS32K_IMM_32,
3349 BFD_RELOC_NS32K_IMM_8_PCREL,
3350 BFD_RELOC_NS32K_IMM_16_PCREL,
3351 BFD_RELOC_NS32K_IMM_32_PCREL,
3352 BFD_RELOC_NS32K_DISP_8,
3353 BFD_RELOC_NS32K_DISP_16,
3354 BFD_RELOC_NS32K_DISP_32,
3355 BFD_RELOC_NS32K_DISP_8_PCREL,
3356 BFD_RELOC_NS32K_DISP_16_PCREL,
3357 BFD_RELOC_NS32K_DISP_32_PCREL,
3358
3359/* PDP11 relocations */
3360 BFD_RELOC_PDP11_DISP_8_PCREL,
3361 BFD_RELOC_PDP11_DISP_6_PCREL,
3362
3363/* Picojava relocs. Not all of these appear in object files. */
3364 BFD_RELOC_PJ_CODE_HI16,
3365 BFD_RELOC_PJ_CODE_LO16,
3366 BFD_RELOC_PJ_CODE_DIR16,
3367 BFD_RELOC_PJ_CODE_DIR32,
3368 BFD_RELOC_PJ_CODE_REL16,
3369 BFD_RELOC_PJ_CODE_REL32,
3370
3371/* Power(rs6000) and PowerPC relocations. */
3372 BFD_RELOC_PPC_B26,
3373 BFD_RELOC_PPC_BA26,
3374 BFD_RELOC_PPC_TOC16,
3375 BFD_RELOC_PPC_B16,
3376 BFD_RELOC_PPC_B16_BRTAKEN,
3377 BFD_RELOC_PPC_B16_BRNTAKEN,
3378 BFD_RELOC_PPC_BA16,
3379 BFD_RELOC_PPC_BA16_BRTAKEN,
3380 BFD_RELOC_PPC_BA16_BRNTAKEN,
3381 BFD_RELOC_PPC_COPY,
3382 BFD_RELOC_PPC_GLOB_DAT,
3383 BFD_RELOC_PPC_JMP_SLOT,
3384 BFD_RELOC_PPC_RELATIVE,
3385 BFD_RELOC_PPC_LOCAL24PC,
3386 BFD_RELOC_PPC_EMB_NADDR32,
3387 BFD_RELOC_PPC_EMB_NADDR16,
3388 BFD_RELOC_PPC_EMB_NADDR16_LO,
3389 BFD_RELOC_PPC_EMB_NADDR16_HI,
3390 BFD_RELOC_PPC_EMB_NADDR16_HA,
3391 BFD_RELOC_PPC_EMB_SDAI16,
3392 BFD_RELOC_PPC_EMB_SDA2I16,
3393 BFD_RELOC_PPC_EMB_SDA2REL,
3394 BFD_RELOC_PPC_EMB_SDA21,
3395 BFD_RELOC_PPC_EMB_MRKREF,
3396 BFD_RELOC_PPC_EMB_RELSEC16,
3397 BFD_RELOC_PPC_EMB_RELST_LO,
3398 BFD_RELOC_PPC_EMB_RELST_HI,
3399 BFD_RELOC_PPC_EMB_RELST_HA,
3400 BFD_RELOC_PPC_EMB_BIT_FLD,
3401 BFD_RELOC_PPC_EMB_RELSDA,
3402 BFD_RELOC_PPC_VLE_REL8,
3403 BFD_RELOC_PPC_VLE_REL15,
3404 BFD_RELOC_PPC_VLE_REL24,
3405 BFD_RELOC_PPC_VLE_LO16A,
3406 BFD_RELOC_PPC_VLE_LO16D,
3407 BFD_RELOC_PPC_VLE_HI16A,
3408 BFD_RELOC_PPC_VLE_HI16D,
3409 BFD_RELOC_PPC_VLE_HA16A,
3410 BFD_RELOC_PPC_VLE_HA16D,
3411 BFD_RELOC_PPC_VLE_SDA21,
3412 BFD_RELOC_PPC_VLE_SDA21_LO,
3413 BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3414 BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3415 BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3416 BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3417 BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3418 BFD_RELOC_PPC_VLE_SDAREL_HA16D,
3419 BFD_RELOC_PPC_16DX_HA,
3420 BFD_RELOC_PPC_REL16DX_HA,
3421 BFD_RELOC_PPC64_HIGHER,
3422 BFD_RELOC_PPC64_HIGHER_S,
3423 BFD_RELOC_PPC64_HIGHEST,
3424 BFD_RELOC_PPC64_HIGHEST_S,
3425 BFD_RELOC_PPC64_TOC16_LO,
3426 BFD_RELOC_PPC64_TOC16_HI,
3427 BFD_RELOC_PPC64_TOC16_HA,
3428 BFD_RELOC_PPC64_TOC,
3429 BFD_RELOC_PPC64_PLTGOT16,
3430 BFD_RELOC_PPC64_PLTGOT16_LO,
3431 BFD_RELOC_PPC64_PLTGOT16_HI,
3432 BFD_RELOC_PPC64_PLTGOT16_HA,
3433 BFD_RELOC_PPC64_ADDR16_DS,
3434 BFD_RELOC_PPC64_ADDR16_LO_DS,
3435 BFD_RELOC_PPC64_GOT16_DS,
3436 BFD_RELOC_PPC64_GOT16_LO_DS,
3437 BFD_RELOC_PPC64_PLT16_LO_DS,
3438 BFD_RELOC_PPC64_SECTOFF_DS,
3439 BFD_RELOC_PPC64_SECTOFF_LO_DS,
3440 BFD_RELOC_PPC64_TOC16_DS,
3441 BFD_RELOC_PPC64_TOC16_LO_DS,
3442 BFD_RELOC_PPC64_PLTGOT16_DS,
3443 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
3444 BFD_RELOC_PPC64_ADDR16_HIGH,
3445 BFD_RELOC_PPC64_ADDR16_HIGHA,
3446 BFD_RELOC_PPC64_REL16_HIGH,
3447 BFD_RELOC_PPC64_REL16_HIGHA,
3448 BFD_RELOC_PPC64_REL16_HIGHER,
3449 BFD_RELOC_PPC64_REL16_HIGHERA,
3450 BFD_RELOC_PPC64_REL16_HIGHEST,
3451 BFD_RELOC_PPC64_REL16_HIGHESTA,
3452 BFD_RELOC_PPC64_ADDR64_LOCAL,
3453 BFD_RELOC_PPC64_ENTRY,
3454 BFD_RELOC_PPC64_REL24_NOTOC,
3455
3456/* PowerPC and PowerPC64 thread-local storage relocations. */
3457 BFD_RELOC_PPC_TLS,
3458 BFD_RELOC_PPC_TLSGD,
3459 BFD_RELOC_PPC_TLSLD,
3460 BFD_RELOC_PPC_DTPMOD,
3461 BFD_RELOC_PPC_TPREL16,
3462 BFD_RELOC_PPC_TPREL16_LO,
3463 BFD_RELOC_PPC_TPREL16_HI,
3464 BFD_RELOC_PPC_TPREL16_HA,
3465 BFD_RELOC_PPC_TPREL,
3466 BFD_RELOC_PPC_DTPREL16,
3467 BFD_RELOC_PPC_DTPREL16_LO,
3468 BFD_RELOC_PPC_DTPREL16_HI,
3469 BFD_RELOC_PPC_DTPREL16_HA,
3470 BFD_RELOC_PPC_DTPREL,
3471 BFD_RELOC_PPC_GOT_TLSGD16,
3472 BFD_RELOC_PPC_GOT_TLSGD16_LO,
3473 BFD_RELOC_PPC_GOT_TLSGD16_HI,
3474 BFD_RELOC_PPC_GOT_TLSGD16_HA,
3475 BFD_RELOC_PPC_GOT_TLSLD16,
3476 BFD_RELOC_PPC_GOT_TLSLD16_LO,
3477 BFD_RELOC_PPC_GOT_TLSLD16_HI,
3478 BFD_RELOC_PPC_GOT_TLSLD16_HA,
3479 BFD_RELOC_PPC_GOT_TPREL16,
3480 BFD_RELOC_PPC_GOT_TPREL16_LO,
3481 BFD_RELOC_PPC_GOT_TPREL16_HI,
3482 BFD_RELOC_PPC_GOT_TPREL16_HA,
3483 BFD_RELOC_PPC_GOT_DTPREL16,
3484 BFD_RELOC_PPC_GOT_DTPREL16_LO,
3485 BFD_RELOC_PPC_GOT_DTPREL16_HI,
3486 BFD_RELOC_PPC_GOT_DTPREL16_HA,
3487 BFD_RELOC_PPC64_TPREL16_DS,
3488 BFD_RELOC_PPC64_TPREL16_LO_DS,
3489 BFD_RELOC_PPC64_TPREL16_HIGHER,
3490 BFD_RELOC_PPC64_TPREL16_HIGHERA,
3491 BFD_RELOC_PPC64_TPREL16_HIGHEST,
3492 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3493 BFD_RELOC_PPC64_DTPREL16_DS,
3494 BFD_RELOC_PPC64_DTPREL16_LO_DS,
3495 BFD_RELOC_PPC64_DTPREL16_HIGHER,
3496 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3497 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3498 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3499 BFD_RELOC_PPC64_TPREL16_HIGH,
3500 BFD_RELOC_PPC64_TPREL16_HIGHA,
3501 BFD_RELOC_PPC64_DTPREL16_HIGH,
3502 BFD_RELOC_PPC64_DTPREL16_HIGHA,
3503
3504/* IBM 370/390 relocations */
3505 BFD_RELOC_I370_D12,
3506
3507/* The type of reloc used to build a constructor table - at the moment
3508probably a 32 bit wide absolute relocation, but the target can choose.
3509It generally does map to one of the other relocation types. */
3510 BFD_RELOC_CTOR,
3511
3512/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
3513not stored in the instruction. */
3514 BFD_RELOC_ARM_PCREL_BRANCH,
3515
3516/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
3517not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3518field in the instruction. */
3519 BFD_RELOC_ARM_PCREL_BLX,
3520
3521/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
3522not stored in the instruction. The 2nd lowest bit comes from a 1 bit
3523field in the instruction. */
3524 BFD_RELOC_THUMB_PCREL_BLX,
3525
3526/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */
3527 BFD_RELOC_ARM_PCREL_CALL,
3528
3529/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
3530 BFD_RELOC_ARM_PCREL_JUMP,
3531
3532/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3533The lowest bit must be zero and is not stored in the instruction.
3534Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3535"nn" one smaller in all cases. Note further that BRANCH23
3536corresponds to R_ARM_THM_CALL. */
3537 BFD_RELOC_THUMB_PCREL_BRANCH7,
3538 BFD_RELOC_THUMB_PCREL_BRANCH9,
3539 BFD_RELOC_THUMB_PCREL_BRANCH12,
3540 BFD_RELOC_THUMB_PCREL_BRANCH20,
3541 BFD_RELOC_THUMB_PCREL_BRANCH23,
3542 BFD_RELOC_THUMB_PCREL_BRANCH25,
3543
3544/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */
3545 BFD_RELOC_ARM_OFFSET_IMM,
3546
3547/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */
3548 BFD_RELOC_ARM_THUMB_OFFSET,
3549
3550/* Pc-relative or absolute relocation depending on target. Used for
3551entries in .init_array sections. */
3552 BFD_RELOC_ARM_TARGET1,
3553
3554/* Read-only segment base relative address. */
3555 BFD_RELOC_ARM_ROSEGREL32,
3556
3557/* Data segment base relative address. */
3558 BFD_RELOC_ARM_SBREL32,
3559
3560/* This reloc is used for references to RTTI data from exception handling
3561tables. The actual definition depends on the target. It may be a
3562pc-relative or some form of GOT-indirect relocation. */
3563 BFD_RELOC_ARM_TARGET2,
3564
3565/* 31-bit PC relative address. */
3566 BFD_RELOC_ARM_PREL31,
3567
3568/* Low and High halfword relocations for MOVW and MOVT instructions. */
3569 BFD_RELOC_ARM_MOVW,
3570 BFD_RELOC_ARM_MOVT,
3571 BFD_RELOC_ARM_MOVW_PCREL,
3572 BFD_RELOC_ARM_MOVT_PCREL,
3573 BFD_RELOC_ARM_THUMB_MOVW,
3574 BFD_RELOC_ARM_THUMB_MOVT,
3575 BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3576 BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3577
3578/* ARM FDPIC specific relocations. */
3579 BFD_RELOC_ARM_GOTFUNCDESC,
3580 BFD_RELOC_ARM_GOTOFFFUNCDESC,
3581 BFD_RELOC_ARM_FUNCDESC,
3582 BFD_RELOC_ARM_FUNCDESC_VALUE,
3583 BFD_RELOC_ARM_TLS_GD32_FDPIC,
3584 BFD_RELOC_ARM_TLS_LDM32_FDPIC,
3585 BFD_RELOC_ARM_TLS_IE32_FDPIC,
3586
3587/* Relocations for setting up GOTs and PLTs for shared libraries. */
3588 BFD_RELOC_ARM_JUMP_SLOT,
3589 BFD_RELOC_ARM_GLOB_DAT,
3590 BFD_RELOC_ARM_GOT32,
3591 BFD_RELOC_ARM_PLT32,
3592 BFD_RELOC_ARM_RELATIVE,
3593 BFD_RELOC_ARM_GOTOFF,
3594 BFD_RELOC_ARM_GOTPC,
3595 BFD_RELOC_ARM_GOT_PREL,
3596
3597/* ARM thread-local storage relocations. */
3598 BFD_RELOC_ARM_TLS_GD32,
3599 BFD_RELOC_ARM_TLS_LDO32,
3600 BFD_RELOC_ARM_TLS_LDM32,
3601 BFD_RELOC_ARM_TLS_DTPOFF32,
3602 BFD_RELOC_ARM_TLS_DTPMOD32,
3603 BFD_RELOC_ARM_TLS_TPOFF32,
3604 BFD_RELOC_ARM_TLS_IE32,
3605 BFD_RELOC_ARM_TLS_LE32,
3606 BFD_RELOC_ARM_TLS_GOTDESC,
3607 BFD_RELOC_ARM_TLS_CALL,
3608 BFD_RELOC_ARM_THM_TLS_CALL,
3609 BFD_RELOC_ARM_TLS_DESCSEQ,
3610 BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3611 BFD_RELOC_ARM_TLS_DESC,
3612
3613/* ARM group relocations. */
3614 BFD_RELOC_ARM_ALU_PC_G0_NC,
3615 BFD_RELOC_ARM_ALU_PC_G0,
3616 BFD_RELOC_ARM_ALU_PC_G1_NC,
3617 BFD_RELOC_ARM_ALU_PC_G1,
3618 BFD_RELOC_ARM_ALU_PC_G2,
3619 BFD_RELOC_ARM_LDR_PC_G0,
3620 BFD_RELOC_ARM_LDR_PC_G1,
3621 BFD_RELOC_ARM_LDR_PC_G2,
3622 BFD_RELOC_ARM_LDRS_PC_G0,
3623 BFD_RELOC_ARM_LDRS_PC_G1,
3624 BFD_RELOC_ARM_LDRS_PC_G2,
3625 BFD_RELOC_ARM_LDC_PC_G0,
3626 BFD_RELOC_ARM_LDC_PC_G1,
3627 BFD_RELOC_ARM_LDC_PC_G2,
3628 BFD_RELOC_ARM_ALU_SB_G0_NC,
3629 BFD_RELOC_ARM_ALU_SB_G0,
3630 BFD_RELOC_ARM_ALU_SB_G1_NC,
3631 BFD_RELOC_ARM_ALU_SB_G1,
3632 BFD_RELOC_ARM_ALU_SB_G2,
3633 BFD_RELOC_ARM_LDR_SB_G0,
3634 BFD_RELOC_ARM_LDR_SB_G1,
3635 BFD_RELOC_ARM_LDR_SB_G2,
3636 BFD_RELOC_ARM_LDRS_SB_G0,
3637 BFD_RELOC_ARM_LDRS_SB_G1,
3638 BFD_RELOC_ARM_LDRS_SB_G2,
3639 BFD_RELOC_ARM_LDC_SB_G0,
3640 BFD_RELOC_ARM_LDC_SB_G1,
3641 BFD_RELOC_ARM_LDC_SB_G2,
3642
3643/* Annotation of BX instructions. */
3644 BFD_RELOC_ARM_V4BX,
3645
3646/* ARM support for STT_GNU_IFUNC. */
3647 BFD_RELOC_ARM_IRELATIVE,
3648
3649/* Thumb1 relocations to support execute-only code. */
3650 BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3651 BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3652 BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3653 BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3654
3655/* These relocs are only used within the ARM assembler. They are not
3656(at present) written to any object files. */
3657 BFD_RELOC_ARM_IMMEDIATE,
3658 BFD_RELOC_ARM_ADRL_IMMEDIATE,
3659 BFD_RELOC_ARM_T32_IMMEDIATE,
3660 BFD_RELOC_ARM_T32_ADD_IMM,
3661 BFD_RELOC_ARM_T32_IMM12,
3662 BFD_RELOC_ARM_T32_ADD_PC12,
3663 BFD_RELOC_ARM_SHIFT_IMM,
3664 BFD_RELOC_ARM_SMC,
3665 BFD_RELOC_ARM_HVC,
3666 BFD_RELOC_ARM_SWI,
3667 BFD_RELOC_ARM_MULTI,
3668 BFD_RELOC_ARM_CP_OFF_IMM,
3669 BFD_RELOC_ARM_CP_OFF_IMM_S2,
3670 BFD_RELOC_ARM_T32_CP_OFF_IMM,
3671 BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3672 BFD_RELOC_ARM_ADR_IMM,
3673 BFD_RELOC_ARM_LDR_IMM,
3674 BFD_RELOC_ARM_LITERAL,
3675 BFD_RELOC_ARM_IN_POOL,
3676 BFD_RELOC_ARM_OFFSET_IMM8,
3677 BFD_RELOC_ARM_T32_OFFSET_U8,
3678 BFD_RELOC_ARM_T32_OFFSET_IMM,
3679 BFD_RELOC_ARM_HWLITERAL,
3680 BFD_RELOC_ARM_THUMB_ADD,
3681 BFD_RELOC_ARM_THUMB_IMM,
3682 BFD_RELOC_ARM_THUMB_SHIFT,
3683
3684/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
3685 BFD_RELOC_SH_PCDISP8BY2,
3686 BFD_RELOC_SH_PCDISP12BY2,
3687 BFD_RELOC_SH_IMM3,
3688 BFD_RELOC_SH_IMM3U,
3689 BFD_RELOC_SH_DISP12,
3690 BFD_RELOC_SH_DISP12BY2,
3691 BFD_RELOC_SH_DISP12BY4,
3692 BFD_RELOC_SH_DISP12BY8,
3693 BFD_RELOC_SH_DISP20,
3694 BFD_RELOC_SH_DISP20BY8,
3695 BFD_RELOC_SH_IMM4,
3696 BFD_RELOC_SH_IMM4BY2,
3697 BFD_RELOC_SH_IMM4BY4,
3698 BFD_RELOC_SH_IMM8,
3699 BFD_RELOC_SH_IMM8BY2,
3700 BFD_RELOC_SH_IMM8BY4,
3701 BFD_RELOC_SH_PCRELIMM8BY2,
3702 BFD_RELOC_SH_PCRELIMM8BY4,
3703 BFD_RELOC_SH_SWITCH16,
3704 BFD_RELOC_SH_SWITCH32,
3705 BFD_RELOC_SH_USES,
3706 BFD_RELOC_SH_COUNT,
3707 BFD_RELOC_SH_ALIGN,
3708 BFD_RELOC_SH_CODE,
3709 BFD_RELOC_SH_DATA,
3710 BFD_RELOC_SH_LABEL,
3711 BFD_RELOC_SH_LOOP_START,
3712 BFD_RELOC_SH_LOOP_END,
3713 BFD_RELOC_SH_COPY,
3714 BFD_RELOC_SH_GLOB_DAT,
3715 BFD_RELOC_SH_JMP_SLOT,
3716 BFD_RELOC_SH_RELATIVE,
3717 BFD_RELOC_SH_GOTPC,
3718 BFD_RELOC_SH_GOT_LOW16,
3719 BFD_RELOC_SH_GOT_MEDLOW16,
3720 BFD_RELOC_SH_GOT_MEDHI16,
3721 BFD_RELOC_SH_GOT_HI16,
3722 BFD_RELOC_SH_GOTPLT_LOW16,
3723 BFD_RELOC_SH_GOTPLT_MEDLOW16,
3724 BFD_RELOC_SH_GOTPLT_MEDHI16,
3725 BFD_RELOC_SH_GOTPLT_HI16,
3726 BFD_RELOC_SH_PLT_LOW16,
3727 BFD_RELOC_SH_PLT_MEDLOW16,
3728 BFD_RELOC_SH_PLT_MEDHI16,
3729 BFD_RELOC_SH_PLT_HI16,
3730 BFD_RELOC_SH_GOTOFF_LOW16,
3731 BFD_RELOC_SH_GOTOFF_MEDLOW16,
3732 BFD_RELOC_SH_GOTOFF_MEDHI16,
3733 BFD_RELOC_SH_GOTOFF_HI16,
3734 BFD_RELOC_SH_GOTPC_LOW16,
3735 BFD_RELOC_SH_GOTPC_MEDLOW16,
3736 BFD_RELOC_SH_GOTPC_MEDHI16,
3737 BFD_RELOC_SH_GOTPC_HI16,
3738 BFD_RELOC_SH_COPY64,
3739 BFD_RELOC_SH_GLOB_DAT64,
3740 BFD_RELOC_SH_JMP_SLOT64,
3741 BFD_RELOC_SH_RELATIVE64,
3742 BFD_RELOC_SH_GOT10BY4,
3743 BFD_RELOC_SH_GOT10BY8,
3744 BFD_RELOC_SH_GOTPLT10BY4,
3745 BFD_RELOC_SH_GOTPLT10BY8,
3746 BFD_RELOC_SH_GOTPLT32,
3747 BFD_RELOC_SH_SHMEDIA_CODE,
3748 BFD_RELOC_SH_IMMU5,
3749 BFD_RELOC_SH_IMMS6,
3750 BFD_RELOC_SH_IMMS6BY32,
3751 BFD_RELOC_SH_IMMU6,
3752 BFD_RELOC_SH_IMMS10,
3753 BFD_RELOC_SH_IMMS10BY2,
3754 BFD_RELOC_SH_IMMS10BY4,
3755 BFD_RELOC_SH_IMMS10BY8,
3756 BFD_RELOC_SH_IMMS16,
3757 BFD_RELOC_SH_IMMU16,
3758 BFD_RELOC_SH_IMM_LOW16,
3759 BFD_RELOC_SH_IMM_LOW16_PCREL,
3760 BFD_RELOC_SH_IMM_MEDLOW16,
3761 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3762 BFD_RELOC_SH_IMM_MEDHI16,
3763 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3764 BFD_RELOC_SH_IMM_HI16,
3765 BFD_RELOC_SH_IMM_HI16_PCREL,
3766 BFD_RELOC_SH_PT_16,
3767 BFD_RELOC_SH_TLS_GD_32,
3768 BFD_RELOC_SH_TLS_LD_32,
3769 BFD_RELOC_SH_TLS_LDO_32,
3770 BFD_RELOC_SH_TLS_IE_32,
3771 BFD_RELOC_SH_TLS_LE_32,
3772 BFD_RELOC_SH_TLS_DTPMOD32,
3773 BFD_RELOC_SH_TLS_DTPOFF32,
3774 BFD_RELOC_SH_TLS_TPOFF32,
3775 BFD_RELOC_SH_GOT20,
3776 BFD_RELOC_SH_GOTOFF20,
3777 BFD_RELOC_SH_GOTFUNCDESC,
3778 BFD_RELOC_SH_GOTFUNCDESC20,
3779 BFD_RELOC_SH_GOTOFFFUNCDESC,
3780 BFD_RELOC_SH_GOTOFFFUNCDESC20,
3781 BFD_RELOC_SH_FUNCDESC,
3782
3783/* ARC relocs. */
3784 BFD_RELOC_ARC_NONE,
3785 BFD_RELOC_ARC_8,
3786 BFD_RELOC_ARC_16,
3787 BFD_RELOC_ARC_24,
3788 BFD_RELOC_ARC_32,
3789 BFD_RELOC_ARC_N8,
3790 BFD_RELOC_ARC_N16,
3791 BFD_RELOC_ARC_N24,
3792 BFD_RELOC_ARC_N32,
3793 BFD_RELOC_ARC_SDA,
3794 BFD_RELOC_ARC_SECTOFF,
3795 BFD_RELOC_ARC_S21H_PCREL,
3796 BFD_RELOC_ARC_S21W_PCREL,
3797 BFD_RELOC_ARC_S25H_PCREL,
3798 BFD_RELOC_ARC_S25W_PCREL,
3799 BFD_RELOC_ARC_SDA32,
3800 BFD_RELOC_ARC_SDA_LDST,
3801 BFD_RELOC_ARC_SDA_LDST1,
3802 BFD_RELOC_ARC_SDA_LDST2,
3803 BFD_RELOC_ARC_SDA16_LD,
3804 BFD_RELOC_ARC_SDA16_LD1,
3805 BFD_RELOC_ARC_SDA16_LD2,
3806 BFD_RELOC_ARC_S13_PCREL,
3807 BFD_RELOC_ARC_W,
3808 BFD_RELOC_ARC_32_ME,
3809 BFD_RELOC_ARC_32_ME_S,
3810 BFD_RELOC_ARC_N32_ME,
3811 BFD_RELOC_ARC_SECTOFF_ME,
3812 BFD_RELOC_ARC_SDA32_ME,
3813 BFD_RELOC_ARC_W_ME,
3814 BFD_RELOC_AC_SECTOFF_U8,
3815 BFD_RELOC_AC_SECTOFF_U8_1,
3816 BFD_RELOC_AC_SECTOFF_U8_2,
3817 BFD_RELOC_AC_SECTOFF_S9,
3818 BFD_RELOC_AC_SECTOFF_S9_1,
3819 BFD_RELOC_AC_SECTOFF_S9_2,
3820 BFD_RELOC_ARC_SECTOFF_ME_1,
3821 BFD_RELOC_ARC_SECTOFF_ME_2,
3822 BFD_RELOC_ARC_SECTOFF_1,
3823 BFD_RELOC_ARC_SECTOFF_2,
3824 BFD_RELOC_ARC_SDA_12,
3825 BFD_RELOC_ARC_SDA16_ST2,
3826 BFD_RELOC_ARC_32_PCREL,
3827 BFD_RELOC_ARC_PC32,
3828 BFD_RELOC_ARC_GOT32,
3829 BFD_RELOC_ARC_GOTPC32,
3830 BFD_RELOC_ARC_PLT32,
3831 BFD_RELOC_ARC_COPY,
3832 BFD_RELOC_ARC_GLOB_DAT,
3833 BFD_RELOC_ARC_JMP_SLOT,
3834 BFD_RELOC_ARC_RELATIVE,
3835 BFD_RELOC_ARC_GOTOFF,
3836 BFD_RELOC_ARC_GOTPC,
3837 BFD_RELOC_ARC_S21W_PCREL_PLT,
3838 BFD_RELOC_ARC_S25H_PCREL_PLT,
3839 BFD_RELOC_ARC_TLS_DTPMOD,
3840 BFD_RELOC_ARC_TLS_TPOFF,
3841 BFD_RELOC_ARC_TLS_GD_GOT,
3842 BFD_RELOC_ARC_TLS_GD_LD,
3843 BFD_RELOC_ARC_TLS_GD_CALL,
3844 BFD_RELOC_ARC_TLS_IE_GOT,
3845 BFD_RELOC_ARC_TLS_DTPOFF,
3846 BFD_RELOC_ARC_TLS_DTPOFF_S9,
3847 BFD_RELOC_ARC_TLS_LE_S9,
3848 BFD_RELOC_ARC_TLS_LE_32,
3849 BFD_RELOC_ARC_S25W_PCREL_PLT,
3850 BFD_RELOC_ARC_S21H_PCREL_PLT,
3851 BFD_RELOC_ARC_NPS_CMEM16,
3852 BFD_RELOC_ARC_JLI_SECTOFF,
3853
3854/* ADI Blackfin 16 bit immediate absolute reloc. */
3855 BFD_RELOC_BFIN_16_IMM,
3856
3857/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */
3858 BFD_RELOC_BFIN_16_HIGH,
3859
3860/* ADI Blackfin 'a' part of LSETUP. */
3861 BFD_RELOC_BFIN_4_PCREL,
3862
3863/* ADI Blackfin. */
3864 BFD_RELOC_BFIN_5_PCREL,
3865
3866/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */
3867 BFD_RELOC_BFIN_16_LOW,
3868
3869/* ADI Blackfin. */
3870 BFD_RELOC_BFIN_10_PCREL,
3871
3872/* ADI Blackfin 'b' part of LSETUP. */
3873 BFD_RELOC_BFIN_11_PCREL,
3874
3875/* ADI Blackfin. */
3876 BFD_RELOC_BFIN_12_PCREL_JUMP,
3877
3878/* ADI Blackfin Short jump, pcrel. */
3879 BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3880
3881/* ADI Blackfin Call.x not implemented. */
3882 BFD_RELOC_BFIN_24_PCREL_CALL_X,
3883
3884/* ADI Blackfin Long Jump pcrel. */
3885 BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3886
3887/* ADI Blackfin FD-PIC relocations. */
3888 BFD_RELOC_BFIN_GOT17M4,
3889 BFD_RELOC_BFIN_GOTHI,
3890 BFD_RELOC_BFIN_GOTLO,
3891 BFD_RELOC_BFIN_FUNCDESC,
3892 BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3893 BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3894 BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3895 BFD_RELOC_BFIN_FUNCDESC_VALUE,
3896 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3897 BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3898 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3899 BFD_RELOC_BFIN_GOTOFF17M4,
3900 BFD_RELOC_BFIN_GOTOFFHI,
3901 BFD_RELOC_BFIN_GOTOFFLO,
3902
3903/* ADI Blackfin GOT relocation. */
3904 BFD_RELOC_BFIN_GOT,
3905
3906/* ADI Blackfin PLTPC relocation. */
3907 BFD_RELOC_BFIN_PLTPC,
3908
3909/* ADI Blackfin arithmetic relocation. */
3910 BFD_ARELOC_BFIN_PUSH,
3911
3912/* ADI Blackfin arithmetic relocation. */
3913 BFD_ARELOC_BFIN_CONST,
3914
3915/* ADI Blackfin arithmetic relocation. */
3916 BFD_ARELOC_BFIN_ADD,
3917
3918/* ADI Blackfin arithmetic relocation. */
3919 BFD_ARELOC_BFIN_SUB,
3920
3921/* ADI Blackfin arithmetic relocation. */
3922 BFD_ARELOC_BFIN_MULT,
3923
3924/* ADI Blackfin arithmetic relocation. */
3925 BFD_ARELOC_BFIN_DIV,
3926
3927/* ADI Blackfin arithmetic relocation. */
3928 BFD_ARELOC_BFIN_MOD,
3929
3930/* ADI Blackfin arithmetic relocation. */
3931 BFD_ARELOC_BFIN_LSHIFT,
3932
3933/* ADI Blackfin arithmetic relocation. */
3934 BFD_ARELOC_BFIN_RSHIFT,
3935
3936/* ADI Blackfin arithmetic relocation. */
3937 BFD_ARELOC_BFIN_AND,
3938
3939/* ADI Blackfin arithmetic relocation. */
3940 BFD_ARELOC_BFIN_OR,
3941
3942/* ADI Blackfin arithmetic relocation. */
3943 BFD_ARELOC_BFIN_XOR,
3944
3945/* ADI Blackfin arithmetic relocation. */
3946 BFD_ARELOC_BFIN_LAND,
3947
3948/* ADI Blackfin arithmetic relocation. */
3949 BFD_ARELOC_BFIN_LOR,
3950
3951/* ADI Blackfin arithmetic relocation. */
3952 BFD_ARELOC_BFIN_LEN,
3953
3954/* ADI Blackfin arithmetic relocation. */
3955 BFD_ARELOC_BFIN_NEG,
3956
3957/* ADI Blackfin arithmetic relocation. */
3958 BFD_ARELOC_BFIN_COMP,
3959
3960/* ADI Blackfin arithmetic relocation. */
3961 BFD_ARELOC_BFIN_PAGE,
3962
3963/* ADI Blackfin arithmetic relocation. */
3964 BFD_ARELOC_BFIN_HWPAGE,
3965
3966/* ADI Blackfin arithmetic relocation. */
3967 BFD_ARELOC_BFIN_ADDR,
3968
3969/* Mitsubishi D10V relocs.
3970This is a 10-bit reloc with the right 2 bits
3971assumed to be 0. */
3972 BFD_RELOC_D10V_10_PCREL_R,
3973
3974/* Mitsubishi D10V relocs.
3975This is a 10-bit reloc with the right 2 bits
3976assumed to be 0. This is the same as the previous reloc
3977except it is in the left container, i.e.,
3978shifted left 15 bits. */
3979 BFD_RELOC_D10V_10_PCREL_L,
3980
3981/* This is an 18-bit reloc with the right 2 bits
3982assumed to be 0. */
3983 BFD_RELOC_D10V_18,
3984
3985/* This is an 18-bit reloc with the right 2 bits
3986assumed to be 0. */
3987 BFD_RELOC_D10V_18_PCREL,
3988
3989/* Mitsubishi D30V relocs.
3990This is a 6-bit absolute reloc. */
3991 BFD_RELOC_D30V_6,
3992
3993/* This is a 6-bit pc-relative reloc with
3994the right 3 bits assumed to be 0. */
3995 BFD_RELOC_D30V_9_PCREL,
3996
3997/* This is a 6-bit pc-relative reloc with
3998the right 3 bits assumed to be 0. Same
3999as the previous reloc but on the right side
4000of the container. */
4001 BFD_RELOC_D30V_9_PCREL_R,
4002
4003/* This is a 12-bit absolute reloc with the
4004right 3 bitsassumed to be 0. */
4005 BFD_RELOC_D30V_15,
4006
4007/* This is a 12-bit pc-relative reloc with
4008the right 3 bits assumed to be 0. */
4009 BFD_RELOC_D30V_15_PCREL,
4010
4011/* This is a 12-bit pc-relative reloc with
4012the right 3 bits assumed to be 0. Same
4013as the previous reloc but on the right side
4014of the container. */
4015 BFD_RELOC_D30V_15_PCREL_R,
4016
4017/* This is an 18-bit absolute reloc with
4018the right 3 bits assumed to be 0. */
4019 BFD_RELOC_D30V_21,
4020
4021/* This is an 18-bit pc-relative reloc with
4022the right 3 bits assumed to be 0. */
4023 BFD_RELOC_D30V_21_PCREL,
4024
4025/* This is an 18-bit pc-relative reloc with
4026the right 3 bits assumed to be 0. Same
4027as the previous reloc but on the right side
4028of the container. */
4029 BFD_RELOC_D30V_21_PCREL_R,
4030
4031/* This is a 32-bit absolute reloc. */
4032 BFD_RELOC_D30V_32,
4033
4034/* This is a 32-bit pc-relative reloc. */
4035 BFD_RELOC_D30V_32_PCREL,
4036
4037/* DLX relocs */
4038 BFD_RELOC_DLX_HI16_S,
4039
4040/* DLX relocs */
4041 BFD_RELOC_DLX_LO16,
4042
4043/* DLX relocs */
4044 BFD_RELOC_DLX_JMP26,
4045
4046/* Renesas M16C/M32C Relocations. */
4047 BFD_RELOC_M32C_HI8,
4048 BFD_RELOC_M32C_RL_JUMP,
4049 BFD_RELOC_M32C_RL_1ADDR,
4050 BFD_RELOC_M32C_RL_2ADDR,
4051
4052/* Renesas M32R (formerly Mitsubishi M32R) relocs.
4053This is a 24 bit absolute address. */
4054 BFD_RELOC_M32R_24,
4055
4056/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
4057 BFD_RELOC_M32R_10_PCREL,
4058
4059/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
4060 BFD_RELOC_M32R_18_PCREL,
4061
4062/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
4063 BFD_RELOC_M32R_26_PCREL,
4064
4065/* This is a 16-bit reloc containing the high 16 bits of an address
4066used when the lower 16 bits are treated as unsigned. */
4067 BFD_RELOC_M32R_HI16_ULO,
4068
4069/* This is a 16-bit reloc containing the high 16 bits of an address
4070used when the lower 16 bits are treated as signed. */
4071 BFD_RELOC_M32R_HI16_SLO,
4072
4073/* This is a 16-bit reloc containing the lower 16 bits of an address. */
4074 BFD_RELOC_M32R_LO16,
4075
4076/* This is a 16-bit reloc containing the small data area offset for use in
4077add3, load, and store instructions. */
4078 BFD_RELOC_M32R_SDA16,
4079
4080/* For PIC. */
4081 BFD_RELOC_M32R_GOT24,
4082 BFD_RELOC_M32R_26_PLTREL,
4083 BFD_RELOC_M32R_COPY,
4084 BFD_RELOC_M32R_GLOB_DAT,
4085 BFD_RELOC_M32R_JMP_SLOT,
4086 BFD_RELOC_M32R_RELATIVE,
4087 BFD_RELOC_M32R_GOTOFF,
4088 BFD_RELOC_M32R_GOTOFF_HI_ULO,
4089 BFD_RELOC_M32R_GOTOFF_HI_SLO,
4090 BFD_RELOC_M32R_GOTOFF_LO,
4091 BFD_RELOC_M32R_GOTPC24,
4092 BFD_RELOC_M32R_GOT16_HI_ULO,
4093 BFD_RELOC_M32R_GOT16_HI_SLO,
4094 BFD_RELOC_M32R_GOT16_LO,
4095 BFD_RELOC_M32R_GOTPC_HI_ULO,
4096 BFD_RELOC_M32R_GOTPC_HI_SLO,
4097 BFD_RELOC_M32R_GOTPC_LO,
4098
4099/* NDS32 relocs.
4100This is a 20 bit absolute address. */
4101 BFD_RELOC_NDS32_20,
4102
4103/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4104 BFD_RELOC_NDS32_9_PCREL,
4105
4106/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
4107 BFD_RELOC_NDS32_WORD_9_PCREL,
4108
4109/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
4110 BFD_RELOC_NDS32_15_PCREL,
4111
4112/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
4113 BFD_RELOC_NDS32_17_PCREL,
4114
4115/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
4116 BFD_RELOC_NDS32_25_PCREL,
4117
4118/* This is a 20-bit reloc containing the high 20 bits of an address
4119used with the lower 12 bits */
4120 BFD_RELOC_NDS32_HI20,
4121
4122/* This is a 12-bit reloc containing the lower 12 bits of an address
4123then shift right by 3. This is used with ldi,sdi... */
4124 BFD_RELOC_NDS32_LO12S3,
4125
4126/* This is a 12-bit reloc containing the lower 12 bits of an address
4127then shift left by 2. This is used with lwi,swi... */
4128 BFD_RELOC_NDS32_LO12S2,
4129
4130/* This is a 12-bit reloc containing the lower 12 bits of an address
4131then shift left by 1. This is used with lhi,shi... */
4132 BFD_RELOC_NDS32_LO12S1,
4133
4134/* This is a 12-bit reloc containing the lower 12 bits of an address
4135then shift left by 0. This is used with lbisbi... */
4136 BFD_RELOC_NDS32_LO12S0,
4137
4138/* This is a 12-bit reloc containing the lower 12 bits of an address
4139then shift left by 0. This is only used with branch relaxations */
4140 BFD_RELOC_NDS32_LO12S0_ORI,
4141
4142/* This is a 15-bit reloc containing the small data area 18-bit signed offset
4143and shift left by 3 for use in ldi, sdi... */
4144 BFD_RELOC_NDS32_SDA15S3,
4145
4146/* This is a 15-bit reloc containing the small data area 17-bit signed offset
4147and shift left by 2 for use in lwi, swi... */
4148 BFD_RELOC_NDS32_SDA15S2,
4149
4150/* This is a 15-bit reloc containing the small data area 16-bit signed offset
4151and shift left by 1 for use in lhi, shi... */
4152 BFD_RELOC_NDS32_SDA15S1,
4153
4154/* This is a 15-bit reloc containing the small data area 15-bit signed offset
4155and shift left by 0 for use in lbi, sbi... */
4156 BFD_RELOC_NDS32_SDA15S0,
4157
4158/* This is a 16-bit reloc containing the small data area 16-bit signed offset
4159and shift left by 3 */
4160 BFD_RELOC_NDS32_SDA16S3,
4161
4162/* This is a 17-bit reloc containing the small data area 17-bit signed offset
4163and shift left by 2 for use in lwi.gp, swi.gp... */
4164 BFD_RELOC_NDS32_SDA17S2,
4165
4166/* This is a 18-bit reloc containing the small data area 18-bit signed offset
4167and shift left by 1 for use in lhi.gp, shi.gp... */
4168 BFD_RELOC_NDS32_SDA18S1,
4169
4170/* This is a 19-bit reloc containing the small data area 19-bit signed offset
4171and shift left by 0 for use in lbi.gp, sbi.gp... */
4172 BFD_RELOC_NDS32_SDA19S0,
4173
4174/* for PIC */
4175 BFD_RELOC_NDS32_GOT20,
4176 BFD_RELOC_NDS32_9_PLTREL,
4177 BFD_RELOC_NDS32_25_PLTREL,
4178 BFD_RELOC_NDS32_COPY,
4179 BFD_RELOC_NDS32_GLOB_DAT,
4180 BFD_RELOC_NDS32_JMP_SLOT,
4181 BFD_RELOC_NDS32_RELATIVE,
4182 BFD_RELOC_NDS32_GOTOFF,
4183 BFD_RELOC_NDS32_GOTOFF_HI20,
4184 BFD_RELOC_NDS32_GOTOFF_LO12,
4185 BFD_RELOC_NDS32_GOTPC20,
4186 BFD_RELOC_NDS32_GOT_HI20,
4187 BFD_RELOC_NDS32_GOT_LO12,
4188 BFD_RELOC_NDS32_GOTPC_HI20,
4189 BFD_RELOC_NDS32_GOTPC_LO12,
4190
4191/* for relax */
4192 BFD_RELOC_NDS32_INSN16,
4193 BFD_RELOC_NDS32_LABEL,
4194 BFD_RELOC_NDS32_LONGCALL1,
4195 BFD_RELOC_NDS32_LONGCALL2,
4196 BFD_RELOC_NDS32_LONGCALL3,
4197 BFD_RELOC_NDS32_LONGJUMP1,
4198 BFD_RELOC_NDS32_LONGJUMP2,
4199 BFD_RELOC_NDS32_LONGJUMP3,
4200 BFD_RELOC_NDS32_LOADSTORE,
4201 BFD_RELOC_NDS32_9_FIXED,
4202 BFD_RELOC_NDS32_15_FIXED,
4203 BFD_RELOC_NDS32_17_FIXED,
4204 BFD_RELOC_NDS32_25_FIXED,
4205 BFD_RELOC_NDS32_LONGCALL4,
4206 BFD_RELOC_NDS32_LONGCALL5,
4207 BFD_RELOC_NDS32_LONGCALL6,
4208 BFD_RELOC_NDS32_LONGJUMP4,
4209 BFD_RELOC_NDS32_LONGJUMP5,
4210 BFD_RELOC_NDS32_LONGJUMP6,
4211 BFD_RELOC_NDS32_LONGJUMP7,
4212
4213/* for PIC */
4214 BFD_RELOC_NDS32_PLTREL_HI20,
4215 BFD_RELOC_NDS32_PLTREL_LO12,
4216 BFD_RELOC_NDS32_PLT_GOTREL_HI20,
4217 BFD_RELOC_NDS32_PLT_GOTREL_LO12,
4218
4219/* for floating point */
4220 BFD_RELOC_NDS32_SDA12S2_DP,
4221 BFD_RELOC_NDS32_SDA12S2_SP,
4222 BFD_RELOC_NDS32_LO12S2_DP,
4223 BFD_RELOC_NDS32_LO12S2_SP,
4224
4225/* for dwarf2 debug_line. */
4226 BFD_RELOC_NDS32_DWARF2_OP1,
4227 BFD_RELOC_NDS32_DWARF2_OP2,
4228 BFD_RELOC_NDS32_DWARF2_LEB,
4229
4230/* for eliminate 16-bit instructions */
4231 BFD_RELOC_NDS32_UPDATE_TA,
4232
4233/* for PIC object relaxation */
4234 BFD_RELOC_NDS32_PLT_GOTREL_LO20,
4235 BFD_RELOC_NDS32_PLT_GOTREL_LO15,
4236 BFD_RELOC_NDS32_PLT_GOTREL_LO19,
4237 BFD_RELOC_NDS32_GOT_LO15,
4238 BFD_RELOC_NDS32_GOT_LO19,
4239 BFD_RELOC_NDS32_GOTOFF_LO15,
4240 BFD_RELOC_NDS32_GOTOFF_LO19,
4241 BFD_RELOC_NDS32_GOT15S2,
4242 BFD_RELOC_NDS32_GOT17S2,
4243
4244/* NDS32 relocs.
4245This is a 5 bit absolute address. */
4246 BFD_RELOC_NDS32_5,
4247
4248/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
4249 BFD_RELOC_NDS32_10_UPCREL,
4250
4251/* If fp were omitted, fp can used as another gp. */
4252 BFD_RELOC_NDS32_SDA_FP7U2_RELA,
4253
4254/* relaxation relative relocation types */
4255 BFD_RELOC_NDS32_RELAX_ENTRY,
4256 BFD_RELOC_NDS32_GOT_SUFF,
4257 BFD_RELOC_NDS32_GOTOFF_SUFF,
4258 BFD_RELOC_NDS32_PLT_GOT_SUFF,
4259 BFD_RELOC_NDS32_MULCALL_SUFF,
4260 BFD_RELOC_NDS32_PTR,
4261 BFD_RELOC_NDS32_PTR_COUNT,
4262 BFD_RELOC_NDS32_PTR_RESOLVED,
4263 BFD_RELOC_NDS32_PLTBLOCK,
4264 BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
4265 BFD_RELOC_NDS32_RELAX_REGION_END,
4266 BFD_RELOC_NDS32_MINUEND,
4267 BFD_RELOC_NDS32_SUBTRAHEND,
4268 BFD_RELOC_NDS32_DIFF8,
4269 BFD_RELOC_NDS32_DIFF16,
4270 BFD_RELOC_NDS32_DIFF32,
4271 BFD_RELOC_NDS32_DIFF_ULEB128,
4272 BFD_RELOC_NDS32_EMPTY,
4273
4274/* This is a 25 bit absolute address. */
4275 BFD_RELOC_NDS32_25_ABS,
4276
4277/* For ex9 and ifc using. */
4278 BFD_RELOC_NDS32_DATA,
4279 BFD_RELOC_NDS32_TRAN,
4280 BFD_RELOC_NDS32_17IFC_PCREL,
4281 BFD_RELOC_NDS32_10IFCU_PCREL,
4282
4283/* For TLS. */
4284 BFD_RELOC_NDS32_TPOFF,
4285 BFD_RELOC_NDS32_GOTTPOFF,
4286 BFD_RELOC_NDS32_TLS_LE_HI20,
4287 BFD_RELOC_NDS32_TLS_LE_LO12,
4288 BFD_RELOC_NDS32_TLS_LE_20,
4289 BFD_RELOC_NDS32_TLS_LE_15S0,
4290 BFD_RELOC_NDS32_TLS_LE_15S1,
4291 BFD_RELOC_NDS32_TLS_LE_15S2,
4292 BFD_RELOC_NDS32_TLS_LE_ADD,
4293 BFD_RELOC_NDS32_TLS_LE_LS,
4294 BFD_RELOC_NDS32_TLS_IE_HI20,
4295 BFD_RELOC_NDS32_TLS_IE_LO12,
4296 BFD_RELOC_NDS32_TLS_IE_LO12S2,
4297 BFD_RELOC_NDS32_TLS_IEGP_HI20,
4298 BFD_RELOC_NDS32_TLS_IEGP_LO12,
4299 BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
4300 BFD_RELOC_NDS32_TLS_IEGP_LW,
4301 BFD_RELOC_NDS32_TLS_DESC,
4302 BFD_RELOC_NDS32_TLS_DESC_HI20,
4303 BFD_RELOC_NDS32_TLS_DESC_LO12,
4304 BFD_RELOC_NDS32_TLS_DESC_20,
4305 BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
4306 BFD_RELOC_NDS32_TLS_DESC_ADD,
4307 BFD_RELOC_NDS32_TLS_DESC_FUNC,
4308 BFD_RELOC_NDS32_TLS_DESC_CALL,
4309 BFD_RELOC_NDS32_TLS_DESC_MEM,
4310 BFD_RELOC_NDS32_REMOVE,
4311 BFD_RELOC_NDS32_GROUP,
4312
4313/* For floating load store relaxation. */
4314 BFD_RELOC_NDS32_LSI,
4315
4316/* This is a 9-bit reloc */
4317 BFD_RELOC_V850_9_PCREL,
4318
4319/* This is a 22-bit reloc */
4320 BFD_RELOC_V850_22_PCREL,
4321
4322/* This is a 16 bit offset from the short data area pointer. */
4323 BFD_RELOC_V850_SDA_16_16_OFFSET,
4324
4325/* This is a 16 bit offset (of which only 15 bits are used) from the
4326short data area pointer. */
4327 BFD_RELOC_V850_SDA_15_16_OFFSET,
4328
4329/* This is a 16 bit offset from the zero data area pointer. */
4330 BFD_RELOC_V850_ZDA_16_16_OFFSET,
4331
4332/* This is a 16 bit offset (of which only 15 bits are used) from the
4333zero data area pointer. */
4334 BFD_RELOC_V850_ZDA_15_16_OFFSET,
4335
4336/* This is an 8 bit offset (of which only 6 bits are used) from the
4337tiny data area pointer. */
4338 BFD_RELOC_V850_TDA_6_8_OFFSET,
4339
4340/* This is an 8bit offset (of which only 7 bits are used) from the tiny
4341data area pointer. */
4342 BFD_RELOC_V850_TDA_7_8_OFFSET,
4343
4344/* This is a 7 bit offset from the tiny data area pointer. */
4345 BFD_RELOC_V850_TDA_7_7_OFFSET,
4346
4347/* This is a 16 bit offset from the tiny data area pointer. */
4348 BFD_RELOC_V850_TDA_16_16_OFFSET,
4349
4350/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
4351data area pointer. */
4352 BFD_RELOC_V850_TDA_4_5_OFFSET,
4353
4354/* This is a 4 bit offset from the tiny data area pointer. */
4355 BFD_RELOC_V850_TDA_4_4_OFFSET,
4356
4357/* This is a 16 bit offset from the short data area pointer, with the
4358bits placed non-contiguously in the instruction. */
4359 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
4360
4361/* This is a 16 bit offset from the zero data area pointer, with the
4362bits placed non-contiguously in the instruction. */
4363 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
4364
4365/* This is a 6 bit offset from the call table base pointer. */
4366 BFD_RELOC_V850_CALLT_6_7_OFFSET,
4367
4368/* This is a 16 bit offset from the call table base pointer. */
4369 BFD_RELOC_V850_CALLT_16_16_OFFSET,
4370
4371/* Used for relaxing indirect function calls. */
4372 BFD_RELOC_V850_LONGCALL,
4373
4374/* Used for relaxing indirect jumps. */
4375 BFD_RELOC_V850_LONGJUMP,
4376
4377/* Used to maintain alignment whilst relaxing. */
4378 BFD_RELOC_V850_ALIGN,
4379
4380/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
4381instructions. */
4382 BFD_RELOC_V850_LO16_SPLIT_OFFSET,
4383
4384/* This is a 16-bit reloc. */
4385 BFD_RELOC_V850_16_PCREL,
4386
4387/* This is a 17-bit reloc. */
4388 BFD_RELOC_V850_17_PCREL,
4389
4390/* This is a 23-bit reloc. */
4391 BFD_RELOC_V850_23,
4392
4393/* This is a 32-bit reloc. */
4394 BFD_RELOC_V850_32_PCREL,
4395
4396/* This is a 32-bit reloc. */
4397 BFD_RELOC_V850_32_ABS,
4398
4399/* This is a 16-bit reloc. */
4400 BFD_RELOC_V850_16_SPLIT_OFFSET,
4401
4402/* This is a 16-bit reloc. */
4403 BFD_RELOC_V850_16_S1,
4404
4405/* Low 16 bits. 16 bit shifted by 1. */
4406 BFD_RELOC_V850_LO16_S1,
4407
4408/* This is a 16 bit offset from the call table base pointer. */
4409 BFD_RELOC_V850_CALLT_15_16_OFFSET,
4410
4411/* DSO relocations. */
4412 BFD_RELOC_V850_32_GOTPCREL,
4413
4414/* DSO relocations. */
4415 BFD_RELOC_V850_16_GOT,
4416
4417/* DSO relocations. */
4418 BFD_RELOC_V850_32_GOT,
4419
4420/* DSO relocations. */
4421 BFD_RELOC_V850_22_PLT_PCREL,
4422
4423/* DSO relocations. */
4424 BFD_RELOC_V850_32_PLT_PCREL,
4425
4426/* DSO relocations. */
4427 BFD_RELOC_V850_COPY,
4428
4429/* DSO relocations. */
4430 BFD_RELOC_V850_GLOB_DAT,
4431
4432/* DSO relocations. */
4433 BFD_RELOC_V850_JMP_SLOT,
4434
4435/* DSO relocations. */
4436 BFD_RELOC_V850_RELATIVE,
4437
4438/* DSO relocations. */
4439 BFD_RELOC_V850_16_GOTOFF,
4440
4441/* DSO relocations. */
4442 BFD_RELOC_V850_32_GOTOFF,
4443
4444/* start code. */
4445 BFD_RELOC_V850_CODE,
4446
4447/* start data in text. */
4448 BFD_RELOC_V850_DATA,
4449
4450/* This is a 8bit DP reloc for the tms320c30, where the most
4451significant 8 bits of a 24 bit word are placed into the least
4452significant 8 bits of the opcode. */
4453 BFD_RELOC_TIC30_LDP,
4454
4455/* This is a 7bit reloc for the tms320c54x, where the least
4456significant 7 bits of a 16 bit word are placed into the least
4457significant 7 bits of the opcode. */
4458 BFD_RELOC_TIC54X_PARTLS7,
4459
4460/* This is a 9bit DP reloc for the tms320c54x, where the most
4461significant 9 bits of a 16 bit word are placed into the least
4462significant 9 bits of the opcode. */
4463 BFD_RELOC_TIC54X_PARTMS9,
4464
4465/* This is an extended address 23-bit reloc for the tms320c54x. */
4466 BFD_RELOC_TIC54X_23,
4467
4468/* This is a 16-bit reloc for the tms320c54x, where the least
4469significant 16 bits of a 23-bit extended address are placed into
4470the opcode. */
4471 BFD_RELOC_TIC54X_16_OF_23,
4472
4473/* This is a reloc for the tms320c54x, where the most
4474significant 7 bits of a 23-bit extended address are placed into
4475the opcode. */
4476 BFD_RELOC_TIC54X_MS7_OF_23,
4477
4478/* TMS320C6000 relocations. */
4479 BFD_RELOC_C6000_PCR_S21,
4480 BFD_RELOC_C6000_PCR_S12,
4481 BFD_RELOC_C6000_PCR_S10,
4482 BFD_RELOC_C6000_PCR_S7,
4483 BFD_RELOC_C6000_ABS_S16,
4484 BFD_RELOC_C6000_ABS_L16,
4485 BFD_RELOC_C6000_ABS_H16,
4486 BFD_RELOC_C6000_SBR_U15_B,
4487 BFD_RELOC_C6000_SBR_U15_H,
4488 BFD_RELOC_C6000_SBR_U15_W,
4489 BFD_RELOC_C6000_SBR_S16,
4490 BFD_RELOC_C6000_SBR_L16_B,
4491 BFD_RELOC_C6000_SBR_L16_H,
4492 BFD_RELOC_C6000_SBR_L16_W,
4493 BFD_RELOC_C6000_SBR_H16_B,
4494 BFD_RELOC_C6000_SBR_H16_H,
4495 BFD_RELOC_C6000_SBR_H16_W,
4496 BFD_RELOC_C6000_SBR_GOT_U15_W,
4497 BFD_RELOC_C6000_SBR_GOT_L16_W,
4498 BFD_RELOC_C6000_SBR_GOT_H16_W,
4499 BFD_RELOC_C6000_DSBT_INDEX,
4500 BFD_RELOC_C6000_PREL31,
4501 BFD_RELOC_C6000_COPY,
4502 BFD_RELOC_C6000_JUMP_SLOT,
4503 BFD_RELOC_C6000_EHTYPE,
4504 BFD_RELOC_C6000_PCR_H16,
4505 BFD_RELOC_C6000_PCR_L16,
4506 BFD_RELOC_C6000_ALIGN,
4507 BFD_RELOC_C6000_FPHEAD,
4508 BFD_RELOC_C6000_NOCMP,
4509
4510/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
4511 BFD_RELOC_FR30_48,
4512
4513/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4514two sections. */
4515 BFD_RELOC_FR30_20,
4516
4517/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
45184 bits. */
4519 BFD_RELOC_FR30_6_IN_4,
4520
4521/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4522into 8 bits. */
4523 BFD_RELOC_FR30_8_IN_8,
4524
4525/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4526into 8 bits. */
4527 BFD_RELOC_FR30_9_IN_8,
4528
4529/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4530into 8 bits. */
4531 BFD_RELOC_FR30_10_IN_8,
4532
4533/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4534short offset into 8 bits. */
4535 BFD_RELOC_FR30_9_PCREL,
4536
4537/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4538short offset into 11 bits. */
4539 BFD_RELOC_FR30_12_PCREL,
4540
4541/* Motorola Mcore relocations. */
4542 BFD_RELOC_MCORE_PCREL_IMM8BY4,
4543 BFD_RELOC_MCORE_PCREL_IMM11BY2,
4544 BFD_RELOC_MCORE_PCREL_IMM4BY2,
4545 BFD_RELOC_MCORE_PCREL_32,
4546 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4547 BFD_RELOC_MCORE_RVA,
4548
4549/* Toshiba Media Processor Relocations. */
4550 BFD_RELOC_MEP_8,
4551 BFD_RELOC_MEP_16,
4552 BFD_RELOC_MEP_32,
4553 BFD_RELOC_MEP_PCREL8A2,
4554 BFD_RELOC_MEP_PCREL12A2,
4555 BFD_RELOC_MEP_PCREL17A2,
4556 BFD_RELOC_MEP_PCREL24A2,
4557 BFD_RELOC_MEP_PCABS24A2,
4558 BFD_RELOC_MEP_LOW16,
4559 BFD_RELOC_MEP_HI16U,
4560 BFD_RELOC_MEP_HI16S,
4561 BFD_RELOC_MEP_GPREL,
4562 BFD_RELOC_MEP_TPREL,
4563 BFD_RELOC_MEP_TPREL7,
4564 BFD_RELOC_MEP_TPREL7A2,
4565 BFD_RELOC_MEP_TPREL7A4,
4566 BFD_RELOC_MEP_UIMM24,
4567 BFD_RELOC_MEP_ADDR24A4,
4568 BFD_RELOC_MEP_GNU_VTINHERIT,
4569 BFD_RELOC_MEP_GNU_VTENTRY,
4570
4571
4572/* Imagination Technologies Meta relocations. */
4573 BFD_RELOC_METAG_HIADDR16,
4574 BFD_RELOC_METAG_LOADDR16,
4575 BFD_RELOC_METAG_RELBRANCH,
4576 BFD_RELOC_METAG_GETSETOFF,
4577 BFD_RELOC_METAG_HIOG,
4578 BFD_RELOC_METAG_LOOG,
4579 BFD_RELOC_METAG_REL8,
4580 BFD_RELOC_METAG_REL16,
4581 BFD_RELOC_METAG_HI16_GOTOFF,
4582 BFD_RELOC_METAG_LO16_GOTOFF,
4583 BFD_RELOC_METAG_GETSET_GOTOFF,
4584 BFD_RELOC_METAG_GETSET_GOT,
4585 BFD_RELOC_METAG_HI16_GOTPC,
4586 BFD_RELOC_METAG_LO16_GOTPC,
4587 BFD_RELOC_METAG_HI16_PLT,
4588 BFD_RELOC_METAG_LO16_PLT,
4589 BFD_RELOC_METAG_RELBRANCH_PLT,
4590 BFD_RELOC_METAG_GOTOFF,
4591 BFD_RELOC_METAG_PLT,
4592 BFD_RELOC_METAG_COPY,
4593 BFD_RELOC_METAG_JMP_SLOT,
4594 BFD_RELOC_METAG_RELATIVE,
4595 BFD_RELOC_METAG_GLOB_DAT,
4596 BFD_RELOC_METAG_TLS_GD,
4597 BFD_RELOC_METAG_TLS_LDM,
4598 BFD_RELOC_METAG_TLS_LDO_HI16,
4599 BFD_RELOC_METAG_TLS_LDO_LO16,
4600 BFD_RELOC_METAG_TLS_LDO,
4601 BFD_RELOC_METAG_TLS_IE,
4602 BFD_RELOC_METAG_TLS_IENONPIC,
4603 BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4604 BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4605 BFD_RELOC_METAG_TLS_TPOFF,
4606 BFD_RELOC_METAG_TLS_DTPMOD,
4607 BFD_RELOC_METAG_TLS_DTPOFF,
4608 BFD_RELOC_METAG_TLS_LE,
4609 BFD_RELOC_METAG_TLS_LE_HI16,
4610 BFD_RELOC_METAG_TLS_LE_LO16,
4611
4612/* These are relocations for the GETA instruction. */
4613 BFD_RELOC_MMIX_GETA,
4614 BFD_RELOC_MMIX_GETA_1,
4615 BFD_RELOC_MMIX_GETA_2,
4616 BFD_RELOC_MMIX_GETA_3,
4617
4618/* These are relocations for a conditional branch instruction. */
4619 BFD_RELOC_MMIX_CBRANCH,
4620 BFD_RELOC_MMIX_CBRANCH_J,
4621 BFD_RELOC_MMIX_CBRANCH_1,
4622 BFD_RELOC_MMIX_CBRANCH_2,
4623 BFD_RELOC_MMIX_CBRANCH_3,
4624
4625/* These are relocations for the PUSHJ instruction. */
4626 BFD_RELOC_MMIX_PUSHJ,
4627 BFD_RELOC_MMIX_PUSHJ_1,
4628 BFD_RELOC_MMIX_PUSHJ_2,
4629 BFD_RELOC_MMIX_PUSHJ_3,
4630 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4631
4632/* These are relocations for the JMP instruction. */
4633 BFD_RELOC_MMIX_JMP,
4634 BFD_RELOC_MMIX_JMP_1,
4635 BFD_RELOC_MMIX_JMP_2,
4636 BFD_RELOC_MMIX_JMP_3,
4637
4638/* This is a relocation for a relative address as in a GETA instruction or
4639a branch. */
4640 BFD_RELOC_MMIX_ADDR19,
4641
4642/* This is a relocation for a relative address as in a JMP instruction. */
4643 BFD_RELOC_MMIX_ADDR27,
4644
4645/* This is a relocation for an instruction field that may be a general
4646register or a value 0..255. */
4647 BFD_RELOC_MMIX_REG_OR_BYTE,
4648
4649/* This is a relocation for an instruction field that may be a general
4650register. */
4651 BFD_RELOC_MMIX_REG,
4652
4653/* This is a relocation for two instruction fields holding a register and
4654an offset, the equivalent of the relocation. */
4655 BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4656
4657/* This relocation is an assertion that the expression is not allocated as
4658a global register. It does not modify contents. */
4659 BFD_RELOC_MMIX_LOCAL,
4660
4661/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4662short offset into 7 bits. */
4663 BFD_RELOC_AVR_7_PCREL,
4664
4665/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4666short offset into 12 bits. */
4667 BFD_RELOC_AVR_13_PCREL,
4668
4669/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4670program memory address) into 16 bits. */
4671 BFD_RELOC_AVR_16_PM,
4672
4673/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4674data memory address) into 8 bit immediate value of LDI insn. */
4675 BFD_RELOC_AVR_LO8_LDI,
4676
4677/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4678of data memory address) into 8 bit immediate value of LDI insn. */
4679 BFD_RELOC_AVR_HI8_LDI,
4680
4681/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4682of program memory address) into 8 bit immediate value of LDI insn. */
4683 BFD_RELOC_AVR_HH8_LDI,
4684
4685/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4686of 32 bit value) into 8 bit immediate value of LDI insn. */
4687 BFD_RELOC_AVR_MS8_LDI,
4688
4689/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4690(usually data memory address) into 8 bit immediate value of SUBI insn. */
4691 BFD_RELOC_AVR_LO8_LDI_NEG,
4692
4693/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4694(high 8 bit of data memory address) into 8 bit immediate value of
4695SUBI insn. */
4696 BFD_RELOC_AVR_HI8_LDI_NEG,
4697
4698/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4699(most high 8 bit of program memory address) into 8 bit immediate value
4700of LDI or SUBI insn. */
4701 BFD_RELOC_AVR_HH8_LDI_NEG,
4702
4703/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4704of 32 bit value) into 8 bit immediate value of LDI insn. */
4705 BFD_RELOC_AVR_MS8_LDI_NEG,
4706
4707/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4708command address) into 8 bit immediate value of LDI insn. */
4709 BFD_RELOC_AVR_LO8_LDI_PM,
4710
4711/* This is a 16 bit reloc for the AVR that stores 8 bit value
4712(command address) into 8 bit immediate value of LDI insn. If the address
4713is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4714in the lower 128k. */
4715 BFD_RELOC_AVR_LO8_LDI_GS,
4716
4717/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4718of command address) into 8 bit immediate value of LDI insn. */
4719 BFD_RELOC_AVR_HI8_LDI_PM,
4720
4721/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4722of command address) into 8 bit immediate value of LDI insn. If the address
4723is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4724below 128k. */
4725 BFD_RELOC_AVR_HI8_LDI_GS,
4726
4727/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4728of command address) into 8 bit immediate value of LDI insn. */
4729 BFD_RELOC_AVR_HH8_LDI_PM,
4730
4731/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4732(usually command address) into 8 bit immediate value of SUBI insn. */
4733 BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4734
4735/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4736(high 8 bit of 16 bit command address) into 8 bit immediate value
4737of SUBI insn. */
4738 BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4739
4740/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4741(high 6 bit of 22 bit command address) into 8 bit immediate
4742value of SUBI insn. */
4743 BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4744
4745/* This is a 32 bit reloc for the AVR that stores 23 bit value
4746into 22 bits. */
4747 BFD_RELOC_AVR_CALL,
4748
4749/* This is a 16 bit reloc for the AVR that stores all needed bits
4750for absolute addressing with ldi with overflow check to linktime */
4751 BFD_RELOC_AVR_LDI,
4752
4753/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4754instructions */
4755 BFD_RELOC_AVR_6,
4756
4757/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4758instructions */
4759 BFD_RELOC_AVR_6_ADIW,
4760
4761/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4762in .byte lo8(symbol) */
4763 BFD_RELOC_AVR_8_LO,
4764
4765/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4766in .byte hi8(symbol) */
4767 BFD_RELOC_AVR_8_HI,
4768
4769/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4770in .byte hlo8(symbol) */
4771 BFD_RELOC_AVR_8_HLO,
4772
4773/* AVR relocations to mark the difference of two local symbols.
4774These are only needed to support linker relaxation and can be ignored
4775when not relaxing. The field is set to the value of the difference
4776assuming no relaxation. The relocation encodes the position of the
4777second symbol so the linker can determine whether to adjust the field
4778value. */
4779 BFD_RELOC_AVR_DIFF8,
4780 BFD_RELOC_AVR_DIFF16,
4781 BFD_RELOC_AVR_DIFF32,
4782
4783/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4784lds and sts instructions supported only tiny core. */
4785 BFD_RELOC_AVR_LDS_STS_16,
4786
4787/* This is a 6 bit reloc for the AVR that stores an I/O register
4788number for the IN and OUT instructions */
4789 BFD_RELOC_AVR_PORT6,
4790
4791/* This is a 5 bit reloc for the AVR that stores an I/O register
4792number for the SBIC, SBIS, SBI and CBI instructions */
4793 BFD_RELOC_AVR_PORT5,
4794
4795/* RISC-V relocations. */
4796 BFD_RELOC_RISCV_HI20,
4797 BFD_RELOC_RISCV_PCREL_HI20,
4798 BFD_RELOC_RISCV_PCREL_LO12_I,
4799 BFD_RELOC_RISCV_PCREL_LO12_S,
4800 BFD_RELOC_RISCV_LO12_I,
4801 BFD_RELOC_RISCV_LO12_S,
4802 BFD_RELOC_RISCV_GPREL12_I,
4803 BFD_RELOC_RISCV_GPREL12_S,
4804 BFD_RELOC_RISCV_TPREL_HI20,
4805 BFD_RELOC_RISCV_TPREL_LO12_I,
4806 BFD_RELOC_RISCV_TPREL_LO12_S,
4807 BFD_RELOC_RISCV_TPREL_ADD,
4808 BFD_RELOC_RISCV_CALL,
4809 BFD_RELOC_RISCV_CALL_PLT,
4810 BFD_RELOC_RISCV_ADD8,
4811 BFD_RELOC_RISCV_ADD16,
4812 BFD_RELOC_RISCV_ADD32,
4813 BFD_RELOC_RISCV_ADD64,
4814 BFD_RELOC_RISCV_SUB8,
4815 BFD_RELOC_RISCV_SUB16,
4816 BFD_RELOC_RISCV_SUB32,
4817 BFD_RELOC_RISCV_SUB64,
4818 BFD_RELOC_RISCV_GOT_HI20,
4819 BFD_RELOC_RISCV_TLS_GOT_HI20,
4820 BFD_RELOC_RISCV_TLS_GD_HI20,
4821 BFD_RELOC_RISCV_JMP,
4822 BFD_RELOC_RISCV_TLS_DTPMOD32,
4823 BFD_RELOC_RISCV_TLS_DTPREL32,
4824 BFD_RELOC_RISCV_TLS_DTPMOD64,
4825 BFD_RELOC_RISCV_TLS_DTPREL64,
4826 BFD_RELOC_RISCV_TLS_TPREL32,
4827 BFD_RELOC_RISCV_TLS_TPREL64,
4828 BFD_RELOC_RISCV_ALIGN,
4829 BFD_RELOC_RISCV_RVC_BRANCH,
4830 BFD_RELOC_RISCV_RVC_JUMP,
4831 BFD_RELOC_RISCV_RVC_LUI,
4832 BFD_RELOC_RISCV_GPREL_I,
4833 BFD_RELOC_RISCV_GPREL_S,
4834 BFD_RELOC_RISCV_TPREL_I,
4835 BFD_RELOC_RISCV_TPREL_S,
4836 BFD_RELOC_RISCV_RELAX,
4837 BFD_RELOC_RISCV_CFA,
4838 BFD_RELOC_RISCV_SUB6,
4839 BFD_RELOC_RISCV_SET6,
4840 BFD_RELOC_RISCV_SET8,
4841 BFD_RELOC_RISCV_SET16,
4842 BFD_RELOC_RISCV_SET32,
4843 BFD_RELOC_RISCV_32_PCREL,
4844
4845/* Renesas RL78 Relocations. */
4846 BFD_RELOC_RL78_NEG8,
4847 BFD_RELOC_RL78_NEG16,
4848 BFD_RELOC_RL78_NEG24,
4849 BFD_RELOC_RL78_NEG32,
4850 BFD_RELOC_RL78_16_OP,
4851 BFD_RELOC_RL78_24_OP,
4852 BFD_RELOC_RL78_32_OP,
4853 BFD_RELOC_RL78_8U,
4854 BFD_RELOC_RL78_16U,
4855 BFD_RELOC_RL78_24U,
4856 BFD_RELOC_RL78_DIR3U_PCREL,
4857 BFD_RELOC_RL78_DIFF,
4858 BFD_RELOC_RL78_GPRELB,
4859 BFD_RELOC_RL78_GPRELW,
4860 BFD_RELOC_RL78_GPRELL,
4861 BFD_RELOC_RL78_SYM,
4862 BFD_RELOC_RL78_OP_SUBTRACT,
4863 BFD_RELOC_RL78_OP_NEG,
4864 BFD_RELOC_RL78_OP_AND,
4865 BFD_RELOC_RL78_OP_SHRA,
4866 BFD_RELOC_RL78_ABS8,
4867 BFD_RELOC_RL78_ABS16,
4868 BFD_RELOC_RL78_ABS16_REV,
4869 BFD_RELOC_RL78_ABS32,
4870 BFD_RELOC_RL78_ABS32_REV,
4871 BFD_RELOC_RL78_ABS16U,
4872 BFD_RELOC_RL78_ABS16UW,
4873 BFD_RELOC_RL78_ABS16UL,
4874 BFD_RELOC_RL78_RELAX,
4875 BFD_RELOC_RL78_HI16,
4876 BFD_RELOC_RL78_HI8,
4877 BFD_RELOC_RL78_LO16,
4878 BFD_RELOC_RL78_CODE,
4879 BFD_RELOC_RL78_SADDR,
4880
4881/* Renesas RX Relocations. */
4882 BFD_RELOC_RX_NEG8,
4883 BFD_RELOC_RX_NEG16,
4884 BFD_RELOC_RX_NEG24,
4885 BFD_RELOC_RX_NEG32,
4886 BFD_RELOC_RX_16_OP,
4887 BFD_RELOC_RX_24_OP,
4888 BFD_RELOC_RX_32_OP,
4889 BFD_RELOC_RX_8U,
4890 BFD_RELOC_RX_16U,
4891 BFD_RELOC_RX_24U,
4892 BFD_RELOC_RX_DIR3U_PCREL,
4893 BFD_RELOC_RX_DIFF,
4894 BFD_RELOC_RX_GPRELB,
4895 BFD_RELOC_RX_GPRELW,
4896 BFD_RELOC_RX_GPRELL,
4897 BFD_RELOC_RX_SYM,
4898 BFD_RELOC_RX_OP_SUBTRACT,
4899 BFD_RELOC_RX_OP_NEG,
4900 BFD_RELOC_RX_ABS8,
4901 BFD_RELOC_RX_ABS16,
4902 BFD_RELOC_RX_ABS16_REV,
4903 BFD_RELOC_RX_ABS32,
4904 BFD_RELOC_RX_ABS32_REV,
4905 BFD_RELOC_RX_ABS16U,
4906 BFD_RELOC_RX_ABS16UW,
4907 BFD_RELOC_RX_ABS16UL,
4908 BFD_RELOC_RX_RELAX,
4909
4910/* Direct 12 bit. */
4911 BFD_RELOC_390_12,
4912
4913/* 12 bit GOT offset. */
4914 BFD_RELOC_390_GOT12,
4915
4916/* 32 bit PC relative PLT address. */
4917 BFD_RELOC_390_PLT32,
4918
4919/* Copy symbol at runtime. */
4920 BFD_RELOC_390_COPY,
4921
4922/* Create GOT entry. */
4923 BFD_RELOC_390_GLOB_DAT,
4924
4925/* Create PLT entry. */
4926 BFD_RELOC_390_JMP_SLOT,
4927
4928/* Adjust by program base. */
4929 BFD_RELOC_390_RELATIVE,
4930
4931/* 32 bit PC relative offset to GOT. */
4932 BFD_RELOC_390_GOTPC,
4933
4934/* 16 bit GOT offset. */
4935 BFD_RELOC_390_GOT16,
4936
4937/* PC relative 12 bit shifted by 1. */
4938 BFD_RELOC_390_PC12DBL,
4939
4940/* 12 bit PC rel. PLT shifted by 1. */
4941 BFD_RELOC_390_PLT12DBL,
4942
4943/* PC relative 16 bit shifted by 1. */
4944 BFD_RELOC_390_PC16DBL,
4945
4946/* 16 bit PC rel. PLT shifted by 1. */
4947 BFD_RELOC_390_PLT16DBL,
4948
4949/* PC relative 24 bit shifted by 1. */
4950 BFD_RELOC_390_PC24DBL,
4951
4952/* 24 bit PC rel. PLT shifted by 1. */
4953 BFD_RELOC_390_PLT24DBL,
4954
4955/* PC relative 32 bit shifted by 1. */
4956 BFD_RELOC_390_PC32DBL,
4957
4958/* 32 bit PC rel. PLT shifted by 1. */
4959 BFD_RELOC_390_PLT32DBL,
4960
4961/* 32 bit PC rel. GOT shifted by 1. */
4962 BFD_RELOC_390_GOTPCDBL,
4963
4964/* 64 bit GOT offset. */
4965 BFD_RELOC_390_GOT64,
4966
4967/* 64 bit PC relative PLT address. */
4968 BFD_RELOC_390_PLT64,
4969
4970/* 32 bit rel. offset to GOT entry. */
4971 BFD_RELOC_390_GOTENT,
4972
4973/* 64 bit offset to GOT. */
4974 BFD_RELOC_390_GOTOFF64,
4975
4976/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
4977 BFD_RELOC_390_GOTPLT12,
4978
4979/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
4980 BFD_RELOC_390_GOTPLT16,
4981
4982/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
4983 BFD_RELOC_390_GOTPLT32,
4984
4985/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
4986 BFD_RELOC_390_GOTPLT64,
4987
4988/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
4989 BFD_RELOC_390_GOTPLTENT,
4990
4991/* 16-bit rel. offset from the GOT to a PLT entry. */
4992 BFD_RELOC_390_PLTOFF16,
4993
4994/* 32-bit rel. offset from the GOT to a PLT entry. */
4995 BFD_RELOC_390_PLTOFF32,
4996
4997/* 64-bit rel. offset from the GOT to a PLT entry. */
4998 BFD_RELOC_390_PLTOFF64,
4999
5000/* s390 tls relocations. */
5001 BFD_RELOC_390_TLS_LOAD,
5002 BFD_RELOC_390_TLS_GDCALL,
5003 BFD_RELOC_390_TLS_LDCALL,
5004 BFD_RELOC_390_TLS_GD32,
5005 BFD_RELOC_390_TLS_GD64,
5006 BFD_RELOC_390_TLS_GOTIE12,
5007 BFD_RELOC_390_TLS_GOTIE32,
5008 BFD_RELOC_390_TLS_GOTIE64,
5009 BFD_RELOC_390_TLS_LDM32,
5010 BFD_RELOC_390_TLS_LDM64,
5011 BFD_RELOC_390_TLS_IE32,
5012 BFD_RELOC_390_TLS_IE64,
5013 BFD_RELOC_390_TLS_IEENT,
5014 BFD_RELOC_390_TLS_LE32,
5015 BFD_RELOC_390_TLS_LE64,
5016 BFD_RELOC_390_TLS_LDO32,
5017 BFD_RELOC_390_TLS_LDO64,
5018 BFD_RELOC_390_TLS_DTPMOD,
5019 BFD_RELOC_390_TLS_DTPOFF,
5020 BFD_RELOC_390_TLS_TPOFF,
5021
5022/* Long displacement extension. */
5023 BFD_RELOC_390_20,
5024 BFD_RELOC_390_GOT20,
5025 BFD_RELOC_390_GOTPLT20,
5026 BFD_RELOC_390_TLS_GOTIE20,
5027
5028/* STT_GNU_IFUNC relocation. */
5029 BFD_RELOC_390_IRELATIVE,
5030
5031/* Score relocations
5032Low 16 bit for load/store */
5033 BFD_RELOC_SCORE_GPREL15,
5034
5035/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */
5036 BFD_RELOC_SCORE_DUMMY2,
5037 BFD_RELOC_SCORE_JMP,
5038
5039/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */
5040 BFD_RELOC_SCORE_BRANCH,
5041
5042/* This is a 32-bit reloc for 48-bit instructions. */
5043 BFD_RELOC_SCORE_IMM30,
5044
5045/* This is a 32-bit reloc for 48-bit instructions. */
5046 BFD_RELOC_SCORE_IMM32,
5047
5048/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */
5049 BFD_RELOC_SCORE16_JMP,
5050
5051/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */
5052 BFD_RELOC_SCORE16_BRANCH,
5053
5054/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */
5055 BFD_RELOC_SCORE_BCMP,
5056
5057/* Undocumented Score relocs */
5058 BFD_RELOC_SCORE_GOT15,
5059 BFD_RELOC_SCORE_GOT_LO16,
5060 BFD_RELOC_SCORE_CALL15,
5061 BFD_RELOC_SCORE_DUMMY_HI16,
5062
5063/* Scenix IP2K - 9-bit register number / data address */
5064 BFD_RELOC_IP2K_FR9,
5065
5066/* Scenix IP2K - 4-bit register/data bank number */
5067 BFD_RELOC_IP2K_BANK,
5068
5069/* Scenix IP2K - low 13 bits of instruction word address */
5070 BFD_RELOC_IP2K_ADDR16CJP,
5071
5072/* Scenix IP2K - high 3 bits of instruction word address */
5073 BFD_RELOC_IP2K_PAGE3,
5074
5075/* Scenix IP2K - ext/low/high 8 bits of data address */
5076 BFD_RELOC_IP2K_LO8DATA,
5077 BFD_RELOC_IP2K_HI8DATA,
5078 BFD_RELOC_IP2K_EX8DATA,
5079
5080/* Scenix IP2K - low/high 8 bits of instruction word address */
5081 BFD_RELOC_IP2K_LO8INSN,
5082 BFD_RELOC_IP2K_HI8INSN,
5083
5084/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
5085 BFD_RELOC_IP2K_PC_SKIP,
5086
5087/* Scenix IP2K - 16 bit word address in text section. */
5088 BFD_RELOC_IP2K_TEXT,
5089
5090/* Scenix IP2K - 7-bit sp or dp offset */
5091 BFD_RELOC_IP2K_FR_OFFSET,
5092
5093/* Scenix VPE4K coprocessor - data/insn-space addressing */
5094 BFD_RELOC_VPE4KMATH_DATA,
5095 BFD_RELOC_VPE4KMATH_INSN,
5096
5097/* These two relocations are used by the linker to determine which of
5098the entries in a C++ virtual function table are actually used. When
5099the --gc-sections option is given, the linker will zero out the entries
5100that are not used, so that the code for those functions need not be
5101included in the output.
5102
5103VTABLE_INHERIT is a zero-space relocation used to describe to the
5104linker the inheritance tree of a C++ virtual function table. The
5105relocation's symbol should be the parent class' vtable, and the
5106relocation should be located at the child vtable.
5107
5108VTABLE_ENTRY is a zero-space relocation that describes the use of a
5109virtual function table entry. The reloc's symbol should refer to the
5110table of the class mentioned in the code. Off of that base, an offset
5111describes the entry that is being used. For Rela hosts, this offset
5112is stored in the reloc's addend. For Rel hosts, we are forced to put
5113this offset in the reloc's section offset. */
5114 BFD_RELOC_VTABLE_INHERIT,
5115 BFD_RELOC_VTABLE_ENTRY,
5116
5117/* Intel IA64 Relocations. */
5118 BFD_RELOC_IA64_IMM14,
5119 BFD_RELOC_IA64_IMM22,
5120 BFD_RELOC_IA64_IMM64,
5121 BFD_RELOC_IA64_DIR32MSB,
5122 BFD_RELOC_IA64_DIR32LSB,
5123 BFD_RELOC_IA64_DIR64MSB,
5124 BFD_RELOC_IA64_DIR64LSB,
5125 BFD_RELOC_IA64_GPREL22,
5126 BFD_RELOC_IA64_GPREL64I,
5127 BFD_RELOC_IA64_GPREL32MSB,
5128 BFD_RELOC_IA64_GPREL32LSB,
5129 BFD_RELOC_IA64_GPREL64MSB,
5130 BFD_RELOC_IA64_GPREL64LSB,
5131 BFD_RELOC_IA64_LTOFF22,
5132 BFD_RELOC_IA64_LTOFF64I,
5133 BFD_RELOC_IA64_PLTOFF22,
5134 BFD_RELOC_IA64_PLTOFF64I,
5135 BFD_RELOC_IA64_PLTOFF64MSB,
5136 BFD_RELOC_IA64_PLTOFF64LSB,
5137 BFD_RELOC_IA64_FPTR64I,
5138 BFD_RELOC_IA64_FPTR32MSB,
5139 BFD_RELOC_IA64_FPTR32LSB,
5140 BFD_RELOC_IA64_FPTR64MSB,
5141 BFD_RELOC_IA64_FPTR64LSB,
5142 BFD_RELOC_IA64_PCREL21B,
5143 BFD_RELOC_IA64_PCREL21BI,
5144 BFD_RELOC_IA64_PCREL21M,
5145 BFD_RELOC_IA64_PCREL21F,
5146 BFD_RELOC_IA64_PCREL22,
5147 BFD_RELOC_IA64_PCREL60B,
5148 BFD_RELOC_IA64_PCREL64I,
5149 BFD_RELOC_IA64_PCREL32MSB,
5150 BFD_RELOC_IA64_PCREL32LSB,
5151 BFD_RELOC_IA64_PCREL64MSB,
5152 BFD_RELOC_IA64_PCREL64LSB,
5153 BFD_RELOC_IA64_LTOFF_FPTR22,
5154 BFD_RELOC_IA64_LTOFF_FPTR64I,
5155 BFD_RELOC_IA64_LTOFF_FPTR32MSB,
5156 BFD_RELOC_IA64_LTOFF_FPTR32LSB,
5157 BFD_RELOC_IA64_LTOFF_FPTR64MSB,
5158 BFD_RELOC_IA64_LTOFF_FPTR64LSB,
5159 BFD_RELOC_IA64_SEGREL32MSB,
5160 BFD_RELOC_IA64_SEGREL32LSB,
5161 BFD_RELOC_IA64_SEGREL64MSB,
5162 BFD_RELOC_IA64_SEGREL64LSB,
5163 BFD_RELOC_IA64_SECREL32MSB,
5164 BFD_RELOC_IA64_SECREL32LSB,
5165 BFD_RELOC_IA64_SECREL64MSB,
5166 BFD_RELOC_IA64_SECREL64LSB,
5167 BFD_RELOC_IA64_REL32MSB,
5168 BFD_RELOC_IA64_REL32LSB,
5169 BFD_RELOC_IA64_REL64MSB,
5170 BFD_RELOC_IA64_REL64LSB,
5171 BFD_RELOC_IA64_LTV32MSB,
5172 BFD_RELOC_IA64_LTV32LSB,
5173 BFD_RELOC_IA64_LTV64MSB,
5174 BFD_RELOC_IA64_LTV64LSB,
5175 BFD_RELOC_IA64_IPLTMSB,
5176 BFD_RELOC_IA64_IPLTLSB,
5177 BFD_RELOC_IA64_COPY,
5178 BFD_RELOC_IA64_LTOFF22X,
5179 BFD_RELOC_IA64_LDXMOV,
5180 BFD_RELOC_IA64_TPREL14,
5181 BFD_RELOC_IA64_TPREL22,
5182 BFD_RELOC_IA64_TPREL64I,
5183 BFD_RELOC_IA64_TPREL64MSB,
5184 BFD_RELOC_IA64_TPREL64LSB,
5185 BFD_RELOC_IA64_LTOFF_TPREL22,
5186 BFD_RELOC_IA64_DTPMOD64MSB,
5187 BFD_RELOC_IA64_DTPMOD64LSB,
5188 BFD_RELOC_IA64_LTOFF_DTPMOD22,
5189 BFD_RELOC_IA64_DTPREL14,
5190 BFD_RELOC_IA64_DTPREL22,
5191 BFD_RELOC_IA64_DTPREL64I,
5192 BFD_RELOC_IA64_DTPREL32MSB,
5193 BFD_RELOC_IA64_DTPREL32LSB,
5194 BFD_RELOC_IA64_DTPREL64MSB,
5195 BFD_RELOC_IA64_DTPREL64LSB,
5196 BFD_RELOC_IA64_LTOFF_DTPREL22,
5197
5198/* Motorola 68HC11 reloc.
5199This is the 8 bit high part of an absolute address. */
5200 BFD_RELOC_M68HC11_HI8,
5201
5202/* Motorola 68HC11 reloc.
5203This is the 8 bit low part of an absolute address. */
5204 BFD_RELOC_M68HC11_LO8,
5205
5206/* Motorola 68HC11 reloc.
5207This is the 3 bit of a value. */
5208 BFD_RELOC_M68HC11_3B,
5209
5210/* Motorola 68HC11 reloc.
5211This reloc marks the beginning of a jump/call instruction.
5212It is used for linker relaxation to correctly identify beginning
5213of instruction and change some branches to use PC-relative
5214addressing mode. */
5215 BFD_RELOC_M68HC11_RL_JUMP,
5216
5217/* Motorola 68HC11 reloc.
5218This reloc marks a group of several instructions that gcc generates
5219and for which the linker relaxation pass can modify and/or remove
5220some of them. */
5221 BFD_RELOC_M68HC11_RL_GROUP,
5222
5223/* Motorola 68HC11 reloc.
5224This is the 16-bit lower part of an address. It is used for 'call'
5225instruction to specify the symbol address without any special
5226transformation (due to memory bank window). */
5227 BFD_RELOC_M68HC11_LO16,
5228
5229/* Motorola 68HC11 reloc.
5230This is a 8-bit reloc that specifies the page number of an address.
5231It is used by 'call' instruction to specify the page number of
5232the symbol. */
5233 BFD_RELOC_M68HC11_PAGE,
5234
5235/* Motorola 68HC11 reloc.
5236This is a 24-bit reloc that represents the address with a 16-bit
5237value and a 8-bit page number. The symbol address is transformed
5238to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
5239 BFD_RELOC_M68HC11_24,
5240
5241/* Motorola 68HC12 reloc.
5242This is the 5 bits of a value. */
5243 BFD_RELOC_M68HC12_5B,
5244
5245/* Freescale XGATE reloc.
5246This reloc marks the beginning of a bra/jal instruction. */
5247 BFD_RELOC_XGATE_RL_JUMP,
5248
5249/* Freescale XGATE reloc.
5250This reloc marks a group of several instructions that gcc generates
5251and for which the linker relaxation pass can modify and/or remove
5252some of them. */
5253 BFD_RELOC_XGATE_RL_GROUP,
5254
5255/* Freescale XGATE reloc.
5256This is the 16-bit lower part of an address. It is used for the '16-bit'
5257instructions. */
5258 BFD_RELOC_XGATE_LO16,
5259
5260/* Freescale XGATE reloc. */
5261 BFD_RELOC_XGATE_GPAGE,
5262
5263/* Freescale XGATE reloc. */
5264 BFD_RELOC_XGATE_24,
5265
5266/* Freescale XGATE reloc.
5267This is a 9-bit pc-relative reloc. */
5268 BFD_RELOC_XGATE_PCREL_9,
5269
5270/* Freescale XGATE reloc.
5271This is a 10-bit pc-relative reloc. */
5272 BFD_RELOC_XGATE_PCREL_10,
5273
5274/* Freescale XGATE reloc.
5275This is the 16-bit lower part of an address. It is used for the '16-bit'
5276instructions. */
5277 BFD_RELOC_XGATE_IMM8_LO,
5278
5279/* Freescale XGATE reloc.
5280This is the 16-bit higher part of an address. It is used for the '16-bit'
5281instructions. */
5282 BFD_RELOC_XGATE_IMM8_HI,
5283
5284/* Freescale XGATE reloc.
5285This is a 3-bit pc-relative reloc. */
5286 BFD_RELOC_XGATE_IMM3,
5287
5288/* Freescale XGATE reloc.
5289This is a 4-bit pc-relative reloc. */
5290 BFD_RELOC_XGATE_IMM4,
5291
5292/* Freescale XGATE reloc.
5293This is a 5-bit pc-relative reloc. */
5294 BFD_RELOC_XGATE_IMM5,
5295
5296/* Motorola 68HC12 reloc.
5297This is the 9 bits of a value. */
5298 BFD_RELOC_M68HC12_9B,
5299
5300/* Motorola 68HC12 reloc.
5301This is the 16 bits of a value. */
5302 BFD_RELOC_M68HC12_16B,
5303
5304/* Motorola 68HC12/XGATE reloc.
5305This is a PCREL9 branch. */
5306 BFD_RELOC_M68HC12_9_PCREL,
5307
5308/* Motorola 68HC12/XGATE reloc.
5309This is a PCREL10 branch. */
5310 BFD_RELOC_M68HC12_10_PCREL,
5311
5312/* Motorola 68HC12/XGATE reloc.
5313This is the 8 bit low part of an absolute address and immediately precedes
5314a matching HI8XG part. */
5315 BFD_RELOC_M68HC12_LO8XG,
5316
5317/* Motorola 68HC12/XGATE reloc.
5318This is the 8 bit high part of an absolute address and immediately follows
5319a matching LO8XG part. */
5320 BFD_RELOC_M68HC12_HI8XG,
5321
5322/* Freescale S12Z reloc.
5323This is a 15 bit relative address. If the most significant bits are all zero
5324then it may be truncated to 8 bits. */
5325 BFD_RELOC_S12Z_15_PCREL,
5326
5327/* NS CR16C Relocations. */
5328 BFD_RELOC_16C_NUM08,
5329 BFD_RELOC_16C_NUM08_C,
5330 BFD_RELOC_16C_NUM16,
5331 BFD_RELOC_16C_NUM16_C,
5332 BFD_RELOC_16C_NUM32,
5333 BFD_RELOC_16C_NUM32_C,
5334 BFD_RELOC_16C_DISP04,
5335 BFD_RELOC_16C_DISP04_C,
5336 BFD_RELOC_16C_DISP08,
5337 BFD_RELOC_16C_DISP08_C,
5338 BFD_RELOC_16C_DISP16,
5339 BFD_RELOC_16C_DISP16_C,
5340 BFD_RELOC_16C_DISP24,
5341 BFD_RELOC_16C_DISP24_C,
5342 BFD_RELOC_16C_DISP24a,
5343 BFD_RELOC_16C_DISP24a_C,
5344 BFD_RELOC_16C_REG04,
5345 BFD_RELOC_16C_REG04_C,
5346 BFD_RELOC_16C_REG04a,
5347 BFD_RELOC_16C_REG04a_C,
5348 BFD_RELOC_16C_REG14,
5349 BFD_RELOC_16C_REG14_C,
5350 BFD_RELOC_16C_REG16,
5351 BFD_RELOC_16C_REG16_C,
5352 BFD_RELOC_16C_REG20,
5353 BFD_RELOC_16C_REG20_C,
5354 BFD_RELOC_16C_ABS20,
5355 BFD_RELOC_16C_ABS20_C,
5356 BFD_RELOC_16C_ABS24,
5357 BFD_RELOC_16C_ABS24_C,
5358 BFD_RELOC_16C_IMM04,
5359 BFD_RELOC_16C_IMM04_C,
5360 BFD_RELOC_16C_IMM16,
5361 BFD_RELOC_16C_IMM16_C,
5362 BFD_RELOC_16C_IMM20,
5363 BFD_RELOC_16C_IMM20_C,
5364 BFD_RELOC_16C_IMM24,
5365 BFD_RELOC_16C_IMM24_C,
5366 BFD_RELOC_16C_IMM32,
5367 BFD_RELOC_16C_IMM32_C,
5368
5369/* NS CR16 Relocations. */
5370 BFD_RELOC_CR16_NUM8,
5371 BFD_RELOC_CR16_NUM16,
5372 BFD_RELOC_CR16_NUM32,
5373 BFD_RELOC_CR16_NUM32a,
5374 BFD_RELOC_CR16_REGREL0,
5375 BFD_RELOC_CR16_REGREL4,
5376 BFD_RELOC_CR16_REGREL4a,
5377 BFD_RELOC_CR16_REGREL14,
5378 BFD_RELOC_CR16_REGREL14a,
5379 BFD_RELOC_CR16_REGREL16,
5380 BFD_RELOC_CR16_REGREL20,
5381 BFD_RELOC_CR16_REGREL20a,
5382 BFD_RELOC_CR16_ABS20,
5383 BFD_RELOC_CR16_ABS24,
5384 BFD_RELOC_CR16_IMM4,
5385 BFD_RELOC_CR16_IMM8,
5386 BFD_RELOC_CR16_IMM16,
5387 BFD_RELOC_CR16_IMM20,
5388 BFD_RELOC_CR16_IMM24,
5389 BFD_RELOC_CR16_IMM32,
5390 BFD_RELOC_CR16_IMM32a,
5391 BFD_RELOC_CR16_DISP4,
5392 BFD_RELOC_CR16_DISP8,
5393 BFD_RELOC_CR16_DISP16,
5394 BFD_RELOC_CR16_DISP20,
5395 BFD_RELOC_CR16_DISP24,
5396 BFD_RELOC_CR16_DISP24a,
5397 BFD_RELOC_CR16_SWITCH8,
5398 BFD_RELOC_CR16_SWITCH16,
5399 BFD_RELOC_CR16_SWITCH32,
5400 BFD_RELOC_CR16_GOT_REGREL20,
5401 BFD_RELOC_CR16_GOTC_REGREL20,
5402 BFD_RELOC_CR16_GLOB_DAT,
5403
5404/* NS CRX Relocations. */
5405 BFD_RELOC_CRX_REL4,
5406 BFD_RELOC_CRX_REL8,
5407 BFD_RELOC_CRX_REL8_CMP,
5408 BFD_RELOC_CRX_REL16,
5409 BFD_RELOC_CRX_REL24,
5410 BFD_RELOC_CRX_REL32,
5411 BFD_RELOC_CRX_REGREL12,
5412 BFD_RELOC_CRX_REGREL22,
5413 BFD_RELOC_CRX_REGREL28,
5414 BFD_RELOC_CRX_REGREL32,
5415 BFD_RELOC_CRX_ABS16,
5416 BFD_RELOC_CRX_ABS32,
5417 BFD_RELOC_CRX_NUM8,
5418 BFD_RELOC_CRX_NUM16,
5419 BFD_RELOC_CRX_NUM32,
5420 BFD_RELOC_CRX_IMM16,
5421 BFD_RELOC_CRX_IMM32,
5422 BFD_RELOC_CRX_SWITCH8,
5423 BFD_RELOC_CRX_SWITCH16,
5424 BFD_RELOC_CRX_SWITCH32,
5425
5426/* These relocs are only used within the CRIS assembler. They are not
5427(at present) written to any object files. */
5428 BFD_RELOC_CRIS_BDISP8,
5429 BFD_RELOC_CRIS_UNSIGNED_5,
5430 BFD_RELOC_CRIS_SIGNED_6,
5431 BFD_RELOC_CRIS_UNSIGNED_6,
5432 BFD_RELOC_CRIS_SIGNED_8,
5433 BFD_RELOC_CRIS_UNSIGNED_8,
5434 BFD_RELOC_CRIS_SIGNED_16,
5435 BFD_RELOC_CRIS_UNSIGNED_16,
5436 BFD_RELOC_CRIS_LAPCQ_OFFSET,
5437 BFD_RELOC_CRIS_UNSIGNED_4,
5438
5439/* Relocs used in ELF shared libraries for CRIS. */
5440 BFD_RELOC_CRIS_COPY,
5441 BFD_RELOC_CRIS_GLOB_DAT,
5442 BFD_RELOC_CRIS_JUMP_SLOT,
5443 BFD_RELOC_CRIS_RELATIVE,
5444
5445/* 32-bit offset to symbol-entry within GOT. */
5446 BFD_RELOC_CRIS_32_GOT,
5447
5448/* 16-bit offset to symbol-entry within GOT. */
5449 BFD_RELOC_CRIS_16_GOT,
5450
5451/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
5452 BFD_RELOC_CRIS_32_GOTPLT,
5453
5454/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
5455 BFD_RELOC_CRIS_16_GOTPLT,
5456
5457/* 32-bit offset to symbol, relative to GOT. */
5458 BFD_RELOC_CRIS_32_GOTREL,
5459
5460/* 32-bit offset to symbol with PLT entry, relative to GOT. */
5461 BFD_RELOC_CRIS_32_PLT_GOTREL,
5462
5463/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
5464 BFD_RELOC_CRIS_32_PLT_PCREL,
5465
5466/* Relocs used in TLS code for CRIS. */
5467 BFD_RELOC_CRIS_32_GOT_GD,
5468 BFD_RELOC_CRIS_16_GOT_GD,
5469 BFD_RELOC_CRIS_32_GD,
5470 BFD_RELOC_CRIS_DTP,
5471 BFD_RELOC_CRIS_32_DTPREL,
5472 BFD_RELOC_CRIS_16_DTPREL,
5473 BFD_RELOC_CRIS_32_GOT_TPREL,
5474 BFD_RELOC_CRIS_16_GOT_TPREL,
5475 BFD_RELOC_CRIS_32_TPREL,
5476 BFD_RELOC_CRIS_16_TPREL,
5477 BFD_RELOC_CRIS_DTPMOD,
5478 BFD_RELOC_CRIS_32_IE,
5479
5480/* OpenRISC 1000 Relocations. */
5481 BFD_RELOC_OR1K_REL_26,
5482 BFD_RELOC_OR1K_SLO16,
5483 BFD_RELOC_OR1K_PCREL_PG21,
5484 BFD_RELOC_OR1K_LO13,
5485 BFD_RELOC_OR1K_SLO13,
5486 BFD_RELOC_OR1K_GOTPC_HI16,
5487 BFD_RELOC_OR1K_GOTPC_LO16,
5488 BFD_RELOC_OR1K_GOT16,
5489 BFD_RELOC_OR1K_GOT_PG21,
5490 BFD_RELOC_OR1K_GOT_LO13,
5491 BFD_RELOC_OR1K_PLT26,
5492 BFD_RELOC_OR1K_PLTA26,
5493 BFD_RELOC_OR1K_GOTOFF_SLO16,
5494 BFD_RELOC_OR1K_COPY,
5495 BFD_RELOC_OR1K_GLOB_DAT,
5496 BFD_RELOC_OR1K_JMP_SLOT,
5497 BFD_RELOC_OR1K_RELATIVE,
5498 BFD_RELOC_OR1K_TLS_GD_HI16,
5499 BFD_RELOC_OR1K_TLS_GD_LO16,
5500 BFD_RELOC_OR1K_TLS_GD_PG21,
5501 BFD_RELOC_OR1K_TLS_GD_LO13,
5502 BFD_RELOC_OR1K_TLS_LDM_HI16,
5503 BFD_RELOC_OR1K_TLS_LDM_LO16,
5504 BFD_RELOC_OR1K_TLS_LDM_PG21,
5505 BFD_RELOC_OR1K_TLS_LDM_LO13,
5506 BFD_RELOC_OR1K_TLS_LDO_HI16,
5507 BFD_RELOC_OR1K_TLS_LDO_LO16,
5508 BFD_RELOC_OR1K_TLS_IE_HI16,
5509 BFD_RELOC_OR1K_TLS_IE_AHI16,
5510 BFD_RELOC_OR1K_TLS_IE_LO16,
5511 BFD_RELOC_OR1K_TLS_IE_PG21,
5512 BFD_RELOC_OR1K_TLS_IE_LO13,
5513 BFD_RELOC_OR1K_TLS_LE_HI16,
5514 BFD_RELOC_OR1K_TLS_LE_AHI16,
5515 BFD_RELOC_OR1K_TLS_LE_LO16,
5516 BFD_RELOC_OR1K_TLS_LE_SLO16,
5517 BFD_RELOC_OR1K_TLS_TPOFF,
5518 BFD_RELOC_OR1K_TLS_DTPOFF,
5519 BFD_RELOC_OR1K_TLS_DTPMOD,
5520
5521/* H8 elf Relocations. */
5522 BFD_RELOC_H8_DIR16A8,
5523 BFD_RELOC_H8_DIR16R8,
5524 BFD_RELOC_H8_DIR24A8,
5525 BFD_RELOC_H8_DIR24R8,
5526 BFD_RELOC_H8_DIR32A16,
5527 BFD_RELOC_H8_DISP32A16,
5528
5529/* Sony Xstormy16 Relocations. */
5530 BFD_RELOC_XSTORMY16_REL_12,
5531 BFD_RELOC_XSTORMY16_12,
5532 BFD_RELOC_XSTORMY16_24,
5533 BFD_RELOC_XSTORMY16_FPTR16,
5534
5535/* Self-describing complex relocations. */
5536 BFD_RELOC_RELC,
5537
5538
5539/* Infineon Relocations. */
5540 BFD_RELOC_XC16X_PAG,
5541 BFD_RELOC_XC16X_POF,
5542 BFD_RELOC_XC16X_SEG,
5543 BFD_RELOC_XC16X_SOF,
5544
5545/* Relocations used by VAX ELF. */
5546 BFD_RELOC_VAX_GLOB_DAT,
5547 BFD_RELOC_VAX_JMP_SLOT,
5548 BFD_RELOC_VAX_RELATIVE,
5549
5550/* Morpho MT - 16 bit immediate relocation. */
5551 BFD_RELOC_MT_PC16,
5552
5553/* Morpho MT - Hi 16 bits of an address. */
5554 BFD_RELOC_MT_HI16,
5555
5556/* Morpho MT - Low 16 bits of an address. */
5557 BFD_RELOC_MT_LO16,
5558
5559/* Morpho MT - Used to tell the linker which vtable entries are used. */
5560 BFD_RELOC_MT_GNU_VTINHERIT,
5561
5562/* Morpho MT - Used to tell the linker which vtable entries are used. */
5563 BFD_RELOC_MT_GNU_VTENTRY,
5564
5565/* Morpho MT - 8 bit immediate relocation. */
5566 BFD_RELOC_MT_PCINSN8,
5567
5568/* msp430 specific relocation codes */
5569 BFD_RELOC_MSP430_10_PCREL,
5570 BFD_RELOC_MSP430_16_PCREL,
5571 BFD_RELOC_MSP430_16,
5572 BFD_RELOC_MSP430_16_PCREL_BYTE,
5573 BFD_RELOC_MSP430_16_BYTE,
5574 BFD_RELOC_MSP430_2X_PCREL,
5575 BFD_RELOC_MSP430_RL_PCREL,
5576 BFD_RELOC_MSP430_ABS8,
5577 BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5578 BFD_RELOC_MSP430X_PCR20_EXT_DST,
5579 BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5580 BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5581 BFD_RELOC_MSP430X_ABS20_EXT_DST,
5582 BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5583 BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5584 BFD_RELOC_MSP430X_ABS20_ADR_DST,
5585 BFD_RELOC_MSP430X_PCR16,
5586 BFD_RELOC_MSP430X_PCR20_CALL,
5587 BFD_RELOC_MSP430X_ABS16,
5588 BFD_RELOC_MSP430_ABS_HI16,
5589 BFD_RELOC_MSP430_PREL31,
5590 BFD_RELOC_MSP430_SYM_DIFF,
5591
5592/* Relocations used by the Altera Nios II core. */
5593 BFD_RELOC_NIOS2_S16,
5594 BFD_RELOC_NIOS2_U16,
5595 BFD_RELOC_NIOS2_CALL26,
5596 BFD_RELOC_NIOS2_IMM5,
5597 BFD_RELOC_NIOS2_CACHE_OPX,
5598 BFD_RELOC_NIOS2_IMM6,
5599 BFD_RELOC_NIOS2_IMM8,
5600 BFD_RELOC_NIOS2_HI16,
5601 BFD_RELOC_NIOS2_LO16,
5602 BFD_RELOC_NIOS2_HIADJ16,
5603 BFD_RELOC_NIOS2_GPREL,
5604 BFD_RELOC_NIOS2_UJMP,
5605 BFD_RELOC_NIOS2_CJMP,
5606 BFD_RELOC_NIOS2_CALLR,
5607 BFD_RELOC_NIOS2_ALIGN,
5608 BFD_RELOC_NIOS2_GOT16,
5609 BFD_RELOC_NIOS2_CALL16,
5610 BFD_RELOC_NIOS2_GOTOFF_LO,
5611 BFD_RELOC_NIOS2_GOTOFF_HA,
5612 BFD_RELOC_NIOS2_PCREL_LO,
5613 BFD_RELOC_NIOS2_PCREL_HA,
5614 BFD_RELOC_NIOS2_TLS_GD16,
5615 BFD_RELOC_NIOS2_TLS_LDM16,
5616 BFD_RELOC_NIOS2_TLS_LDO16,
5617 BFD_RELOC_NIOS2_TLS_IE16,
5618 BFD_RELOC_NIOS2_TLS_LE16,
5619 BFD_RELOC_NIOS2_TLS_DTPMOD,
5620 BFD_RELOC_NIOS2_TLS_DTPREL,
5621 BFD_RELOC_NIOS2_TLS_TPREL,
5622 BFD_RELOC_NIOS2_COPY,
5623 BFD_RELOC_NIOS2_GLOB_DAT,
5624 BFD_RELOC_NIOS2_JUMP_SLOT,
5625 BFD_RELOC_NIOS2_RELATIVE,
5626 BFD_RELOC_NIOS2_GOTOFF,
5627 BFD_RELOC_NIOS2_CALL26_NOAT,
5628 BFD_RELOC_NIOS2_GOT_LO,
5629 BFD_RELOC_NIOS2_GOT_HA,
5630 BFD_RELOC_NIOS2_CALL_LO,
5631 BFD_RELOC_NIOS2_CALL_HA,
5632 BFD_RELOC_NIOS2_R2_S12,
5633 BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5634 BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5635 BFD_RELOC_NIOS2_R2_T1I7_2,
5636 BFD_RELOC_NIOS2_R2_T2I4,
5637 BFD_RELOC_NIOS2_R2_T2I4_1,
5638 BFD_RELOC_NIOS2_R2_T2I4_2,
5639 BFD_RELOC_NIOS2_R2_X1I7_2,
5640 BFD_RELOC_NIOS2_R2_X2L5,
5641 BFD_RELOC_NIOS2_R2_F1I5_2,
5642 BFD_RELOC_NIOS2_R2_L5I4X1,
5643 BFD_RELOC_NIOS2_R2_T1X1I6,
5644 BFD_RELOC_NIOS2_R2_T1X1I6_2,
5645
5646/* PRU LDI 16-bit unsigned data-memory relocation. */
5647 BFD_RELOC_PRU_U16,
5648
5649/* PRU LDI 16-bit unsigned instruction-memory relocation. */
5650 BFD_RELOC_PRU_U16_PMEMIMM,
5651
5652/* PRU relocation for two consecutive LDI load instructions that load a
565332 bit value into a register. If the higher bits are all zero, then
5654the second instruction may be relaxed. */
5655 BFD_RELOC_PRU_LDI32,
5656
5657/* PRU QBBx 10-bit signed PC-relative relocation. */
5658 BFD_RELOC_PRU_S10_PCREL,
5659
5660/* PRU 8-bit unsigned relocation used for the LOOP instruction. */
5661 BFD_RELOC_PRU_U8_PCREL,
5662
5663/* PRU Program Memory relocations. Used to convert from byte addressing to
566432-bit word addressing. */
5665 BFD_RELOC_PRU_32_PMEM,
5666 BFD_RELOC_PRU_16_PMEM,
5667
5668/* PRU relocations to mark the difference of two local symbols.
5669These are only needed to support linker relaxation and can be ignored
5670when not relaxing. The field is set to the value of the difference
5671assuming no relaxation. The relocation encodes the position of the
5672second symbol so the linker can determine whether to adjust the field
5673value. The PMEM variants encode the word difference, instead of byte
5674difference between symbols. */
5675 BFD_RELOC_PRU_GNU_DIFF8,
5676 BFD_RELOC_PRU_GNU_DIFF16,
5677 BFD_RELOC_PRU_GNU_DIFF32,
5678 BFD_RELOC_PRU_GNU_DIFF16_PMEM,
5679 BFD_RELOC_PRU_GNU_DIFF32_PMEM,
5680
5681/* IQ2000 Relocations. */
5682 BFD_RELOC_IQ2000_OFFSET_16,
5683 BFD_RELOC_IQ2000_OFFSET_21,
5684 BFD_RELOC_IQ2000_UHI16,
5685
5686/* Special Xtensa relocation used only by PLT entries in ELF shared
5687objects to indicate that the runtime linker should set the value
5688to one of its own internal functions or data structures. */
5689 BFD_RELOC_XTENSA_RTLD,
5690
5691/* Xtensa relocations for ELF shared objects. */
5692 BFD_RELOC_XTENSA_GLOB_DAT,
5693 BFD_RELOC_XTENSA_JMP_SLOT,
5694 BFD_RELOC_XTENSA_RELATIVE,
5695
5696/* Xtensa relocation used in ELF object files for symbols that may require
5697PLT entries. Otherwise, this is just a generic 32-bit relocation. */
5698 BFD_RELOC_XTENSA_PLT,
5699
5700/* Xtensa relocations to mark the difference of two local symbols.
5701These are only needed to support linker relaxation and can be ignored
5702when not relaxing. The field is set to the value of the difference
5703assuming no relaxation. The relocation encodes the position of the
5704first symbol so the linker can determine whether to adjust the field
5705value. */
5706 BFD_RELOC_XTENSA_DIFF8,
5707 BFD_RELOC_XTENSA_DIFF16,
5708 BFD_RELOC_XTENSA_DIFF32,
5709
5710/* Generic Xtensa relocations for instruction operands. Only the slot
5711number is encoded in the relocation. The relocation applies to the
5712last PC-relative immediate operand, or if there are no PC-relative
5713immediates, to the last immediate operand. */
5714 BFD_RELOC_XTENSA_SLOT0_OP,
5715 BFD_RELOC_XTENSA_SLOT1_OP,
5716 BFD_RELOC_XTENSA_SLOT2_OP,
5717 BFD_RELOC_XTENSA_SLOT3_OP,
5718 BFD_RELOC_XTENSA_SLOT4_OP,
5719 BFD_RELOC_XTENSA_SLOT5_OP,
5720 BFD_RELOC_XTENSA_SLOT6_OP,
5721 BFD_RELOC_XTENSA_SLOT7_OP,
5722 BFD_RELOC_XTENSA_SLOT8_OP,
5723 BFD_RELOC_XTENSA_SLOT9_OP,
5724 BFD_RELOC_XTENSA_SLOT10_OP,
5725 BFD_RELOC_XTENSA_SLOT11_OP,
5726 BFD_RELOC_XTENSA_SLOT12_OP,
5727 BFD_RELOC_XTENSA_SLOT13_OP,
5728 BFD_RELOC_XTENSA_SLOT14_OP,
5729
5730/* Alternate Xtensa relocations. Only the slot is encoded in the
5731relocation. The meaning of these relocations is opcode-specific. */
5732 BFD_RELOC_XTENSA_SLOT0_ALT,
5733 BFD_RELOC_XTENSA_SLOT1_ALT,
5734 BFD_RELOC_XTENSA_SLOT2_ALT,
5735 BFD_RELOC_XTENSA_SLOT3_ALT,
5736 BFD_RELOC_XTENSA_SLOT4_ALT,
5737 BFD_RELOC_XTENSA_SLOT5_ALT,
5738 BFD_RELOC_XTENSA_SLOT6_ALT,
5739 BFD_RELOC_XTENSA_SLOT7_ALT,
5740 BFD_RELOC_XTENSA_SLOT8_ALT,
5741 BFD_RELOC_XTENSA_SLOT9_ALT,
5742 BFD_RELOC_XTENSA_SLOT10_ALT,
5743 BFD_RELOC_XTENSA_SLOT11_ALT,
5744 BFD_RELOC_XTENSA_SLOT12_ALT,
5745 BFD_RELOC_XTENSA_SLOT13_ALT,
5746 BFD_RELOC_XTENSA_SLOT14_ALT,
5747
5748/* Xtensa relocations for backward compatibility. These have all been
5749replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
5750 BFD_RELOC_XTENSA_OP0,
5751 BFD_RELOC_XTENSA_OP1,
5752 BFD_RELOC_XTENSA_OP2,
5753
5754/* Xtensa relocation to mark that the assembler expanded the
5755instructions from an original target. The expansion size is
5756encoded in the reloc size. */
5757 BFD_RELOC_XTENSA_ASM_EXPAND,
5758
5759/* Xtensa relocation to mark that the linker should simplify
5760assembler-expanded instructions. This is commonly used
5761internally by the linker after analysis of a
5762BFD_RELOC_XTENSA_ASM_EXPAND. */
5763 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5764
5765/* Xtensa TLS relocations. */
5766 BFD_RELOC_XTENSA_TLSDESC_FN,
5767 BFD_RELOC_XTENSA_TLSDESC_ARG,
5768 BFD_RELOC_XTENSA_TLS_DTPOFF,
5769 BFD_RELOC_XTENSA_TLS_TPOFF,
5770 BFD_RELOC_XTENSA_TLS_FUNC,
5771 BFD_RELOC_XTENSA_TLS_ARG,
5772 BFD_RELOC_XTENSA_TLS_CALL,
5773
5774/* 8 bit signed offset in (ix+d) or (iy+d). */
5775 BFD_RELOC_Z80_DISP8,
5776
5777/* DJNZ offset. */
5778 BFD_RELOC_Z8K_DISP7,
5779
5780/* CALR offset. */
5781 BFD_RELOC_Z8K_CALLR,
5782
5783/* 4 bit value. */
5784 BFD_RELOC_Z8K_IMM4L,
5785
5786/* Lattice Mico32 relocations. */
5787 BFD_RELOC_LM32_CALL,
5788 BFD_RELOC_LM32_BRANCH,
5789 BFD_RELOC_LM32_16_GOT,
5790 BFD_RELOC_LM32_GOTOFF_HI16,
5791 BFD_RELOC_LM32_GOTOFF_LO16,
5792 BFD_RELOC_LM32_COPY,
5793 BFD_RELOC_LM32_GLOB_DAT,
5794 BFD_RELOC_LM32_JMP_SLOT,
5795 BFD_RELOC_LM32_RELATIVE,
5796
5797/* Difference between two section addreses. Must be followed by a
5798BFD_RELOC_MACH_O_PAIR. */
5799 BFD_RELOC_MACH_O_SECTDIFF,
5800
5801/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */
5802 BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5803
5804/* Pair of relocation. Contains the first symbol. */
5805 BFD_RELOC_MACH_O_PAIR,
5806
5807/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */
5808 BFD_RELOC_MACH_O_SUBTRACTOR32,
5809
5810/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */
5811 BFD_RELOC_MACH_O_SUBTRACTOR64,
5812
5813/* PCREL relocations. They are marked as branch to create PLT entry if
5814required. */
5815 BFD_RELOC_MACH_O_X86_64_BRANCH32,
5816 BFD_RELOC_MACH_O_X86_64_BRANCH8,
5817
5818/* Used when referencing a GOT entry. */
5819 BFD_RELOC_MACH_O_X86_64_GOT,
5820
5821/* Used when loading a GOT entry with movq. It is specially marked so that
5822the linker could optimize the movq to a leaq if possible. */
5823 BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5824
5825/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */
5826 BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5827
5828/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */
5829 BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5830
5831/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
5832 BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5833
5834/* Used when referencing a TLV entry. */
5835 BFD_RELOC_MACH_O_X86_64_TLV,
5836
5837/* Addend for PAGE or PAGEOFF. */
5838 BFD_RELOC_MACH_O_ARM64_ADDEND,
5839
5840/* Relative offset to page of GOT slot. */
5841 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5842
5843/* Relative offset within page of GOT slot. */
5844 BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5845
5846/* Address of a GOT entry. */
5847 BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5848
5849/* This is a 32 bit reloc for the microblaze that stores the
5850low 16 bits of a value */
5851 BFD_RELOC_MICROBLAZE_32_LO,
5852
5853/* This is a 32 bit pc-relative reloc for the microblaze that
5854stores the low 16 bits of a value */
5855 BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5856
5857/* This is a 32 bit reloc for the microblaze that stores a
5858value relative to the read-only small data area anchor */
5859 BFD_RELOC_MICROBLAZE_32_ROSDA,
5860
5861/* This is a 32 bit reloc for the microblaze that stores a
5862value relative to the read-write small data area anchor */
5863 BFD_RELOC_MICROBLAZE_32_RWSDA,
5864
5865/* This is a 32 bit reloc for the microblaze to handle
5866expressions of the form "Symbol Op Symbol" */
5867 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5868
5869/* This is a 64 bit reloc that stores the 32 bit pc relative
5870value in two words (with an imm instruction). No relocation is
5871done here - only used for relaxing */
5872 BFD_RELOC_MICROBLAZE_64_NONE,
5873
5874/* This is a 64 bit reloc that stores the 32 bit pc relative
5875value in two words (with an imm instruction). The relocation is
5876PC-relative GOT offset */
5877 BFD_RELOC_MICROBLAZE_64_GOTPC,
5878
5879/* This is a 64 bit reloc that stores the 32 bit pc relative
5880value in two words (with an imm instruction). The relocation is
5881GOT offset */
5882 BFD_RELOC_MICROBLAZE_64_GOT,
5883
5884/* This is a 64 bit reloc that stores the 32 bit pc relative
5885value in two words (with an imm instruction). The relocation is
5886PC-relative offset into PLT */
5887 BFD_RELOC_MICROBLAZE_64_PLT,
5888
5889/* This is a 64 bit reloc that stores the 32 bit GOT relative
5890value in two words (with an imm instruction). The relocation is
5891relative offset from _GLOBAL_OFFSET_TABLE_ */
5892 BFD_RELOC_MICROBLAZE_64_GOTOFF,
5893
5894/* This is a 32 bit reloc that stores the 32 bit GOT relative
5895value in a word. The relocation is relative offset from */
5896 BFD_RELOC_MICROBLAZE_32_GOTOFF,
5897
5898/* This is used to tell the dynamic linker to copy the value out of
5899the dynamic object into the runtime process image. */
5900 BFD_RELOC_MICROBLAZE_COPY,
5901
5902/* Unused Reloc */
5903 BFD_RELOC_MICROBLAZE_64_TLS,
5904
5905/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5906of the GOT TLS GD info entry in two words (with an imm instruction). The
5907relocation is GOT offset. */
5908 BFD_RELOC_MICROBLAZE_64_TLSGD,
5909
5910/* This is a 64 bit reloc that stores the 32 bit GOT relative value
5911of the GOT TLS LD info entry in two words (with an imm instruction). The
5912relocation is GOT offset. */
5913 BFD_RELOC_MICROBLAZE_64_TLSLD,
5914
5915/* This is a 32 bit reloc that stores the Module ID to GOT(n). */
5916 BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5917
5918/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */
5919 BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5920
5921/* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5922instruction) */
5923 BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5924
5925/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5926to two words (uses imm instruction). */
5927 BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5928
5929/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5930to two words (uses imm instruction). */
5931 BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5932
5933/* This is a 64 bit reloc that stores the 32 bit pc relative
5934value in two words (with an imm instruction). The relocation is
5935PC-relative offset from start of TEXT. */
5936 BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
5937
5938/* This is a 64 bit reloc that stores the 32 bit offset
5939value in two words (with an imm instruction). The relocation is
5940relative offset from start of TEXT. */
5941 BFD_RELOC_MICROBLAZE_64_TEXTREL,
5942
5943/* AArch64 pseudo relocation code to mark the start of the AArch64
5944relocation enumerators. N.B. the order of the enumerators is
5945important as several tables in the AArch64 bfd backend are indexed
5946by these enumerators; make sure they are all synced. */
5947 BFD_RELOC_AARCH64_RELOC_START,
5948
5949/* Deprecated AArch64 null relocation code. */
5950 BFD_RELOC_AARCH64_NULL,
5951
5952/* AArch64 null relocation code. */
5953 BFD_RELOC_AARCH64_NONE,
5954
5955/* Basic absolute relocations of N bits. These are equivalent to
5956BFD_RELOC_N and they were added to assist the indexing of the howto
5957table. */
5958 BFD_RELOC_AARCH64_64,
5959 BFD_RELOC_AARCH64_32,
5960 BFD_RELOC_AARCH64_16,
5961
5962/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL
5963and they were added to assist the indexing of the howto table. */
5964 BFD_RELOC_AARCH64_64_PCREL,
5965 BFD_RELOC_AARCH64_32_PCREL,
5966 BFD_RELOC_AARCH64_16_PCREL,
5967
5968/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5969of an unsigned address/value. */
5970 BFD_RELOC_AARCH64_MOVW_G0,
5971
5972/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5973an address/value. No overflow checking. */
5974 BFD_RELOC_AARCH64_MOVW_G0_NC,
5975
5976/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5977of an unsigned address/value. */
5978 BFD_RELOC_AARCH64_MOVW_G1,
5979
5980/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5981of an address/value. No overflow checking. */
5982 BFD_RELOC_AARCH64_MOVW_G1_NC,
5983
5984/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5985of an unsigned address/value. */
5986 BFD_RELOC_AARCH64_MOVW_G2,
5987
5988/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5989of an address/value. No overflow checking. */
5990 BFD_RELOC_AARCH64_MOVW_G2_NC,
5991
5992/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5993of a signed or unsigned address/value. */
5994 BFD_RELOC_AARCH64_MOVW_G3,
5995
5996/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5997of a signed value. Changes instruction to MOVZ or MOVN depending on the
5998value's sign. */
5999 BFD_RELOC_AARCH64_MOVW_G0_S,
6000
6001/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
6002of a signed value. Changes instruction to MOVZ or MOVN depending on the
6003value's sign. */
6004 BFD_RELOC_AARCH64_MOVW_G1_S,
6005
6006/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
6007of a signed value. Changes instruction to MOVZ or MOVN depending on the
6008value's sign. */
6009 BFD_RELOC_AARCH64_MOVW_G2_S,
6010
6011/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6012of a signed value. Changes instruction to MOVZ or MOVN depending on the
6013value's sign. */
6014 BFD_RELOC_AARCH64_MOVW_PREL_G0,
6015
6016/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
6017of a signed value. Changes instruction to MOVZ or MOVN depending on the
6018value's sign. */
6019 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
6020
6021/* AArch64 MOVK instruction with most significant bits 16 to 31
6022of a signed value. */
6023 BFD_RELOC_AARCH64_MOVW_PREL_G1,
6024
6025/* AArch64 MOVK instruction with most significant bits 16 to 31
6026of a signed value. */
6027 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
6028
6029/* AArch64 MOVK instruction with most significant bits 32 to 47
6030of a signed value. */
6031 BFD_RELOC_AARCH64_MOVW_PREL_G2,
6032
6033/* AArch64 MOVK instruction with most significant bits 32 to 47
6034of a signed value. */
6035 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
6036
6037/* AArch64 MOVK instruction with most significant bits 47 to 63
6038of a signed value. */
6039 BFD_RELOC_AARCH64_MOVW_PREL_G3,
6040
6041/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
6042offset. The lowest two bits must be zero and are not stored in the
6043instruction, giving a 21 bit signed byte offset. */
6044 BFD_RELOC_AARCH64_LD_LO19_PCREL,
6045
6046/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */
6047 BFD_RELOC_AARCH64_ADR_LO21_PCREL,
6048
6049/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6050offset, giving a 4KB aligned page base address. */
6051 BFD_RELOC_AARCH64_ADR_HI21_PCREL,
6052
6053/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
6054offset, giving a 4KB aligned page base address, but with no overflow
6055checking. */
6056 BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
6057
6058/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
6059Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6060 BFD_RELOC_AARCH64_ADD_LO12,
6061
6062/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
6063address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6064 BFD_RELOC_AARCH64_LDST8_LO12,
6065
6066/* AArch64 14 bit pc-relative test bit and branch.
6067The lowest two bits must be zero and are not stored in the instruction,
6068giving a 16 bit signed byte offset. */
6069 BFD_RELOC_AARCH64_TSTBR14,
6070
6071/* AArch64 19 bit pc-relative conditional branch and compare & branch.
6072The lowest two bits must be zero and are not stored in the instruction,
6073giving a 21 bit signed byte offset. */
6074 BFD_RELOC_AARCH64_BRANCH19,
6075
6076/* AArch64 26 bit pc-relative unconditional branch.
6077The lowest two bits must be zero and are not stored in the instruction,
6078giving a 28 bit signed byte offset. */
6079 BFD_RELOC_AARCH64_JUMP26,
6080
6081/* AArch64 26 bit pc-relative unconditional branch and link.
6082The lowest two bits must be zero and are not stored in the instruction,
6083giving a 28 bit signed byte offset. */
6084 BFD_RELOC_AARCH64_CALL26,
6085
6086/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
6087address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6088 BFD_RELOC_AARCH64_LDST16_LO12,
6089
6090/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
6091address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6092 BFD_RELOC_AARCH64_LDST32_LO12,
6093
6094/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
6095address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6096 BFD_RELOC_AARCH64_LDST64_LO12,
6097
6098/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
6099address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6100 BFD_RELOC_AARCH64_LDST128_LO12,
6101
6102/* AArch64 Load Literal instruction, holding a 19 bit PC relative word
6103offset of the global offset table entry for a symbol. The lowest two
6104bits must be zero and are not stored in the instruction, giving a 21
6105bit signed byte offset. This relocation type requires signed overflow
6106checking. */
6107 BFD_RELOC_AARCH64_GOT_LD_PREL19,
6108
6109/* Get to the page base of the global offset table entry for a symbol as
6110part of an ADRP instruction using a 21 bit PC relative value.Used in
6111conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */
6112 BFD_RELOC_AARCH64_ADR_GOT_PAGE,
6113
6114/* Unsigned 12 bit byte offset for 64 bit load/store from the page of
6115the GOT entry for this symbol. Used in conjunction with
6116BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */
6117 BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
6118
6119/* Unsigned 12 bit byte offset for 32 bit load/store from the page of
6120the GOT entry for this symbol. Used in conjunction with
6121BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */
6122 BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
6123
6124/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
6125for this symbol. Valid in LP64 ABI only. */
6126 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
6127
6128/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
6129for this symbol. Valid in LP64 ABI only. */
6130 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
6131
6132/* Unsigned 15 bit byte offset for 64 bit load/store from the page of
6133the GOT entry for this symbol. Valid in LP64 ABI only. */
6134 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
6135
6136/* Scaled 14 bit byte offset to the page base of the global offset table. */
6137 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
6138
6139/* Scaled 15 bit byte offset to the page base of the global offset table. */
6140 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
6141
6142/* Get to the page base of the global offset table entry for a symbols
6143tls_index structure as part of an adrp instruction using a 21 bit PC
6144relative value. Used in conjunction with
6145BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */
6146 BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
6147
6148/* AArch64 TLS General Dynamic */
6149 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
6150
6151/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6152tls_index structure. Used in conjunction with
6153BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
6154 BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
6155
6156/* AArch64 TLS General Dynamic relocation. */
6157 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
6158
6159/* AArch64 TLS General Dynamic relocation. */
6160 BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
6161
6162/* AArch64 TLS INITIAL EXEC relocation. */
6163 BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
6164
6165/* AArch64 TLS INITIAL EXEC relocation. */
6166 BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
6167
6168/* AArch64 TLS INITIAL EXEC relocation. */
6169 BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
6170
6171/* AArch64 TLS INITIAL EXEC relocation. */
6172 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
6173
6174/* AArch64 TLS INITIAL EXEC relocation. */
6175 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
6176
6177/* AArch64 TLS INITIAL EXEC relocation. */
6178 BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
6179
6180/* bit[23:12] of byte offset to module TLS base address. */
6181 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
6182
6183/* Unsigned 12 bit byte offset to module TLS base address. */
6184 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
6185
6186/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
6187 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
6188
6189/* Unsigned 12 bit byte offset to global offset table entry for a symbols
6190tls_index structure. Used in conjunction with
6191BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */
6192 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
6193
6194/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
6195instruction. */
6196 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
6197
6198/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */
6199 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
6200
6201/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6202instructions. */
6203 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
6204
6205/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */
6206 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
6207
6208/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6209instructions. */
6210 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
6211
6212/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */
6213 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
6214
6215/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6216instructions. */
6217 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
6218
6219/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */
6220 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
6221
6222/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6223instructions. */
6224 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
6225
6226/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */
6227 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
6228
6229/* bit[15:0] of byte offset to module TLS base address. */
6230 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
6231
6232/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */
6233 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
6234
6235/* bit[31:16] of byte offset to module TLS base address. */
6236 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
6237
6238/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */
6239 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
6240
6241/* bit[47:32] of byte offset to module TLS base address. */
6242 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
6243
6244/* AArch64 TLS LOCAL EXEC relocation. */
6245 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
6246
6247/* AArch64 TLS LOCAL EXEC relocation. */
6248 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
6249
6250/* AArch64 TLS LOCAL EXEC relocation. */
6251 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
6252
6253/* AArch64 TLS LOCAL EXEC relocation. */
6254 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
6255
6256/* AArch64 TLS LOCAL EXEC relocation. */
6257 BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
6258
6259/* AArch64 TLS LOCAL EXEC relocation. */
6260 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
6261
6262/* AArch64 TLS LOCAL EXEC relocation. */
6263 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
6264
6265/* AArch64 TLS LOCAL EXEC relocation. */
6266 BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
6267
6268/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
6269instructions. */
6270 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
6271
6272/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */
6273 BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
6274
6275/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
6276instructions. */
6277 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
6278
6279/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */
6280 BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
6281
6282/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
6283instructions. */
6284 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
6285
6286/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */
6287 BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
6288
6289/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
6290instructions. */
6291 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
6292
6293/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */
6294 BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
6295
6296/* AArch64 TLS DESC relocation. */
6297 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
6298
6299/* AArch64 TLS DESC relocation. */
6300 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
6301
6302/* AArch64 TLS DESC relocation. */
6303 BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
6304
6305/* AArch64 TLS DESC relocation. */
6306 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
6307
6308/* AArch64 TLS DESC relocation. */
6309 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
6310
6311/* AArch64 TLS DESC relocation. */
6312 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
6313
6314/* AArch64 TLS DESC relocation. */
6315 BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
6316
6317/* AArch64 TLS DESC relocation. */
6318 BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
6319
6320/* AArch64 TLS DESC relocation. */
6321 BFD_RELOC_AARCH64_TLSDESC_LDR,
6322
6323/* AArch64 TLS DESC relocation. */
6324 BFD_RELOC_AARCH64_TLSDESC_ADD,
6325
6326/* AArch64 TLS DESC relocation. */
6327 BFD_RELOC_AARCH64_TLSDESC_CALL,
6328
6329/* AArch64 TLS relocation. */
6330 BFD_RELOC_AARCH64_COPY,
6331
6332/* AArch64 TLS relocation. */
6333 BFD_RELOC_AARCH64_GLOB_DAT,
6334
6335/* AArch64 TLS relocation. */
6336 BFD_RELOC_AARCH64_JUMP_SLOT,
6337
6338/* AArch64 TLS relocation. */
6339 BFD_RELOC_AARCH64_RELATIVE,
6340
6341/* AArch64 TLS relocation. */
6342 BFD_RELOC_AARCH64_TLS_DTPMOD,
6343
6344/* AArch64 TLS relocation. */
6345 BFD_RELOC_AARCH64_TLS_DTPREL,
6346
6347/* AArch64 TLS relocation. */
6348 BFD_RELOC_AARCH64_TLS_TPREL,
6349
6350/* AArch64 TLS relocation. */
6351 BFD_RELOC_AARCH64_TLSDESC,
6352
6353/* AArch64 support for STT_GNU_IFUNC. */
6354 BFD_RELOC_AARCH64_IRELATIVE,
6355
6356/* AArch64 pseudo relocation code to mark the end of the AArch64
6357relocation enumerators that have direct mapping to ELF reloc codes.
6358There are a few more enumerators after this one; those are mainly
6359used by the AArch64 assembler for the internal fixup or to select
6360one of the above enumerators. */
6361 BFD_RELOC_AARCH64_RELOC_END,
6362
6363/* AArch64 pseudo relocation code to be used internally by the AArch64
6364assembler and not (currently) written to any object files. */
6365 BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
6366
6367/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
6368address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */
6369 BFD_RELOC_AARCH64_LDST_LO12,
6370
6371/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be
6372used internally by the AArch64 assembler and not (currently) written to
6373any object files. */
6374 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
6375
6376/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */
6377 BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
6378
6379/* AArch64 pseudo relocation code for TLS local exec mode. It's to be
6380used internally by the AArch64 assembler and not (currently) written to
6381any object files. */
6382 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
6383
6384/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */
6385 BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
6386
6387/* AArch64 pseudo relocation code to be used internally by the AArch64
6388assembler and not (currently) written to any object files. */
6389 BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
6390
6391/* AArch64 pseudo relocation code to be used internally by the AArch64
6392assembler and not (currently) written to any object files. */
6393 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
6394
6395/* AArch64 pseudo relocation code to be used internally by the AArch64
6396assembler and not (currently) written to any object files. */
6397 BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
6398
6399/* Tilera TILEPro Relocations. */
6400 BFD_RELOC_TILEPRO_COPY,
6401 BFD_RELOC_TILEPRO_GLOB_DAT,
6402 BFD_RELOC_TILEPRO_JMP_SLOT,
6403 BFD_RELOC_TILEPRO_RELATIVE,
6404 BFD_RELOC_TILEPRO_BROFF_X1,
6405 BFD_RELOC_TILEPRO_JOFFLONG_X1,
6406 BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
6407 BFD_RELOC_TILEPRO_IMM8_X0,
6408 BFD_RELOC_TILEPRO_IMM8_Y0,
6409 BFD_RELOC_TILEPRO_IMM8_X1,
6410 BFD_RELOC_TILEPRO_IMM8_Y1,
6411 BFD_RELOC_TILEPRO_DEST_IMM8_X1,
6412 BFD_RELOC_TILEPRO_MT_IMM15_X1,
6413 BFD_RELOC_TILEPRO_MF_IMM15_X1,
6414 BFD_RELOC_TILEPRO_IMM16_X0,
6415 BFD_RELOC_TILEPRO_IMM16_X1,
6416 BFD_RELOC_TILEPRO_IMM16_X0_LO,
6417 BFD_RELOC_TILEPRO_IMM16_X1_LO,
6418 BFD_RELOC_TILEPRO_IMM16_X0_HI,
6419 BFD_RELOC_TILEPRO_IMM16_X1_HI,
6420 BFD_RELOC_TILEPRO_IMM16_X0_HA,
6421 BFD_RELOC_TILEPRO_IMM16_X1_HA,
6422 BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
6423 BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
6424 BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
6425 BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
6426 BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
6427 BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
6428 BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6429 BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6430 BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6431 BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6432 BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6433 BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6434 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6435 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6436 BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6437 BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6438 BFD_RELOC_TILEPRO_MMSTART_X0,
6439 BFD_RELOC_TILEPRO_MMEND_X0,
6440 BFD_RELOC_TILEPRO_MMSTART_X1,
6441 BFD_RELOC_TILEPRO_MMEND_X1,
6442 BFD_RELOC_TILEPRO_SHAMT_X0,
6443 BFD_RELOC_TILEPRO_SHAMT_X1,
6444 BFD_RELOC_TILEPRO_SHAMT_Y0,
6445 BFD_RELOC_TILEPRO_SHAMT_Y1,
6446 BFD_RELOC_TILEPRO_TLS_GD_CALL,
6447 BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6448 BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6449 BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6450 BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6451 BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6452 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6453 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6454 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6455 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6456 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6457 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6458 BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6459 BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6460 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6461 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6462 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6463 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6464 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6465 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6466 BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6467 BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6468 BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6469 BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6470 BFD_RELOC_TILEPRO_TLS_TPOFF32,
6471 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6472 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6473 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6474 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6475 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6476 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6477 BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6478 BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6479
6480/* Tilera TILE-Gx Relocations. */
6481 BFD_RELOC_TILEGX_HW0,
6482 BFD_RELOC_TILEGX_HW1,
6483 BFD_RELOC_TILEGX_HW2,
6484 BFD_RELOC_TILEGX_HW3,
6485 BFD_RELOC_TILEGX_HW0_LAST,
6486 BFD_RELOC_TILEGX_HW1_LAST,
6487 BFD_RELOC_TILEGX_HW2_LAST,
6488 BFD_RELOC_TILEGX_COPY,
6489 BFD_RELOC_TILEGX_GLOB_DAT,
6490 BFD_RELOC_TILEGX_JMP_SLOT,
6491 BFD_RELOC_TILEGX_RELATIVE,
6492 BFD_RELOC_TILEGX_BROFF_X1,
6493 BFD_RELOC_TILEGX_JUMPOFF_X1,
6494 BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6495 BFD_RELOC_TILEGX_IMM8_X0,
6496 BFD_RELOC_TILEGX_IMM8_Y0,
6497 BFD_RELOC_TILEGX_IMM8_X1,
6498 BFD_RELOC_TILEGX_IMM8_Y1,
6499 BFD_RELOC_TILEGX_DEST_IMM8_X1,
6500 BFD_RELOC_TILEGX_MT_IMM14_X1,
6501 BFD_RELOC_TILEGX_MF_IMM14_X1,
6502 BFD_RELOC_TILEGX_MMSTART_X0,
6503 BFD_RELOC_TILEGX_MMEND_X0,
6504 BFD_RELOC_TILEGX_SHAMT_X0,
6505 BFD_RELOC_TILEGX_SHAMT_X1,
6506 BFD_RELOC_TILEGX_SHAMT_Y0,
6507 BFD_RELOC_TILEGX_SHAMT_Y1,
6508 BFD_RELOC_TILEGX_IMM16_X0_HW0,
6509 BFD_RELOC_TILEGX_IMM16_X1_HW0,
6510 BFD_RELOC_TILEGX_IMM16_X0_HW1,
6511 BFD_RELOC_TILEGX_IMM16_X1_HW1,
6512 BFD_RELOC_TILEGX_IMM16_X0_HW2,
6513 BFD_RELOC_TILEGX_IMM16_X1_HW2,
6514 BFD_RELOC_TILEGX_IMM16_X0_HW3,
6515 BFD_RELOC_TILEGX_IMM16_X1_HW3,
6516 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6517 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6518 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6519 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6520 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6521 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6522 BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6523 BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6524 BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6525 BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6526 BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6527 BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6528 BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6529 BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6530 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6531 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6532 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6533 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6534 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6535 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6536 BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6537 BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6538 BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6539 BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6540 BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6541 BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6542 BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6543 BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6544 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6545 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6546 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6547 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6548 BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6549 BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6550 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6551 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6552 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6553 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6554 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6555 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6556 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6557 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6558 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6559 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6560 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6561 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6562 BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6563 BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6564 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6565 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6566 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6567 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6568 BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6569 BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6570 BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6571 BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6572 BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6573 BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6574 BFD_RELOC_TILEGX_TLS_DTPMOD64,
6575 BFD_RELOC_TILEGX_TLS_DTPOFF64,
6576 BFD_RELOC_TILEGX_TLS_TPOFF64,
6577 BFD_RELOC_TILEGX_TLS_DTPMOD32,
6578 BFD_RELOC_TILEGX_TLS_DTPOFF32,
6579 BFD_RELOC_TILEGX_TLS_TPOFF32,
6580 BFD_RELOC_TILEGX_TLS_GD_CALL,
6581 BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6582 BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6583 BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6584 BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6585 BFD_RELOC_TILEGX_TLS_IE_LOAD,
6586 BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6587 BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6588 BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6589 BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6590
6591/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
6592 BFD_RELOC_EPIPHANY_SIMM8,
6593
6594/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */
6595 BFD_RELOC_EPIPHANY_SIMM24,
6596
6597/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */
6598 BFD_RELOC_EPIPHANY_HIGH,
6599
6600/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */
6601 BFD_RELOC_EPIPHANY_LOW,
6602
6603/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */
6604 BFD_RELOC_EPIPHANY_SIMM11,
6605
6606/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */
6607 BFD_RELOC_EPIPHANY_IMM11,
6608
6609/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
6610 BFD_RELOC_EPIPHANY_IMM8,
6611
6612/* Visium Relocations. */
6613 BFD_RELOC_VISIUM_HI16,
6614 BFD_RELOC_VISIUM_LO16,
6615 BFD_RELOC_VISIUM_IM16,
6616 BFD_RELOC_VISIUM_REL16,
6617 BFD_RELOC_VISIUM_HI16_PCREL,
6618 BFD_RELOC_VISIUM_LO16_PCREL,
6619 BFD_RELOC_VISIUM_IM16_PCREL,
6620
6621/* WebAssembly relocations. */
6622 BFD_RELOC_WASM32_LEB128,
6623 BFD_RELOC_WASM32_LEB128_GOT,
6624 BFD_RELOC_WASM32_LEB128_GOT_CODE,
6625 BFD_RELOC_WASM32_LEB128_PLT,
6626 BFD_RELOC_WASM32_PLT_INDEX,
6627 BFD_RELOC_WASM32_ABS32_CODE,
6628 BFD_RELOC_WASM32_COPY,
6629 BFD_RELOC_WASM32_CODE_POINTER,
6630 BFD_RELOC_WASM32_INDEX,
6631 BFD_RELOC_WASM32_PLT_SIG,
6632
6633/* C-SKY relocations. */
6634 BFD_RELOC_CKCORE_NONE,
6635 BFD_RELOC_CKCORE_ADDR32,
6636 BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6637 BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6638 BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6639 BFD_RELOC_CKCORE_PCREL32,
6640 BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6641 BFD_RELOC_CKCORE_GNU_VTINHERIT,
6642 BFD_RELOC_CKCORE_GNU_VTENTRY,
6643 BFD_RELOC_CKCORE_RELATIVE,
6644 BFD_RELOC_CKCORE_COPY,
6645 BFD_RELOC_CKCORE_GLOB_DAT,
6646 BFD_RELOC_CKCORE_JUMP_SLOT,
6647 BFD_RELOC_CKCORE_GOTOFF,
6648 BFD_RELOC_CKCORE_GOTPC,
6649 BFD_RELOC_CKCORE_GOT32,
6650 BFD_RELOC_CKCORE_PLT32,
6651 BFD_RELOC_CKCORE_ADDRGOT,
6652 BFD_RELOC_CKCORE_ADDRPLT,
6653 BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6654 BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6655 BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6656 BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6657 BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6658 BFD_RELOC_CKCORE_ADDR_HI16,
6659 BFD_RELOC_CKCORE_ADDR_LO16,
6660 BFD_RELOC_CKCORE_GOTPC_HI16,
6661 BFD_RELOC_CKCORE_GOTPC_LO16,
6662 BFD_RELOC_CKCORE_GOTOFF_HI16,
6663 BFD_RELOC_CKCORE_GOTOFF_LO16,
6664 BFD_RELOC_CKCORE_GOT12,
6665 BFD_RELOC_CKCORE_GOT_HI16,
6666 BFD_RELOC_CKCORE_GOT_LO16,
6667 BFD_RELOC_CKCORE_PLT12,
6668 BFD_RELOC_CKCORE_PLT_HI16,
6669 BFD_RELOC_CKCORE_PLT_LO16,
6670 BFD_RELOC_CKCORE_ADDRGOT_HI16,
6671 BFD_RELOC_CKCORE_ADDRGOT_LO16,
6672 BFD_RELOC_CKCORE_ADDRPLT_HI16,
6673 BFD_RELOC_CKCORE_ADDRPLT_LO16,
6674 BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6675 BFD_RELOC_CKCORE_TOFFSET_LO16,
6676 BFD_RELOC_CKCORE_DOFFSET_LO16,
6677 BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6678 BFD_RELOC_CKCORE_DOFFSET_IMM18,
6679 BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6680 BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6681 BFD_RELOC_CKCORE_GOTOFF_IMM18,
6682 BFD_RELOC_CKCORE_GOT_IMM18BY4,
6683 BFD_RELOC_CKCORE_PLT_IMM18BY4,
6684 BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6685 BFD_RELOC_CKCORE_TLS_LE32,
6686 BFD_RELOC_CKCORE_TLS_IE32,
6687 BFD_RELOC_CKCORE_TLS_GD32,
6688 BFD_RELOC_CKCORE_TLS_LDM32,
6689 BFD_RELOC_CKCORE_TLS_LDO32,
6690 BFD_RELOC_CKCORE_TLS_DTPMOD32,
6691 BFD_RELOC_CKCORE_TLS_DTPOFF32,
6692 BFD_RELOC_CKCORE_TLS_TPOFF32,
6693 BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6694 BFD_RELOC_CKCORE_NOJSRI,
6695 BFD_RELOC_CKCORE_CALLGRAPH,
6696 BFD_RELOC_CKCORE_IRELATIVE,
6697 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6698 BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6699
6700/* S12Z relocations. */
6701 BFD_RELOC_S12Z_OPR,
6702 BFD_RELOC_UNUSED };
6703
6704typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6705reloc_howto_type *bfd_reloc_type_lookup
6706 (bfd *abfd, bfd_reloc_code_real_type code);
6707reloc_howto_type *bfd_reloc_name_lookup
6708 (bfd *abfd, const char *reloc_name);
6709
6710const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6711
6712/* Extracted from syms.c. */
6713
6714typedef struct bfd_symbol
6715{
6716 /* A pointer to the BFD which owns the symbol. This information
6717 is necessary so that a back end can work out what additional
6718 information (invisible to the application writer) is carried
6719 with the symbol.
6720
6721 This field is *almost* redundant, since you can use section->owner
6722 instead, except that some symbols point to the global sections
6723 bfd_{abs,com,und}_section. This could be fixed by making
6724 these globals be per-bfd (or per-target-flavor). FIXME. */
6725 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
6726
6727 /* The text of the symbol. The name is left alone, and not copied; the
6728 application may not alter it. */
6729 const char *name;
6730
6731 /* The value of the symbol. This really should be a union of a
6732 numeric value with a pointer, since some flags indicate that
6733 a pointer to another symbol is stored here. */
6734 symvalue value;
6735
6736 /* Attributes of a symbol. */
6737#define BSF_NO_FLAGS 0
6738
6739 /* The symbol has local scope; <<static>> in <<C>>. The value
6740 is the offset into the section of the data. */
6741#define BSF_LOCAL (1 << 0)
6742
6743 /* The symbol has global scope; initialized data in <<C>>. The
6744 value is the offset into the section of the data. */
6745#define BSF_GLOBAL (1 << 1)
6746
6747 /* The symbol has global scope and is exported. The value is
6748 the offset into the section of the data. */
6749#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
6750
6751 /* A normal C symbol would be one of:
6752 <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
6753
6754 /* The symbol is a debugging record. The value has an arbitrary
6755 meaning, unless BSF_DEBUGGING_RELOC is also set. */
6756#define BSF_DEBUGGING (1 << 2)
6757
6758 /* The symbol denotes a function entry point. Used in ELF,
6759 perhaps others someday. */
6760#define BSF_FUNCTION (1 << 3)
6761
6762 /* Used by the linker. */
6763#define BSF_KEEP (1 << 5)
6764
6765 /* An ELF common symbol. */
6766#define BSF_ELF_COMMON (1 << 6)
6767
6768 /* A weak global symbol, overridable without warnings by
6769 a regular global symbol of the same name. */
6770#define BSF_WEAK (1 << 7)
6771
6772 /* This symbol was created to point to a section, e.g. ELF's
6773 STT_SECTION symbols. */
6774#define BSF_SECTION_SYM (1 << 8)
6775
6776 /* The symbol used to be a common symbol, but now it is
6777 allocated. */
6778#define BSF_OLD_COMMON (1 << 9)
6779
6780 /* In some files the type of a symbol sometimes alters its
6781 location in an output file - ie in coff a <<ISFCN>> symbol
6782 which is also <<C_EXT>> symbol appears where it was
6783 declared and not at the end of a section. This bit is set
6784 by the target BFD part to convey this information. */
6785#define BSF_NOT_AT_END (1 << 10)
6786
6787 /* Signal that the symbol is the label of constructor section. */
6788#define BSF_CONSTRUCTOR (1 << 11)
6789
6790 /* Signal that the symbol is a warning symbol. The name is a
6791 warning. The name of the next symbol is the one to warn about;
6792 if a reference is made to a symbol with the same name as the next
6793 symbol, a warning is issued by the linker. */
6794#define BSF_WARNING (1 << 12)
6795
6796 /* Signal that the symbol is indirect. This symbol is an indirect
6797 pointer to the symbol with the same name as the next symbol. */
6798#define BSF_INDIRECT (1 << 13)
6799
6800 /* BSF_FILE marks symbols that contain a file name. This is used
6801 for ELF STT_FILE symbols. */
6802#define BSF_FILE (1 << 14)
6803
6804 /* Symbol is from dynamic linking information. */
6805#define BSF_DYNAMIC (1 << 15)
6806
6807 /* The symbol denotes a data object. Used in ELF, and perhaps
6808 others someday. */
6809#define BSF_OBJECT (1 << 16)
6810
6811 /* This symbol is a debugging symbol. The value is the offset
6812 into the section of the data. BSF_DEBUGGING should be set
6813 as well. */
6814#define BSF_DEBUGGING_RELOC (1 << 17)
6815
6816 /* This symbol is thread local. Used in ELF. */
6817#define BSF_THREAD_LOCAL (1 << 18)
6818
6819 /* This symbol represents a complex relocation expression,
6820 with the expression tree serialized in the symbol name. */
6821#define BSF_RELC (1 << 19)
6822
6823 /* This symbol represents a signed complex relocation expression,
6824 with the expression tree serialized in the symbol name. */
6825#define BSF_SRELC (1 << 20)
6826
6827 /* This symbol was created by bfd_get_synthetic_symtab. */
6828#define BSF_SYNTHETIC (1 << 21)
6829
6830 /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
6831 The dynamic linker will compute the value of this symbol by
6832 calling the function that it points to. BSF_FUNCTION must
6833 also be also set. */
6834#define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6835 /* This symbol is a globally unique data object. The dynamic linker
6836 will make sure that in the entire process there is just one symbol
6837 with this name and type in use. BSF_OBJECT must also be set. */
6838#define BSF_GNU_UNIQUE (1 << 23)
6839
6840 flagword flags;
6841
6842 /* A pointer to the section to which this symbol is
6843 relative. This will always be non NULL, there are special
6844 sections for undefined and absolute symbols. */
6845 struct bfd_section *section;
6846
6847 /* Back end special data. */
6848 union
6849 {
6850 void *p;
6851 bfd_vma i;
6852 }
6853 udata;
6854}
6855asymbol;
6856
6857#define bfd_get_symtab_upper_bound(abfd) \
6858 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6859
6860bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6861
6862bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6863
6864#define bfd_is_local_label_name(abfd, name) \
6865 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6866
6867bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6868
6869#define bfd_is_target_special_symbol(abfd, sym) \
6870 BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6871
6872#define bfd_canonicalize_symtab(abfd, location) \
6873 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6874
6875bfd_boolean bfd_set_symtab
6876 (bfd *abfd, asymbol **location, unsigned int count);
6877
6878void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6879
6880#define bfd_make_empty_symbol(abfd) \
6881 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6882
6883asymbol *_bfd_generic_make_empty_symbol (bfd *);
6884
6885#define bfd_make_debug_symbol(abfd,ptr,size) \
6886 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6887
6888int bfd_decode_symclass (asymbol *symbol);
6889
6890bfd_boolean bfd_is_undefined_symclass (int symclass);
6891
6892void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6893
6894bfd_boolean bfd_copy_private_symbol_data
6895 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6896
6897#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6898 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6899 (ibfd, isymbol, obfd, osymbol))
6900
6901/* Extracted from bfd.c. */
6902
6903enum bfd_direction
6904 {
6905 no_direction = 0,
6906 read_direction = 1,
6907 write_direction = 2,
6908 both_direction = 3
6909 };
6910
6911enum bfd_plugin_format
6912 {
6913 bfd_plugin_unknown = 0,
6914 bfd_plugin_yes = 1,
6915 bfd_plugin_no = 2
6916 };
6917
6918struct bfd_build_id
6919 {
6920 bfd_size_type size;
6921 bfd_byte data[1];
6922 };
6923
6924struct bfd
6925{
6926 /* The filename the application opened the BFD with. */
6927 const char *filename;
6928
6929 /* A pointer to the target jump table. */
6930 const struct bfd_target *xvec;
6931
6932 /* The IOSTREAM, and corresponding IO vector that provide access
6933 to the file backing the BFD. */
6934 void *iostream;
6935 const struct bfd_iovec *iovec;
6936
6937 /* The caching routines use these to maintain a
6938 least-recently-used list of BFDs. */
6939 struct bfd *lru_prev, *lru_next;
6940
6941 /* Track current file position (or current buffer offset for
6942 in-memory BFDs). When a file is closed by the caching routines,
6943 BFD retains state information on the file here. */
6944 ufile_ptr where;
6945
6946 /* File modified time, if mtime_set is TRUE. */
6947 long mtime;
6948
6949 /* A unique identifier of the BFD */
6950 unsigned int id;
6951
6952 /* The format which belongs to the BFD. (object, core, etc.) */
6953 ENUM_BITFIELD (bfd_format) format : 3;
6954
6955 /* The direction with which the BFD was opened. */
6956 ENUM_BITFIELD (bfd_direction) direction : 2;
6957
6958 /* Format_specific flags. */
6959 flagword flags : 20;
6960
6961 /* Values that may appear in the flags field of a BFD. These also
6962 appear in the object_flags field of the bfd_target structure, where
6963 they indicate the set of flags used by that backend (not all flags
6964 are meaningful for all object file formats) (FIXME: at the moment,
6965 the object_flags values have mostly just been copied from backend
6966 to another, and are not necessarily correct). */
6967
6968#define BFD_NO_FLAGS 0x0
6969
6970 /* BFD contains relocation entries. */
6971#define HAS_RELOC 0x1
6972
6973 /* BFD is directly executable. */
6974#define EXEC_P 0x2
6975
6976 /* BFD has line number information (basically used for F_LNNO in a
6977 COFF header). */
6978#define HAS_LINENO 0x4
6979
6980 /* BFD has debugging information. */
6981#define HAS_DEBUG 0x08
6982
6983 /* BFD has symbols. */
6984#define HAS_SYMS 0x10
6985
6986 /* BFD has local symbols (basically used for F_LSYMS in a COFF
6987 header). */
6988#define HAS_LOCALS 0x20
6989
6990 /* BFD is a dynamic object. */
6991#define DYNAMIC 0x40
6992
6993 /* Text section is write protected (if D_PAGED is not set, this is
6994 like an a.out NMAGIC file) (the linker sets this by default, but
6995 clears it for -r or -N). */
6996#define WP_TEXT 0x80
6997
6998 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6999 linker sets this by default, but clears it for -r or -n or -N). */
7000#define D_PAGED 0x100
7001
7002 /* BFD is relaxable (this means that bfd_relax_section may be able to
7003 do something) (sometimes bfd_relax_section can do something even if
7004 this is not set). */
7005#define BFD_IS_RELAXABLE 0x200
7006
7007 /* This may be set before writing out a BFD to request using a
7008 traditional format. For example, this is used to request that when
7009 writing out an a.out object the symbols not be hashed to eliminate
7010 duplicates. */
7011#define BFD_TRADITIONAL_FORMAT 0x400
7012
7013 /* This flag indicates that the BFD contents are actually cached
7014 in memory. If this is set, iostream points to a bfd_in_memory
7015 struct. */
7016#define BFD_IN_MEMORY 0x800
7017
7018 /* This BFD has been created by the linker and doesn't correspond
7019 to any input file. */
7020#define BFD_LINKER_CREATED 0x1000
7021
7022 /* This may be set before writing out a BFD to request that it
7023 be written using values for UIDs, GIDs, timestamps, etc. that
7024 will be consistent from run to run. */
7025#define BFD_DETERMINISTIC_OUTPUT 0x2000
7026
7027 /* Compress sections in this BFD. */
7028#define BFD_COMPRESS 0x4000
7029
7030 /* Decompress sections in this BFD. */
7031#define BFD_DECOMPRESS 0x8000
7032
7033 /* BFD is a dummy, for plugins. */
7034#define BFD_PLUGIN 0x10000
7035
7036 /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
7037#define BFD_COMPRESS_GABI 0x20000
7038
7039 /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
7040 BFD. */
7041#define BFD_CONVERT_ELF_COMMON 0x40000
7042
7043 /* Use the ELF STT_COMMON type in this BFD. */
7044#define BFD_USE_ELF_STT_COMMON 0x80000
7045
7046 /* Flags bits to be saved in bfd_preserve_save. */
7047#define BFD_FLAGS_SAVED \
7048 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7049 | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
7050 | BFD_USE_ELF_STT_COMMON)
7051
7052 /* Flags bits which are for BFD use only. */
7053#define BFD_FLAGS_FOR_BFD_USE_MASK \
7054 (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
7055 | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
7056 | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
7057
7058 /* Is the file descriptor being cached? That is, can it be closed as
7059 needed, and re-opened when accessed later? */
7060 unsigned int cacheable : 1;
7061
7062 /* Marks whether there was a default target specified when the
7063 BFD was opened. This is used to select which matching algorithm
7064 to use to choose the back end. */
7065 unsigned int target_defaulted : 1;
7066
7067 /* ... and here: (``once'' means at least once). */
7068 unsigned int opened_once : 1;
7069
7070 /* Set if we have a locally maintained mtime value, rather than
7071 getting it from the file each time. */
7072 unsigned int mtime_set : 1;
7073
7074 /* Flag set if symbols from this BFD should not be exported. */
7075 unsigned int no_export : 1;
7076
7077 /* Remember when output has begun, to stop strange things
7078 from happening. */
7079 unsigned int output_has_begun : 1;
7080
7081 /* Have archive map. */
7082 unsigned int has_armap : 1;
7083
7084 /* Set if this is a thin archive. */
7085 unsigned int is_thin_archive : 1;
7086
7087 /* Set if only required symbols should be added in the link hash table for
7088 this object. Used by VMS linkers. */
7089 unsigned int selective_search : 1;
7090
7091 /* Set if this is the linker output BFD. */
7092 unsigned int is_linker_output : 1;
7093
7094 /* Set if this is the linker input BFD. */
7095 unsigned int is_linker_input : 1;
7096
7097 /* If this is an input for a compiler plug-in library. */
7098 ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
7099
7100 /* Set if this is a plugin output file. */
7101 unsigned int lto_output : 1;
7102
7103 /* Set to dummy BFD created when claimed by a compiler plug-in
7104 library. */
7105 bfd *plugin_dummy_bfd;
7106
7107 /* Currently my_archive is tested before adding origin to
7108 anything. I believe that this can become always an add of
7109 origin, with origin set to 0 for non archive files. */
7110 ufile_ptr origin;
7111
7112 /* The origin in the archive of the proxy entry. This will
7113 normally be the same as origin, except for thin archives,
7114 when it will contain the current offset of the proxy in the
7115 thin archive rather than the offset of the bfd in its actual
7116 container. */
7117 ufile_ptr proxy_origin;
7118
7119 /* A hash table for section names. */
7120 struct bfd_hash_table section_htab;
7121
7122 /* Pointer to linked list of sections. */
7123 struct bfd_section *sections;
7124
7125 /* The last section on the section list. */
7126 struct bfd_section *section_last;
7127
7128 /* The number of sections. */
7129 unsigned int section_count;
7130
7131 /* A field used by _bfd_generic_link_add_archive_symbols. This will
7132 be used only for archive elements. */
7133 int archive_pass;
7134
7135 /* Stuff only useful for object files:
7136 The start address. */
7137 bfd_vma start_address;
7138
7139 /* Symbol table for output BFD (with symcount entries).
7140 Also used by the linker to cache input BFD symbols. */
7141 struct bfd_symbol **outsymbols;
7142
7143 /* Used for input and output. */
7144 unsigned int symcount;
7145
7146 /* Used for slurped dynamic symbol tables. */
7147 unsigned int dynsymcount;
7148
7149 /* Pointer to structure which contains architecture information. */
7150 const struct bfd_arch_info *arch_info;
7151
7152 /* Stuff only useful for archives. */
7153 void *arelt_data;
7154 struct bfd *my_archive; /* The containing archive BFD. */
7155 struct bfd *archive_next; /* The next BFD in the archive. */
7156 struct bfd *archive_head; /* The first BFD in the archive. */
7157 struct bfd *nested_archives; /* List of nested archive in a flattened
7158 thin archive. */
7159
7160 union {
7161 /* For input BFDs, a chain of BFDs involved in a link. */
7162 struct bfd *next;
7163 /* For output BFD, the linker hash table. */
7164 struct bfd_link_hash_table *hash;
7165 } link;
7166
7167 /* Used by the back end to hold private data. */
7168 union
7169 {
7170 struct aout_data_struct *aout_data;
7171 struct artdata *aout_ar_data;
7172 struct coff_tdata *coff_obj_data;
7173 struct pe_tdata *pe_obj_data;
7174 struct xcoff_tdata *xcoff_obj_data;
7175 struct ecoff_tdata *ecoff_obj_data;
7176 struct srec_data_struct *srec_data;
7177 struct verilog_data_struct *verilog_data;
7178 struct ihex_data_struct *ihex_data;
7179 struct tekhex_data_struct *tekhex_data;
7180 struct elf_obj_tdata *elf_obj_data;
7181 struct mmo_data_struct *mmo_data;
7182 struct sun_core_struct *sun_core_data;
7183 struct sco5_core_struct *sco5_core_data;
7184 struct trad_core_struct *trad_core_data;
7185 struct som_data_struct *som_data;
7186 struct hpux_core_struct *hpux_core_data;
7187 struct hppabsd_core_struct *hppabsd_core_data;
7188 struct sgi_core_struct *sgi_core_data;
7189 struct lynx_core_struct *lynx_core_data;
7190 struct osf_core_struct *osf_core_data;
7191 struct cisco_core_struct *cisco_core_data;
7192 struct versados_data_struct *versados_data;
7193 struct netbsd_core_struct *netbsd_core_data;
7194 struct mach_o_data_struct *mach_o_data;
7195 struct mach_o_fat_data_struct *mach_o_fat_data;
7196 struct plugin_data_struct *plugin_data;
7197 struct bfd_pef_data_struct *pef_data;
7198 struct bfd_pef_xlib_data_struct *pef_xlib_data;
7199 struct bfd_sym_data_struct *sym_data;
7200 void *any;
7201 }
7202 tdata;
7203
7204 /* Used by the application to hold private data. */
7205 void *usrdata;
7206
7207 /* Where all the allocated stuff under this BFD goes. This is a
7208 struct objalloc *, but we use void * to avoid requiring the inclusion
7209 of objalloc.h. */
7210 void *memory;
7211
7212 /* For input BFDs, the build ID, if the object has one. */
7213 const struct bfd_build_id *build_id;
7214};
7215
7216/* See note beside bfd_set_section_userdata. */
7217static inline bfd_boolean
7218bfd_set_cacheable (bfd * abfd, bfd_boolean val)
7219{
7220 abfd->cacheable = val;
7221 return TRUE;
7222}
7223
7224
7225typedef enum bfd_error
7226{
7227 bfd_error_no_error = 0,
7228 bfd_error_system_call,
7229 bfd_error_invalid_target,
7230 bfd_error_wrong_format,
7231 bfd_error_wrong_object_format,
7232 bfd_error_invalid_operation,
7233 bfd_error_no_memory,
7234 bfd_error_no_symbols,
7235 bfd_error_no_armap,
7236 bfd_error_no_more_archived_files,
7237 bfd_error_malformed_archive,
7238 bfd_error_missing_dso,
7239 bfd_error_file_not_recognized,
7240 bfd_error_file_ambiguously_recognized,
7241 bfd_error_no_contents,
7242 bfd_error_nonrepresentable_section,
7243 bfd_error_no_debug_section,
7244 bfd_error_bad_value,
7245 bfd_error_file_truncated,
7246 bfd_error_file_too_big,
7247 bfd_error_on_input,
7248 bfd_error_invalid_error_code
7249}
7250bfd_error_type;
7251
7252bfd_error_type bfd_get_error (void);
7253
7254void bfd_set_error (bfd_error_type error_tag);
7255
7256void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7257
7258const char *bfd_errmsg (bfd_error_type error_tag);
7259
7260void bfd_perror (const char *message);
7261
7262
7263typedef void (*bfd_error_handler_type) (const char *, va_list);
7264
7265void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7266
7267bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7268
7269void bfd_set_error_program_name (const char *);
7270
7271
7272typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7273 const char *bfd_version,
7274 const char *bfd_file,
7275 int bfd_line);
7276
7277bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7278
7279long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7280
7281long bfd_canonicalize_reloc
7282 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7283
7284void bfd_set_reloc
7285 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7286
7287#define bfd_set_reloc(abfd, asect, location, count) \
7288 BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7289bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7290
7291int bfd_get_arch_size (bfd *abfd);
7292
7293int bfd_get_sign_extend_vma (bfd *abfd);
7294
7295bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7296
7297unsigned int bfd_get_gp_size (bfd *abfd);
7298
7299void bfd_set_gp_size (bfd *abfd, unsigned int i);
7300
7301bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7302
7303bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7304
7305#define bfd_copy_private_header_data(ibfd, obfd) \
7306 BFD_SEND (obfd, _bfd_copy_private_header_data, \
7307 (ibfd, obfd))
7308bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7309
7310#define bfd_copy_private_bfd_data(ibfd, obfd) \
7311 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7312 (ibfd, obfd))
7313bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7314
7315#define bfd_set_private_flags(abfd, flags) \
7316 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7317#define bfd_sizeof_headers(abfd, info) \
7318 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7319
7320#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7321 BFD_SEND (abfd, _bfd_find_nearest_line, \
7322 (abfd, syms, sec, off, file, func, line, NULL))
7323
7324#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7325 line, disc) \
7326 BFD_SEND (abfd, _bfd_find_nearest_line, \
7327 (abfd, syms, sec, off, file, func, line, disc))
7328
7329#define bfd_find_line(abfd, syms, sym, file, line) \
7330 BFD_SEND (abfd, _bfd_find_line, \
7331 (abfd, syms, sym, file, line))
7332
7333#define bfd_find_inliner_info(abfd, file, func, line) \
7334 BFD_SEND (abfd, _bfd_find_inliner_info, \
7335 (abfd, file, func, line))
7336
7337#define bfd_debug_info_start(abfd) \
7338 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7339
7340#define bfd_debug_info_end(abfd) \
7341 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7342
7343#define bfd_debug_info_accumulate(abfd, section) \
7344 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7345
7346#define bfd_stat_arch_elt(abfd, stat) \
7347 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7348
7349#define bfd_update_armap_timestamp(abfd) \
7350 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7351
7352#define bfd_set_arch_mach(abfd, arch, mach)\
7353 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7354
7355#define bfd_relax_section(abfd, section, link_info, again) \
7356 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7357
7358#define bfd_gc_sections(abfd, link_info) \
7359 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7360
7361#define bfd_lookup_section_flags(link_info, flag_info, section) \
7362 BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7363
7364#define bfd_merge_sections(abfd, link_info) \
7365 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7366
7367#define bfd_is_group_section(abfd, sec) \
7368 BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7369
7370#define bfd_discard_group(abfd, sec) \
7371 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7372
7373#define bfd_link_hash_table_create(abfd) \
7374 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7375
7376#define bfd_link_add_symbols(abfd, info) \
7377 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7378
7379#define bfd_link_just_syms(abfd, sec, info) \
7380 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7381
7382#define bfd_final_link(abfd, info) \
7383 BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7384
7385#define bfd_free_cached_info(abfd) \
7386 BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7387
7388#define bfd_get_dynamic_symtab_upper_bound(abfd) \
7389 BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7390
7391#define bfd_print_private_bfd_data(abfd, file)\
7392 BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7393
7394#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7395 BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7396
7397#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7398 BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7399 dyncount, dynsyms, ret))
7400
7401#define bfd_get_dynamic_reloc_upper_bound(abfd) \
7402 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7403
7404#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7405 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7406
7407extern bfd_byte *bfd_get_relocated_section_contents
7408 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7409 bfd_boolean, asymbol **);
7410
7411bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7412
7413bfd_vma bfd_emul_get_maxpagesize (const char *);
7414
7415void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7416
7417bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7418
7419void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7420
7421char *bfd_demangle (bfd *, const char *, int);
7422
7423void bfd_update_compression_header
7424 (bfd *abfd, bfd_byte *contents, asection *sec);
7425
7426bfd_boolean bfd_check_compression_header
7427 (bfd *abfd, bfd_byte *contents, asection *sec,
7428 bfd_size_type *uncompressed_size,
7429 unsigned int *uncompressed_alignment_power);
7430
7431int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7432
7433bfd_size_type bfd_convert_section_size
7434 (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7435
7436bfd_boolean bfd_convert_section_contents
7437 (bfd *ibfd, asection *isec, bfd *obfd,
7438 bfd_byte **ptr, bfd_size_type *ptr_size);
7439
7440/* Extracted from archive.c. */
7441symindex bfd_get_next_mapent
7442 (bfd *abfd, symindex previous, carsym **sym);
7443
7444bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7445
7446bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7447
7448/* Extracted from corefile.c. */
7449const char *bfd_core_file_failing_command (bfd *abfd);
7450
7451int bfd_core_file_failing_signal (bfd *abfd);
7452
7453int bfd_core_file_pid (bfd *abfd);
7454
7455bfd_boolean core_file_matches_executable_p
7456 (bfd *core_bfd, bfd *exec_bfd);
7457
7458bfd_boolean generic_core_file_matches_executable_p
7459 (bfd *core_bfd, bfd *exec_bfd);
7460
7461/* Extracted from targets.c. */
7462#define BFD_SEND(bfd, message, arglist) \
7463 ((*((bfd)->xvec->message)) arglist)
7464
7465#ifdef DEBUG_BFD_SEND
7466#undef BFD_SEND
7467#define BFD_SEND(bfd, message, arglist) \
7468 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7469 ((*((bfd)->xvec->message)) arglist) : \
7470 (bfd_assert (__FILE__,__LINE__), NULL))
7471#endif
7472#define BFD_SEND_FMT(bfd, message, arglist) \
7473 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7474
7475#ifdef DEBUG_BFD_SEND
7476#undef BFD_SEND_FMT
7477#define BFD_SEND_FMT(bfd, message, arglist) \
7478 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7479 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7480 (bfd_assert (__FILE__,__LINE__), NULL))
7481#endif
7482
7483enum bfd_flavour
7484{
7485 /* N.B. Update bfd_flavour_name if you change this. */
7486 bfd_target_unknown_flavour,
7487 bfd_target_aout_flavour,
7488 bfd_target_coff_flavour,
7489 bfd_target_ecoff_flavour,
7490 bfd_target_xcoff_flavour,
7491 bfd_target_elf_flavour,
7492 bfd_target_tekhex_flavour,
7493 bfd_target_srec_flavour,
7494 bfd_target_verilog_flavour,
7495 bfd_target_ihex_flavour,
7496 bfd_target_som_flavour,
7497 bfd_target_os9k_flavour,
7498 bfd_target_versados_flavour,
7499 bfd_target_msdos_flavour,
7500 bfd_target_ovax_flavour,
7501 bfd_target_evax_flavour,
7502 bfd_target_mmo_flavour,
7503 bfd_target_mach_o_flavour,
7504 bfd_target_pef_flavour,
7505 bfd_target_pef_xlib_flavour,
7506 bfd_target_sym_flavour
7507};
7508
7509enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7510
7511/* Forward declaration. */
7512typedef struct bfd_link_info _bfd_link_info;
7513
7514/* Forward declaration. */
7515typedef struct flag_info flag_info;
7516
7517typedef struct bfd_target
7518{
7519 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
7520 char *name;
7521
7522 /* The "flavour" of a back end is a general indication about
7523 the contents of a file. */
7524 enum bfd_flavour flavour;
7525
7526 /* The order of bytes within the data area of a file. */
7527 enum bfd_endian byteorder;
7528
7529 /* The order of bytes within the header parts of a file. */
7530 enum bfd_endian header_byteorder;
7531
7532 /* A mask of all the flags which an executable may have set -
7533 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
7534 flagword object_flags;
7535
7536 /* A mask of all the flags which a section may have set - from
7537 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
7538 flagword section_flags;
7539
7540 /* The character normally found at the front of a symbol.
7541 (if any), perhaps `_'. */
7542 char symbol_leading_char;
7543
7544 /* The pad character for file names within an archive header. */
7545 char ar_pad_char;
7546
7547 /* The maximum number of characters in an archive header. */
7548 unsigned char ar_max_namelen;
7549
7550 /* How well this target matches, used to select between various
7551 possible targets when more than one target matches. */
7552 unsigned char match_priority;
7553
7554 /* Entries for byte swapping for data. These are different from the
7555 other entry points, since they don't take a BFD as the first argument.
7556 Certain other handlers could do the same. */
7557 bfd_uint64_t (*bfd_getx64) (const void *);
7558 bfd_int64_t (*bfd_getx_signed_64) (const void *);
7559 void (*bfd_putx64) (bfd_uint64_t, void *);
7560 bfd_vma (*bfd_getx32) (const void *);
7561 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7562 void (*bfd_putx32) (bfd_vma, void *);
7563 bfd_vma (*bfd_getx16) (const void *);
7564 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7565 void (*bfd_putx16) (bfd_vma, void *);
7566
7567 /* Byte swapping for the headers. */
7568 bfd_uint64_t (*bfd_h_getx64) (const void *);
7569 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
7570 void (*bfd_h_putx64) (bfd_uint64_t, void *);
7571 bfd_vma (*bfd_h_getx32) (const void *);
7572 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7573 void (*bfd_h_putx32) (bfd_vma, void *);
7574 bfd_vma (*bfd_h_getx16) (const void *);
7575 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7576 void (*bfd_h_putx16) (bfd_vma, void *);
7577
7578 /* Format dependent routines: these are vectors of entry points
7579 within the target vector structure, one for each format to check. */
7580
7581 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
7582 const struct bfd_target *
7583 (*_bfd_check_format[bfd_type_end]) (bfd *);
7584
7585 /* Set the format of a file being written. */
7586 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7587
7588 /* Write cached information into a file being written, at <<bfd_close>>. */
7589 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7590
7591
7592 /* Generic entry points. */
7593#define BFD_JUMP_TABLE_GENERIC(NAME) \
7594 NAME##_close_and_cleanup, \
7595 NAME##_bfd_free_cached_info, \
7596 NAME##_new_section_hook, \
7597 NAME##_get_section_contents, \
7598 NAME##_get_section_contents_in_window
7599
7600 /* Called when the BFD is being closed to do any necessary cleanup. */
7601 bfd_boolean (*_close_and_cleanup) (bfd *);
7602 /* Ask the BFD to free all cached information. */
7603 bfd_boolean (*_bfd_free_cached_info) (bfd *);
7604 /* Called when a new section is created. */
7605 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7606 /* Read the contents of a section. */
7607 bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
7608 bfd_size_type);
7609 bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
7610 bfd_window *, file_ptr,
7611 bfd_size_type);
7612
7613 /* Entry points to copy private data. */
7614#define BFD_JUMP_TABLE_COPY(NAME) \
7615 NAME##_bfd_copy_private_bfd_data, \
7616 NAME##_bfd_merge_private_bfd_data, \
7617 _bfd_generic_init_private_section_data, \
7618 NAME##_bfd_copy_private_section_data, \
7619 NAME##_bfd_copy_private_symbol_data, \
7620 NAME##_bfd_copy_private_header_data, \
7621 NAME##_bfd_set_private_flags, \
7622 NAME##_bfd_print_private_bfd_data
7623
7624 /* Called to copy BFD general private data from one object file
7625 to another. */
7626 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7627 /* Called to merge BFD general private data from one object file
7628 to a common output file when linking. */
7629 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7630 /* Called to initialize BFD private section data from one object file
7631 to another. */
7632#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
7633 BFD_SEND (obfd, _bfd_init_private_section_data, \
7634 (ibfd, isec, obfd, osec, link_info))
7635 bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
7636 sec_ptr,
7637 struct bfd_link_info *);
7638 /* Called to copy BFD private section data from one object file
7639 to another. */
7640 bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
7641 sec_ptr);
7642 /* Called to copy BFD private symbol data from one symbol
7643 to another. */
7644 bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
7645 asymbol *);
7646 /* Called to copy BFD private header data from one object file
7647 to another. */
7648 bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7649 /* Called to set private backend flags. */
7650 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7651
7652 /* Called to print private BFD data. */
7653 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7654
7655 /* Core file entry points. */
7656#define BFD_JUMP_TABLE_CORE(NAME) \
7657 NAME##_core_file_failing_command, \
7658 NAME##_core_file_failing_signal, \
7659 NAME##_core_file_matches_executable_p, \
7660 NAME##_core_file_pid
7661
7662 char * (*_core_file_failing_command) (bfd *);
7663 int (*_core_file_failing_signal) (bfd *);
7664 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7665 int (*_core_file_pid) (bfd *);
7666
7667 /* Archive entry points. */
7668#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7669 NAME##_slurp_armap, \
7670 NAME##_slurp_extended_name_table, \
7671 NAME##_construct_extended_name_table, \
7672 NAME##_truncate_arname, \
7673 NAME##_write_armap, \
7674 NAME##_read_ar_hdr, \
7675 NAME##_write_ar_hdr, \
7676 NAME##_openr_next_archived_file, \
7677 NAME##_get_elt_at_index, \
7678 NAME##_generic_stat_arch_elt, \
7679 NAME##_update_armap_timestamp
7680
7681 bfd_boolean (*_bfd_slurp_armap) (bfd *);
7682 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
7683 bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
7684 bfd_size_type *,
7685 const char **);
7686 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
7687 bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
7688 unsigned int, int);
7689 void * (*_bfd_read_ar_hdr_fn) (bfd *);
7690 bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7691 bfd * (*openr_next_archived_file) (bfd *, bfd *);
7692#define bfd_get_elt_at_index(b,i) \
7693 BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7694 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
7695 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7696 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7697
7698 /* Entry points used for symbols. */
7699#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7700 NAME##_get_symtab_upper_bound, \
7701 NAME##_canonicalize_symtab, \
7702 NAME##_make_empty_symbol, \
7703 NAME##_print_symbol, \
7704 NAME##_get_symbol_info, \
7705 NAME##_get_symbol_version_string, \
7706 NAME##_bfd_is_local_label_name, \
7707 NAME##_bfd_is_target_special_symbol, \
7708 NAME##_get_lineno, \
7709 NAME##_find_nearest_line, \
7710 NAME##_find_line, \
7711 NAME##_find_inliner_info, \
7712 NAME##_bfd_make_debug_symbol, \
7713 NAME##_read_minisymbols, \
7714 NAME##_minisymbol_to_symbol
7715
7716 long (*_bfd_get_symtab_upper_bound) (bfd *);
7717 long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7718 struct bfd_symbol *
7719 (*_bfd_make_empty_symbol) (bfd *);
7720 void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
7721 bfd_print_symbol_type);
7722#define bfd_print_symbol(b,p,s,e) \
7723 BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
7724 void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
7725 symbol_info *);
7726#define bfd_get_symbol_info(b,p,e) \
7727 BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
7728 const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7729 bfd_boolean *);
7730#define bfd_get_symbol_version_string(b,s,h) \
7731 BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7732 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7733 bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7734 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
7735 bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
7736 struct bfd_section *, bfd_vma,
7737 const char **, const char **,
7738 unsigned int *, unsigned int *);
7739 bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
7740 struct bfd_symbol *, const char **,
7741 unsigned int *);
7742 bfd_boolean (*_bfd_find_inliner_info)
7743 (bfd *, const char **, const char **, unsigned int *);
7744 /* Back-door to allow format-aware applications to create debug symbols
7745 while using BFD for everything else. Currently used by the assembler
7746 when creating COFF files. */
7747 asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7748#define bfd_read_minisymbols(b, d, m, s) \
7749 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
7750 long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
7751 unsigned int *);
7752#define bfd_minisymbol_to_symbol(b, d, m, f) \
7753 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
7754 asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
7755 asymbol *);
7756
7757 /* Routines for relocs. */
7758#define BFD_JUMP_TABLE_RELOCS(NAME) \
7759 NAME##_get_reloc_upper_bound, \
7760 NAME##_canonicalize_reloc, \
7761 NAME##_set_reloc, \
7762 NAME##_bfd_reloc_type_lookup, \
7763 NAME##_bfd_reloc_name_lookup
7764
7765 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
7766 long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
7767 struct bfd_symbol **);
7768 void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7769 /* See documentation on reloc types. */
7770 reloc_howto_type *
7771 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7772 reloc_howto_type *
7773 (*reloc_name_lookup) (bfd *, const char *);
7774
7775 /* Routines used when writing an object file. */
7776#define BFD_JUMP_TABLE_WRITE(NAME) \
7777 NAME##_set_arch_mach, \
7778 NAME##_set_section_contents
7779
7780 bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
7781 unsigned long);
7782 bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
7783 file_ptr, bfd_size_type);
7784
7785 /* Routines used by the linker. */
7786#define BFD_JUMP_TABLE_LINK(NAME) \
7787 NAME##_sizeof_headers, \
7788 NAME##_bfd_get_relocated_section_contents, \
7789 NAME##_bfd_relax_section, \
7790 NAME##_bfd_link_hash_table_create, \
7791 NAME##_bfd_link_add_symbols, \
7792 NAME##_bfd_link_just_syms, \
7793 NAME##_bfd_copy_link_hash_symbol_type, \
7794 NAME##_bfd_final_link, \
7795 NAME##_bfd_link_split_section, \
7796 NAME##_bfd_link_check_relocs, \
7797 NAME##_bfd_gc_sections, \
7798 NAME##_bfd_lookup_section_flags, \
7799 NAME##_bfd_merge_sections, \
7800 NAME##_bfd_is_group_section, \
7801 NAME##_bfd_discard_group, \
7802 NAME##_section_already_linked, \
7803 NAME##_bfd_define_common_symbol, \
7804 NAME##_bfd_link_hide_symbol, \
7805 NAME##_bfd_define_start_stop
7806
7807 int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
7808 bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
7809 struct bfd_link_info *,
7810 struct bfd_link_order *,
7811 bfd_byte *, bfd_boolean,
7812 struct bfd_symbol **);
7813
7814 bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
7815 struct bfd_link_info *, bfd_boolean *);
7816
7817 /* Create a hash table for the linker. Different backends store
7818 different information in this table. */
7819 struct bfd_link_hash_table *
7820 (*_bfd_link_hash_table_create) (bfd *);
7821
7822 /* Add symbols from this object file into the hash table. */
7823 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7824
7825 /* Indicate that we are only retrieving symbol values from this section. */
7826 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7827
7828 /* Copy the symbol type and other attributes for a linker script
7829 assignment of one symbol to another. */
7830#define bfd_copy_link_hash_symbol_type(b, t, f) \
7831 BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
7832 void (*_bfd_copy_link_hash_symbol_type) (bfd *,
7833 struct bfd_link_hash_entry *,
7834 struct bfd_link_hash_entry *);
7835
7836 /* Do a link based on the link_order structures attached to each
7837 section of the BFD. */
7838 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7839
7840 /* Should this section be split up into smaller pieces during linking. */
7841 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7842
7843 /* Check the relocations in the bfd for validity. */
7844 bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7845
7846 /* Remove sections that are not referenced from the output. */
7847 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7848
7849 /* Sets the bitmask of allowed and disallowed section flags. */
7850 bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
7851 struct flag_info *, asection *);
7852
7853 /* Attempt to merge SEC_MERGE sections. */
7854 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7855
7856 /* Is this section a member of a group? */
7857 bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7858
7859 /* Discard members of a group. */
7860 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7861
7862 /* Check if SEC has been already linked during a reloceatable or
7863 final link. */
7864 bfd_boolean (*_section_already_linked) (bfd *, asection *,
7865 struct bfd_link_info *);
7866
7867 /* Define a common symbol. */
7868 bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7869 struct bfd_link_hash_entry *);
7870
7871 /* Hide a symbol. */
7872 void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
7873 struct bfd_link_hash_entry *);
7874
7875 /* Define a __start, __stop, .startof. or .sizeof. symbol. */
7876 struct bfd_link_hash_entry *
7877 (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
7878 asection *);
7879
7880 /* Routines to handle dynamic symbols and relocs. */
7881#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7882 NAME##_get_dynamic_symtab_upper_bound, \
7883 NAME##_canonicalize_dynamic_symtab, \
7884 NAME##_get_synthetic_symtab, \
7885 NAME##_get_dynamic_reloc_upper_bound, \
7886 NAME##_canonicalize_dynamic_reloc
7887
7888 /* Get the amount of memory required to hold the dynamic symbols. */
7889 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7890 /* Read in the dynamic symbols. */
7891 long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7892 /* Create synthetized symbols. */
7893 long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
7894 long, struct bfd_symbol **,
7895 struct bfd_symbol **);
7896 /* Get the amount of memory required to hold the dynamic relocs. */
7897 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7898 /* Read in the dynamic relocs. */
7899 long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
7900 struct bfd_symbol **);
7901
7902 /* Opposite endian version of this target. */
7903 const struct bfd_target *alternative_target;
7904
7905 /* Data for use by back-end routines, which isn't
7906 generic enough to belong in this structure. */
7907 const void *backend_data;
7908
7909} bfd_target;
7910
7911bfd_boolean bfd_set_default_target (const char *name);
7912
7913const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7914
7915const bfd_target *bfd_get_target_info (const char *target_name,
7916 bfd *abfd,
7917 bfd_boolean *is_bigendian,
7918 int *underscoring,
7919 const char **def_target_arch);
7920const char ** bfd_target_list (void);
7921
7922const bfd_target *bfd_iterate_over_targets
7923 (int (*func) (const bfd_target *, void *),
7924 void *data);
7925
7926const char *bfd_flavour_name (enum bfd_flavour flavour);
7927
7928/* Extracted from format.c. */
7929bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7930
7931bfd_boolean bfd_check_format_matches
7932 (bfd *abfd, bfd_format format, char ***matching);
7933
7934bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7935
7936const char *bfd_format_string (bfd_format format);
7937
7938/* Extracted from linker.c. */
7939/* Return TRUE if the symbol described by a linker hash entry H
7940 is going to be absolute. Linker-script defined symbols can be
7941 converted from absolute to section-relative ones late in the
7942 link. Use this macro to correctly determine whether the symbol
7943 will actually end up absolute in output. */
7944#define bfd_is_abs_symbol(H) \
7945 (((H)->type == bfd_link_hash_defined \
7946 || (H)->type == bfd_link_hash_defweak) \
7947 && bfd_is_abs_section ((H)->u.def.section) \
7948 && !(H)->rel_from_abs)
7949
7950bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7951
7952#define bfd_link_split_section(abfd, sec) \
7953 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7954
7955bfd_boolean bfd_section_already_linked (bfd *abfd,
7956 asection *sec,
7957 struct bfd_link_info *info);
7958
7959#define bfd_section_already_linked(abfd, sec, info) \
7960 BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7961
7962bfd_boolean bfd_generic_define_common_symbol
7963 (bfd *output_bfd, struct bfd_link_info *info,
7964 struct bfd_link_hash_entry *h);
7965
7966#define bfd_define_common_symbol(output_bfd, info, h) \
7967 BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7968
7969void _bfd_generic_link_hide_symbol
7970 (bfd *output_bfd, struct bfd_link_info *info,
7971 struct bfd_link_hash_entry *h);
7972
7973#define bfd_link_hide_symbol(output_bfd, info, h) \
7974 BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
7975
7976struct bfd_link_hash_entry *bfd_generic_define_start_stop
7977 (struct bfd_link_info *info,
7978 const char *symbol, asection *sec);
7979
7980#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
7981 BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
7982
7983struct bfd_elf_version_tree * bfd_find_version_for_sym
7984 (struct bfd_elf_version_tree *verdefs,
7985 const char *sym_name, bfd_boolean *hide);
7986
7987bfd_boolean bfd_hide_sym_by_version
7988 (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7989
7990bfd_boolean bfd_link_check_relocs
7991 (bfd *abfd, struct bfd_link_info *info);
7992
7993bfd_boolean _bfd_generic_link_check_relocs
7994 (bfd *abfd, struct bfd_link_info *info);
7995
7996bfd_boolean bfd_merge_private_bfd_data
7997 (bfd *ibfd, struct bfd_link_info *info);
7998
7999#define bfd_merge_private_bfd_data(ibfd, info) \
8000 BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
8001 (ibfd, info))
8002/* Extracted from simple.c. */
8003bfd_byte *bfd_simple_get_relocated_section_contents
8004 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
8005
8006/* Extracted from compress.c. */
8007bfd_boolean bfd_get_full_section_contents
8008 (bfd *abfd, asection *section, bfd_byte **ptr);
8009
8010void bfd_cache_section_contents
8011 (asection *sec, void *contents);
8012
8013bfd_boolean bfd_is_section_compressed_with_header
8014 (bfd *abfd, asection *section,
8015 int *compression_header_size_p,
8016 bfd_size_type *uncompressed_size_p,
8017 unsigned int *uncompressed_alignment_power_p);
8018
8019bfd_boolean bfd_is_section_compressed
8020 (bfd *abfd, asection *section);
8021
8022bfd_boolean bfd_init_section_decompress_status
8023 (bfd *abfd, asection *section);
8024
8025bfd_boolean bfd_init_section_compress_status
8026 (bfd *abfd, asection *section);
8027
8028bfd_boolean bfd_compress_section
8029 (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
8030
8031#ifdef __cplusplus
8032}
8033#endif
8034#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for riscv32-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg int
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if __RISCVEB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/fenv.h deleted-18
...@@ -1,18 +0,0 @@
1#define FE_INVALID 16
2#define FE_DIVBYZERO 8
3#define FE_OVERFLOW 4
4#define FE_UNDERFLOW 2
5#define FE_INEXACT 1
6
7#define FE_ALL_EXCEPT 31
8
9#define FE_TONEAREST 0
10#define FE_DOWNWARD 2
11#define FE_UPWARD 3
12#define FE_TOWARDZERO 1
13
14typedef unsigned int fexcept_t;
15
16typedef unsigned int fenv_t;
17
18#define FE_DFL_ENV ((const fenv_t *) -1)
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/ipc.h deleted-14
...@@ -1,14 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 unsigned short __ipc_perm_seq;
9
10 unsigned long __pad1;
11 unsigned long __pad2;
12};
13
14#define IPC_64 0
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1# define _POSIX_V6_ILP32_OFFBIG 1
2# define _POSIX_V7_ILP32_OFFBIG 1
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/reg.h deleted-8
...@@ -1,8 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3#define REG_PC 0
4#define REG_RA 1
5#define REG_SP 2
6#define REG_TP 4
7#define REG_S0 8
8#define REG_A0 10
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/sem.h deleted-9
...@@ -1,9 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 time_t sem_ctime;
5 unsigned short sem_nsems;
6 char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
7 time_t __unused3;
8 time_t __unused4;
9};
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[40];
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/shm.h deleted-25
...@@ -1,25 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds
4{
5 struct ipc_perm shm_perm;
6 size_t shm_segsz;
7 time_t shm_atime;
8 time_t shm_dtime;
9 time_t shm_ctime;
10 pid_t shm_cpid;
11 pid_t shm_lpid;
12 unsigned long shm_nattch;
13 unsigned long __pad1;
14 unsigned long __pad2;
15};
16
17struct shminfo {
18 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
19};
20
21struct shm_info {
22 int __used_ids;
23 unsigned long shm_tot, shm_rss, shm_swp;
24 unsigned long __swap_attempts, __swap_successes;
25};
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/signal.h deleted-113
...@@ -1,113 +0,0 @@
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/* gregs[0] holds the program counter. */
10
11#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
12typedef unsigned long greg_t;
13typedef unsigned long gregset_t[32];
14
15struct __riscv_f_ext_state {
16 unsigned int f[32];
17 unsigned int fcsr;
18};
19
20struct __riscv_d_ext_state {
21 unsigned long long f[32];
22 unsigned int fcsr;
23};
24
25struct __riscv_q_ext_state {
26 unsigned long long f[64] __attribute__((aligned(16)));
27 unsigned int fcsr;
28 unsigned int reserved[3];
29};
30
31union __riscv_fp_state {
32 struct __riscv_f_ext_state f;
33 struct __riscv_d_ext_state d;
34 struct __riscv_q_ext_state q;
35};
36
37typedef union __riscv_fp_state fpregset_t;
38
39typedef struct sigcontext {
40 gregset_t gregs;
41 fpregset_t fpregs;
42} mcontext_t;
43
44#else
45typedef struct {
46 unsigned long gregs[32];
47 unsigned long long fpregs[66];
48} mcontext_t;
49#endif
50
51struct sigaltstack {
52 void *ss_sp;
53 int ss_flags;
54 size_t ss_size;
55};
56
57typedef struct __ucontext
58{
59 unsigned long uc_flags;
60 struct __ucontext *uc_link;
61 stack_t uc_stack;
62 sigset_t uc_sigmask;
63 char __unused[1024 / 8 - sizeof(sigset_t)];
64 mcontext_t uc_mcontext;
65} ucontext_t;
66
67#define SA_NOCLDSTOP 1
68#define SA_NOCLDWAIT 2
69#define SA_SIGINFO 4
70#define SA_ONSTACK 0x08000000
71#define SA_RESTART 0x10000000
72#define SA_NODEFER 0x40000000
73#define SA_RESETHAND 0x80000000
74#define SA_RESTORER 0x04000000
75
76#endif
77
78#define SIGHUP 1
79#define SIGINT 2
80#define SIGQUIT 3
81#define SIGILL 4
82#define SIGTRAP 5
83#define SIGABRT 6
84#define SIGIOT SIGABRT
85#define SIGBUS 7
86#define SIGFPE 8
87#define SIGKILL 9
88#define SIGUSR1 10
89#define SIGSEGV 11
90#define SIGUSR2 12
91#define SIGPIPE 13
92#define SIGALRM 14
93#define SIGTERM 15
94#define SIGSTKFLT 16
95#define SIGCHLD 17
96#define SIGCONT 18
97#define SIGSTOP 19
98#define SIGTSTP 20
99#define SIGTTIN 21
100#define SIGTTOU 22
101#define SIGURG 23
102#define SIGXCPU 24
103#define SIGXFSZ 25
104#define SIGVTALRM 26
105#define SIGPROF 27
106#define SIGWINCH 28
107#define SIGIO 29
108#define SIGPOLL SIGIO
109#define SIGPWR 30
110#define SIGSYS 31
111#define SIGUNUSED SIGSYS
112
113#define _NSIG 65
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/socket.h deleted-33
...@@ -1,33 +0,0 @@
1#include <endian.h>
2
3struct msghdr {
4 void *msg_name;
5 socklen_t msg_namelen;
6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;
18 int __pad2;
19#endif
20 int msg_flags;
21};
22
23struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;
29 int __pad1;
30#endif
31 int cmsg_level;
32 int cmsg_type;
33};
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/stat.h deleted-18
...@@ -1,18 +0,0 @@
1struct stat {
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 struct timespec st_atim;
15 struct timespec st_mtim;
16 struct timespec st_ctim;
17 unsigned __unused[2];
18};
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
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
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/syscall.h deleted-555
...@@ -1,555 +0,0 @@
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_range 84
86#define __NR_timerfd_create 85
87#define __NR_timerfd_settime 86
88#define __NR_timerfd_gettime 87
89#define __NR_utimensat 88
90#define __NR_acct 89
91#define __NR_capget 90
92#define __NR_capset 91
93#define __NR_personality 92
94#define __NR_exit 93
95#define __NR_exit_group 94
96#define __NR_waitid 95
97#define __NR_set_tid_address 96
98#define __NR_unshare 97
99#define __NR_futex 98
100#define __NR_set_robust_list 99
101#define __NR_get_robust_list 100
102#define __NR_nanosleep 101
103#define __NR_getitimer 102
104#define __NR_setitimer 103
105#define __NR_kexec_load 104
106#define __NR_init_module 105
107#define __NR_delete_module 106
108#define __NR_timer_create 107
109#define __NR_timer_gettime 108
110#define __NR_timer_getoverrun 109
111#define __NR_timer_settime 110
112#define __NR_timer_delete 111
113#define __NR_clock_settime 112
114#define __NR_clock_gettime 113
115#define __NR_clock_getres 114
116#define __NR_clock_nanosleep 115
117#define __NR_syslog 116
118#define __NR_ptrace 117
119#define __NR_sched_setparam 118
120#define __NR_sched_setscheduler 119
121#define __NR_sched_getscheduler 120
122#define __NR_sched_getparam 121
123#define __NR_sched_setaffinity 122
124#define __NR_sched_getaffinity 123
125#define __NR_sched_yield 124
126#define __NR_sched_get_priority_max 125
127#define __NR_sched_get_priority_min 126
128#define __NR_sched_rr_get_interval 127
129#define __NR_restart_syscall 128
130#define __NR_kill 129
131#define __NR_tkill 130
132#define __NR_tgkill 131
133#define __NR_sigaltstack 132
134#define __NR_rt_sigsuspend 133
135#define __NR_rt_sigaction 134
136#define __NR_rt_sigprocmask 135
137#define __NR_rt_sigpending 136
138#define __NR_rt_sigtimedwait 137
139#define __NR_rt_sigqueueinfo 138
140#define __NR_rt_sigreturn 139
141#define __NR_setpriority 140
142#define __NR_getpriority 141
143#define __NR_reboot 142
144#define __NR_setregid 143
145#define __NR_setgid 144
146#define __NR_setreuid 145
147#define __NR_setuid 146
148#define __NR_setresuid 147
149#define __NR_getresuid 148
150#define __NR_setresgid 149
151#define __NR_getresgid 150
152#define __NR_setfsuid 151
153#define __NR_setfsgid 152
154#define __NR_times 153
155#define __NR_setpgid 154
156#define __NR_getpgid 155
157#define __NR_getsid 156
158#define __NR_setsid 157
159#define __NR_getgroups 158
160#define __NR_setgroups 159
161#define __NR_uname 160
162#define __NR_sethostname 161
163#define __NR_setdomainname 162
164#define __NR_getrlimit 163
165#define __NR_setrlimit 164
166#define __NR_getrusage 165
167#define __NR_umask 166
168#define __NR_prctl 167
169#define __NR_getcpu 168
170#define __NR_gettimeofday 169
171#define __NR_settimeofday 170
172#define __NR_adjtimex 171
173#define __NR_getpid 172
174#define __NR_getppid 173
175#define __NR_getuid 174
176#define __NR_geteuid 175
177#define __NR_getgid 176
178#define __NR_getegid 177
179#define __NR_gettid 178
180#define __NR_sysinfo 179
181#define __NR_mq_open 180
182#define __NR_mq_unlink 181
183#define __NR_mq_timedsend 182
184#define __NR_mq_timedreceive 183
185#define __NR_mq_notify 184
186#define __NR_mq_getsetattr 185
187#define __NR_msgget 186
188#define __NR_msgctl 187
189#define __NR_msgrcv 188
190#define __NR_msgsnd 189
191#define __NR_semget 190
192#define __NR_semctl 191
193#define __NR_semtimedop 192
194#define __NR_semop 193
195#define __NR_shmget 194
196#define __NR_shmctl 195
197#define __NR_shmat 196
198#define __NR_shmdt 197
199#define __NR_socket 198
200#define __NR_socketpair 199
201#define __NR_bind 200
202#define __NR_listen 201
203#define __NR_accept 202
204#define __NR_connect 203
205#define __NR_getsockname 204
206#define __NR_getpeername 205
207#define __NR_sendto 206
208#define __NR_recvfrom 207
209#define __NR_setsockopt 208
210#define __NR_getsockopt 209
211#define __NR_shutdown 210
212#define __NR_sendmsg 211
213#define __NR_recvmsg 212
214#define __NR_readahead 213
215#define __NR_brk 214
216#define __NR_munmap 215
217#define __NR_mremap 216
218#define __NR_add_key 217
219#define __NR_request_key 218
220#define __NR_keyctl 219
221#define __NR_clone 220
222#define __NR_execve 221
223#define __NR_mmap 222
224#define __NR_fadvise64 223
225#define __NR_swapon 224
226#define __NR_swapoff 225
227#define __NR_mprotect 226
228#define __NR_msync 227
229#define __NR_mlock 228
230#define __NR_munlock 229
231#define __NR_mlockall 230
232#define __NR_munlockall 231
233#define __NR_mincore 232
234#define __NR_madvise 233
235#define __NR_remap_file_pages 234
236#define __NR_mbind 235
237#define __NR_get_mempolicy 236
238#define __NR_set_mempolicy 237
239#define __NR_migrate_pages 238
240#define __NR_move_pages 239
241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_perf_event_open 241
243#define __NR_accept4 242
244#define __NR_recvmmsg 243
245#define __NR_arch_specific_syscall 244
246#define __NR_wait4 260
247#define __NR_prlimit64 261
248#define __NR_fanotify_init 262
249#define __NR_fanotify_mark 263
250#define __NR_name_to_handle_at 264
251#define __NR_open_by_handle_at 265
252#define __NR_clock_adjtime 266
253#define __NR_syncfs 267
254#define __NR_setns 268
255#define __NR_sendmmsg 269
256#define __NR_process_vm_readv 270
257#define __NR_process_vm_writev 271
258#define __NR_kcmp 272
259#define __NR_finit_module 273
260#define __NR_sched_setattr 274
261#define __NR_sched_getattr 275
262#define __NR_renameat2 276
263#define __NR_seccomp 277
264#define __NR_getrandom 278
265#define __NR_memfd_create 279
266#define __NR_bpf 280
267#define __NR_execveat 281
268#define __NR_userfaultfd 282
269#define __NR_membarrier 283
270#define __NR_mlock2 284
271#define __NR_copy_file_range 285
272#define __NR_preadv2 286
273#define __NR_pwritev2 287
274#define __NR_pkey_mprotect 288
275#define __NR_pkey_alloc 289
276#define __NR_pkey_free 290
277#define __NR_sysriscv __NR_arch_specific_syscall
278
279#define SYS_io_setup 0
280#define SYS_io_destroy 1
281#define SYS_io_submit 2
282#define SYS_io_cancel 3
283#define SYS_io_getevents 4
284#define SYS_setxattr 5
285#define SYS_lsetxattr 6
286#define SYS_fsetxattr 7
287#define SYS_getxattr 8
288#define SYS_lgetxattr 9
289#define SYS_fgetxattr 10
290#define SYS_listxattr 11
291#define SYS_llistxattr 12
292#define SYS_flistxattr 13
293#define SYS_removexattr 14
294#define SYS_lremovexattr 15
295#define SYS_fremovexattr 16
296#define SYS_getcwd 17
297#define SYS_lookup_dcookie 18
298#define SYS_eventfd2 19
299#define SYS_epoll_create1 20
300#define SYS_epoll_ctl 21
301#define SYS_epoll_pwait 22
302#define SYS_dup 23
303#define SYS_dup3 24
304#define SYS_fcntl 25
305#define SYS_inotify_init1 26
306#define SYS_inotify_add_watch 27
307#define SYS_inotify_rm_watch 28
308#define SYS_ioctl 29
309#define SYS_ioprio_set 30
310#define SYS_ioprio_get 31
311#define SYS_flock 32
312#define SYS_mknodat 33
313#define SYS_mkdirat 34
314#define SYS_unlinkat 35
315#define SYS_symlinkat 36
316#define SYS_linkat 37
317#define SYS_renameat 38
318#define SYS_umount2 39
319#define SYS_mount 40
320#define SYS_pivot_root 41
321#define SYS_nfsservctl 42
322#define SYS_statfs 43
323#define SYS_fstatfs 44
324#define SYS_truncate 45
325#define SYS_ftruncate 46
326#define SYS_fallocate 47
327#define SYS_faccessat 48
328#define SYS_chdir 49
329#define SYS_fchdir 50
330#define SYS_chroot 51
331#define SYS_fchmod 52
332#define SYS_fchmodat 53
333#define SYS_fchownat 54
334#define SYS_fchown 55
335#define SYS_openat 56
336#define SYS_close 57
337#define SYS_vhangup 58
338#define SYS_pipe2 59
339#define SYS_quotactl 60
340#define SYS_getdents64 61
341#define SYS_lseek 62
342#define SYS_read 63
343#define SYS_write 64
344#define SYS_readv 65
345#define SYS_writev 66
346#define SYS_pread64 67
347#define SYS_pwrite64 68
348#define SYS_preadv 69
349#define SYS_pwritev 70
350#define SYS_sendfile 71
351#define SYS_pselect6 72
352#define SYS_ppoll 73
353#define SYS_signalfd4 74
354#define SYS_vmsplice 75
355#define SYS_splice 76
356#define SYS_tee 77
357#define SYS_readlinkat 78
358#define SYS_fstatat 79
359#define SYS_fstat 80
360#define SYS_sync 81
361#define SYS_fsync 82
362#define SYS_fdatasync 83
363#define SYS_sync_file_range 84
364#define SYS_timerfd_create 85
365#define SYS_timerfd_settime 86
366#define SYS_timerfd_gettime 87
367#define SYS_utimensat 88
368#define SYS_acct 89
369#define SYS_capget 90
370#define SYS_capset 91
371#define SYS_personality 92
372#define SYS_exit 93
373#define SYS_exit_group 94
374#define SYS_waitid 95
375#define SYS_set_tid_address 96
376#define SYS_unshare 97
377#define SYS_futex 98
378#define SYS_set_robust_list 99
379#define SYS_get_robust_list 100
380#define SYS_nanosleep 101
381#define SYS_getitimer 102
382#define SYS_setitimer 103
383#define SYS_kexec_load 104
384#define SYS_init_module 105
385#define SYS_delete_module 106
386#define SYS_timer_create 107
387#define SYS_timer_gettime 108
388#define SYS_timer_getoverrun 109
389#define SYS_timer_settime 110
390#define SYS_timer_delete 111
391#define SYS_clock_settime 112
392#define SYS_clock_gettime 113
393#define SYS_clock_getres 114
394#define SYS_clock_nanosleep 115
395#define SYS_syslog 116
396#define SYS_ptrace 117
397#define SYS_sched_setparam 118
398#define SYS_sched_setscheduler 119
399#define SYS_sched_getscheduler 120
400#define SYS_sched_getparam 121
401#define SYS_sched_setaffinity 122
402#define SYS_sched_getaffinity 123
403#define SYS_sched_yield 124
404#define SYS_sched_get_priority_max 125
405#define SYS_sched_get_priority_min 126
406#define SYS_sched_rr_get_interval 127
407#define SYS_restart_syscall 128
408#define SYS_kill 129
409#define SYS_tkill 130
410#define SYS_tgkill 131
411#define SYS_sigaltstack 132
412#define SYS_rt_sigsuspend 133
413#define SYS_rt_sigaction 134
414#define SYS_rt_sigprocmask 135
415#define SYS_rt_sigpending 136
416#define SYS_rt_sigtimedwait 137
417#define SYS_rt_sigqueueinfo 138
418#define SYS_rt_sigreturn 139
419#define SYS_setpriority 140
420#define SYS_getpriority 141
421#define SYS_reboot 142
422#define SYS_setregid 143
423#define SYS_setgid 144
424#define SYS_setreuid 145
425#define SYS_setuid 146
426#define SYS_setresuid 147
427#define SYS_getresuid 148
428#define SYS_setresgid 149
429#define SYS_getresgid 150
430#define SYS_setfsuid 151
431#define SYS_setfsgid 152
432#define SYS_times 153
433#define SYS_setpgid 154
434#define SYS_getpgid 155
435#define SYS_getsid 156
436#define SYS_setsid 157
437#define SYS_getgroups 158
438#define SYS_setgroups 159
439#define SYS_uname 160
440#define SYS_sethostname 161
441#define SYS_setdomainname 162
442#define SYS_getrlimit 163
443#define SYS_setrlimit 164
444#define SYS_getrusage 165
445#define SYS_umask 166
446#define SYS_prctl 167
447#define SYS_getcpu 168
448#define SYS_gettimeofday 169
449#define SYS_settimeofday 170
450#define SYS_adjtimex 171
451#define SYS_getpid 172
452#define SYS_getppid 173
453#define SYS_getuid 174
454#define SYS_geteuid 175
455#define SYS_getgid 176
456#define SYS_getegid 177
457#define SYS_gettid 178
458#define SYS_sysinfo 179
459#define SYS_mq_open 180
460#define SYS_mq_unlink 181
461#define SYS_mq_timedsend 182
462#define SYS_mq_timedreceive 183
463#define SYS_mq_notify 184
464#define SYS_mq_getsetattr 185
465#define SYS_msgget 186
466#define SYS_msgctl 187
467#define SYS_msgrcv 188
468#define SYS_msgsnd 189
469#define SYS_semget 190
470#define SYS_semctl 191
471#define SYS_semtimedop 192
472#define SYS_semop 193
473#define SYS_shmget 194
474#define SYS_shmctl 195
475#define SYS_shmat 196
476#define SYS_shmdt 197
477#define SYS_socket 198
478#define SYS_socketpair 199
479#define SYS_bind 200
480#define SYS_listen 201
481#define SYS_accept 202
482#define SYS_connect 203
483#define SYS_getsockname 204
484#define SYS_getpeername 205
485#define SYS_sendto 206
486#define SYS_recvfrom 207
487#define SYS_setsockopt 208
488#define SYS_getsockopt 209
489#define SYS_shutdown 210
490#define SYS_sendmsg 211
491#define SYS_recvmsg 212
492#define SYS_readahead 213
493#define SYS_brk 214
494#define SYS_munmap 215
495#define SYS_mremap 216
496#define SYS_add_key 217
497#define SYS_request_key 218
498#define SYS_keyctl 219
499#define SYS_clone 220
500#define SYS_execve 221
501#define SYS_mmap 222
502#define SYS_fadvise64 223
503#define SYS_swapon 224
504#define SYS_swapoff 225
505#define SYS_mprotect 226
506#define SYS_msync 227
507#define SYS_mlock 228
508#define SYS_munlock 229
509#define SYS_mlockall 230
510#define SYS_munlockall 231
511#define SYS_mincore 232
512#define SYS_madvise 233
513#define SYS_remap_file_pages 234
514#define SYS_mbind 235
515#define SYS_get_mempolicy 236
516#define SYS_set_mempolicy 237
517#define SYS_migrate_pages 238
518#define SYS_move_pages 239
519#define SYS_rt_tgsigqueueinfo 240
520#define SYS_perf_event_open 241
521#define SYS_accept4 242
522#define SYS_recvmmsg 243
523#define SYS_arch_specific_syscall 244
524#define SYS_wait4 260
525#define SYS_prlimit64 261
526#define SYS_fanotify_init 262
527#define SYS_fanotify_mark 263
528#define SYS_name_to_handle_at 264
529#define SYS_open_by_handle_at 265
530#define SYS_clock_adjtime 266
531#define SYS_syncfs 267
532#define SYS_setns 268
533#define SYS_sendmmsg 269
534#define SYS_process_vm_readv 270
535#define SYS_process_vm_writev 271
536#define SYS_kcmp 272
537#define SYS_finit_module 273
538#define SYS_sched_setattr 274
539#define SYS_sched_getattr 275
540#define SYS_renameat2 276
541#define SYS_seccomp 277
542#define SYS_getrandom 278
543#define SYS_memfd_create 279
544#define SYS_bpf 280
545#define SYS_execveat 281
546#define SYS_userfaultfd 282
547#define SYS_membarrier 283
548#define SYS_mlock2 284
549#define SYS_copy_file_range 285
550#define SYS_preadv2 286
551#define SYS_pwritev2 287
552#define SYS_pkey_mprotect 288
553#define SYS_pkey_alloc 289
554#define SYS_pkey_free 290
555#define SYS_sysriscv __NR_arch_specific_syscall
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/bits/user.h deleted-43
...@@ -1,43 +0,0 @@
1struct user_regs_struct {
2 unsigned long pc;
3 unsigned long ra;
4 unsigned long sp;
5 unsigned long gp;
6 unsigned long tp;
7 unsigned long t0;
8 unsigned long t1;
9 unsigned long t2;
10 unsigned long s0;
11 unsigned long s1;
12 unsigned long a0;
13 unsigned long a1;
14 unsigned long a2;
15 unsigned long a3;
16 unsigned long a4;
17 unsigned long a5;
18 unsigned long a6;
19 unsigned long a7;
20 unsigned long s2;
21 unsigned long s3;
22 unsigned long s4;
23 unsigned long s5;
24 unsigned long s6;
25 unsigned long s7;
26 unsigned long s8;
27 unsigned long s9;
28 unsigned long s10;
29 unsigned long s11;
30 unsigned long t3;
31 unsigned long t4;
32 unsigned long t5;
33 unsigned long t6;
34};
35
36struct user_fpregs_struct {
37 double f[32];
38 unsigned int fcsr;
39};
40
41#define ELF_NGREG 32
42typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
43typedef struct user_fpregs_struct elf_fpregset_t;
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/elf.h deleted-3228
...@@ -1,3228 +0,0 @@
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_NUM 248
318
319#define EM_ALPHA 0x9026
320
321#define EV_NONE 0
322#define EV_CURRENT 1
323#define EV_NUM 2
324
325typedef struct {
326 Elf32_Word sh_name;
327 Elf32_Word sh_type;
328 Elf32_Word sh_flags;
329 Elf32_Addr sh_addr;
330 Elf32_Off sh_offset;
331 Elf32_Word sh_size;
332 Elf32_Word sh_link;
333 Elf32_Word sh_info;
334 Elf32_Word sh_addralign;
335 Elf32_Word sh_entsize;
336} Elf32_Shdr;
337
338typedef struct {
339 Elf64_Word sh_name;
340 Elf64_Word sh_type;
341 Elf64_Xword sh_flags;
342 Elf64_Addr sh_addr;
343 Elf64_Off sh_offset;
344 Elf64_Xword sh_size;
345 Elf64_Word sh_link;
346 Elf64_Word sh_info;
347 Elf64_Xword sh_addralign;
348 Elf64_Xword sh_entsize;
349} Elf64_Shdr;
350
351
352
353#define SHN_UNDEF 0
354#define SHN_LORESERVE 0xff00
355#define SHN_LOPROC 0xff00
356#define SHN_BEFORE 0xff00
357
358#define SHN_AFTER 0xff01
359
360#define SHN_HIPROC 0xff1f
361#define SHN_LOOS 0xff20
362#define SHN_HIOS 0xff3f
363#define SHN_ABS 0xfff1
364#define SHN_COMMON 0xfff2
365#define SHN_XINDEX 0xffff
366#define SHN_HIRESERVE 0xffff
367
368
369
370#define SHT_NULL 0
371#define SHT_PROGBITS 1
372#define SHT_SYMTAB 2
373#define SHT_STRTAB 3
374#define SHT_RELA 4
375#define SHT_HASH 5
376#define SHT_DYNAMIC 6
377#define SHT_NOTE 7
378#define SHT_NOBITS 8
379#define SHT_REL 9
380#define SHT_SHLIB 10
381#define SHT_DYNSYM 11
382#define SHT_INIT_ARRAY 14
383#define SHT_FINI_ARRAY 15
384#define SHT_PREINIT_ARRAY 16
385#define SHT_GROUP 17
386#define SHT_SYMTAB_SHNDX 18
387#define SHT_NUM 19
388#define SHT_LOOS 0x60000000
389#define SHT_GNU_ATTRIBUTES 0x6ffffff5
390#define SHT_GNU_HASH 0x6ffffff6
391#define SHT_GNU_LIBLIST 0x6ffffff7
392#define SHT_CHECKSUM 0x6ffffff8
393#define SHT_LOSUNW 0x6ffffffa
394#define SHT_SUNW_move 0x6ffffffa
395#define SHT_SUNW_COMDAT 0x6ffffffb
396#define SHT_SUNW_syminfo 0x6ffffffc
397#define SHT_GNU_verdef 0x6ffffffd
398#define SHT_GNU_verneed 0x6ffffffe
399#define SHT_GNU_versym 0x6fffffff
400#define SHT_HISUNW 0x6fffffff
401#define SHT_HIOS 0x6fffffff
402#define SHT_LOPROC 0x70000000
403#define SHT_HIPROC 0x7fffffff
404#define SHT_LOUSER 0x80000000
405#define SHT_HIUSER 0x8fffffff
406
407#define SHF_WRITE (1 << 0)
408#define SHF_ALLOC (1 << 1)
409#define SHF_EXECINSTR (1 << 2)
410#define SHF_MERGE (1 << 4)
411#define SHF_STRINGS (1 << 5)
412#define SHF_INFO_LINK (1 << 6)
413#define SHF_LINK_ORDER (1 << 7)
414#define SHF_OS_NONCONFORMING (1 << 8)
415
416#define SHF_GROUP (1 << 9)
417#define SHF_TLS (1 << 10)
418#define SHF_COMPRESSED (1 << 11)
419#define SHF_MASKOS 0x0ff00000
420#define SHF_MASKPROC 0xf0000000
421#define SHF_ORDERED (1 << 30)
422#define SHF_EXCLUDE (1U << 31)
423
424typedef struct {
425 Elf32_Word ch_type;
426 Elf32_Word ch_size;
427 Elf32_Word ch_addralign;
428} Elf32_Chdr;
429
430typedef struct {
431 Elf64_Word ch_type;
432 Elf64_Word ch_reserved;
433 Elf64_Xword ch_size;
434 Elf64_Xword ch_addralign;
435} Elf64_Chdr;
436
437#define ELFCOMPRESS_ZLIB 1
438#define ELFCOMPRESS_LOOS 0x60000000
439#define ELFCOMPRESS_HIOS 0x6fffffff
440#define ELFCOMPRESS_LOPROC 0x70000000
441#define ELFCOMPRESS_HIPROC 0x7fffffff
442
443
444#define GRP_COMDAT 0x1
445
446typedef struct {
447 Elf32_Word st_name;
448 Elf32_Addr st_value;
449 Elf32_Word st_size;
450 unsigned char st_info;
451 unsigned char st_other;
452 Elf32_Section st_shndx;
453} Elf32_Sym;
454
455typedef struct {
456 Elf64_Word st_name;
457 unsigned char st_info;
458 unsigned char st_other;
459 Elf64_Section st_shndx;
460 Elf64_Addr st_value;
461 Elf64_Xword st_size;
462} Elf64_Sym;
463
464typedef struct {
465 Elf32_Half si_boundto;
466 Elf32_Half si_flags;
467} Elf32_Syminfo;
468
469typedef struct {
470 Elf64_Half si_boundto;
471 Elf64_Half si_flags;
472} Elf64_Syminfo;
473
474#define SYMINFO_BT_SELF 0xffff
475#define SYMINFO_BT_PARENT 0xfffe
476#define SYMINFO_BT_LOWRESERVE 0xff00
477
478#define SYMINFO_FLG_DIRECT 0x0001
479#define SYMINFO_FLG_PASSTHRU 0x0002
480#define SYMINFO_FLG_COPY 0x0004
481#define SYMINFO_FLG_LAZYLOAD 0x0008
482
483#define SYMINFO_NONE 0
484#define SYMINFO_CURRENT 1
485#define SYMINFO_NUM 2
486
487#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
488#define ELF32_ST_TYPE(val) ((val) & 0xf)
489#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
490
491#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
492#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
493#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
494
495#define STB_LOCAL 0
496#define STB_GLOBAL 1
497#define STB_WEAK 2
498#define STB_NUM 3
499#define STB_LOOS 10
500#define STB_GNU_UNIQUE 10
501#define STB_HIOS 12
502#define STB_LOPROC 13
503#define STB_HIPROC 15
504
505#define STT_NOTYPE 0
506#define STT_OBJECT 1
507#define STT_FUNC 2
508#define STT_SECTION 3
509#define STT_FILE 4
510#define STT_COMMON 5
511#define STT_TLS 6
512#define STT_NUM 7
513#define STT_LOOS 10
514#define STT_GNU_IFUNC 10
515#define STT_HIOS 12
516#define STT_LOPROC 13
517#define STT_HIPROC 15
518
519#define STN_UNDEF 0
520
521#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
522#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
523
524#define STV_DEFAULT 0
525#define STV_INTERNAL 1
526#define STV_HIDDEN 2
527#define STV_PROTECTED 3
528
529
530
531
532typedef struct {
533 Elf32_Addr r_offset;
534 Elf32_Word r_info;
535} Elf32_Rel;
536
537typedef struct {
538 Elf64_Addr r_offset;
539 Elf64_Xword r_info;
540} Elf64_Rel;
541
542
543
544typedef struct {
545 Elf32_Addr r_offset;
546 Elf32_Word r_info;
547 Elf32_Sword r_addend;
548} Elf32_Rela;
549
550typedef struct {
551 Elf64_Addr r_offset;
552 Elf64_Xword r_info;
553 Elf64_Sxword r_addend;
554} Elf64_Rela;
555
556
557
558#define ELF32_R_SYM(val) ((val) >> 8)
559#define ELF32_R_TYPE(val) ((val) & 0xff)
560#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
561
562#define ELF64_R_SYM(i) ((i) >> 32)
563#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
564#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
565
566
567
568typedef struct {
569 Elf32_Word p_type;
570 Elf32_Off p_offset;
571 Elf32_Addr p_vaddr;
572 Elf32_Addr p_paddr;
573 Elf32_Word p_filesz;
574 Elf32_Word p_memsz;
575 Elf32_Word p_flags;
576 Elf32_Word p_align;
577} Elf32_Phdr;
578
579typedef struct {
580 Elf64_Word p_type;
581 Elf64_Word p_flags;
582 Elf64_Off p_offset;
583 Elf64_Addr p_vaddr;
584 Elf64_Addr p_paddr;
585 Elf64_Xword p_filesz;
586 Elf64_Xword p_memsz;
587 Elf64_Xword p_align;
588} Elf64_Phdr;
589
590
591
592#define PT_NULL 0
593#define PT_LOAD 1
594#define PT_DYNAMIC 2
595#define PT_INTERP 3
596#define PT_NOTE 4
597#define PT_SHLIB 5
598#define PT_PHDR 6
599#define PT_TLS 7
600#define PT_NUM 8
601#define PT_LOOS 0x60000000
602#define PT_GNU_EH_FRAME 0x6474e550
603#define PT_GNU_STACK 0x6474e551
604#define PT_GNU_RELRO 0x6474e552
605#define PT_LOSUNW 0x6ffffffa
606#define PT_SUNWBSS 0x6ffffffa
607#define PT_SUNWSTACK 0x6ffffffb
608#define PT_HISUNW 0x6fffffff
609#define PT_HIOS 0x6fffffff
610#define PT_LOPROC 0x70000000
611#define PT_HIPROC 0x7fffffff
612
613
614#define PN_XNUM 0xffff
615
616
617#define PF_X (1 << 0)
618#define PF_W (1 << 1)
619#define PF_R (1 << 2)
620#define PF_MASKOS 0x0ff00000
621#define PF_MASKPROC 0xf0000000
622
623
624
625#define NT_PRSTATUS 1
626#define NT_PRFPREG 2
627#define NT_FPREGSET 2
628#define NT_PRPSINFO 3
629#define NT_PRXREG 4
630#define NT_TASKSTRUCT 4
631#define NT_PLATFORM 5
632#define NT_AUXV 6
633#define NT_GWINDOWS 7
634#define NT_ASRS 8
635#define NT_PSTATUS 10
636#define NT_PSINFO 13
637#define NT_PRCRED 14
638#define NT_UTSNAME 15
639#define NT_LWPSTATUS 16
640#define NT_LWPSINFO 17
641#define NT_PRFPXREG 20
642#define NT_SIGINFO 0x53494749
643#define NT_FILE 0x46494c45
644#define NT_PRXFPREG 0x46e62b7f
645#define NT_PPC_VMX 0x100
646#define NT_PPC_SPE 0x101
647#define NT_PPC_VSX 0x102
648#define NT_PPC_TAR 0x103
649#define NT_PPC_PPR 0x104
650#define NT_PPC_DSCR 0x105
651#define NT_PPC_EBB 0x106
652#define NT_PPC_PMU 0x107
653#define NT_PPC_TM_CGPR 0x108
654#define NT_PPC_TM_CFPR 0x109
655#define NT_PPC_TM_CVMX 0x10a
656#define NT_PPC_TM_CVSX 0x10b
657#define NT_PPC_TM_SPR 0x10c
658#define NT_PPC_TM_CTAR 0x10d
659#define NT_PPC_TM_CPPR 0x10e
660#define NT_PPC_TM_CDSCR 0x10f
661#define NT_386_TLS 0x200
662#define NT_386_IOPERM 0x201
663#define NT_X86_XSTATE 0x202
664#define NT_S390_HIGH_GPRS 0x300
665#define NT_S390_TIMER 0x301
666#define NT_S390_TODCMP 0x302
667#define NT_S390_TODPREG 0x303
668#define NT_S390_CTRS 0x304
669#define NT_S390_PREFIX 0x305
670#define NT_S390_LAST_BREAK 0x306
671#define NT_S390_SYSTEM_CALL 0x307
672#define NT_S390_TDB 0x308
673#define NT_S390_VXRS_LOW 0x309
674#define NT_S390_VXRS_HIGH 0x30a
675#define NT_S390_GS_CB 0x30b
676#define NT_S390_GS_BC 0x30c
677#define NT_S390_RI_CB 0x30d
678#define NT_ARM_VFP 0x400
679#define NT_ARM_TLS 0x401
680#define NT_ARM_HW_BREAK 0x402
681#define NT_ARM_HW_WATCH 0x403
682#define NT_ARM_SYSTEM_CALL 0x404
683#define NT_ARM_SVE 0x405
684#define NT_METAG_CBUF 0x500
685#define NT_METAG_RPIPE 0x501
686#define NT_METAG_TLS 0x502
687#define NT_ARC_V2 0x600
688#define NT_VERSION 1
689
690
691
692
693typedef struct {
694 Elf32_Sword d_tag;
695 union {
696 Elf32_Word d_val;
697 Elf32_Addr d_ptr;
698 } d_un;
699} Elf32_Dyn;
700
701typedef struct {
702 Elf64_Sxword d_tag;
703 union {
704 Elf64_Xword d_val;
705 Elf64_Addr d_ptr;
706 } d_un;
707} Elf64_Dyn;
708
709
710
711#define DT_NULL 0
712#define DT_NEEDED 1
713#define DT_PLTRELSZ 2
714#define DT_PLTGOT 3
715#define DT_HASH 4
716#define DT_STRTAB 5
717#define DT_SYMTAB 6
718#define DT_RELA 7
719#define DT_RELASZ 8
720#define DT_RELAENT 9
721#define DT_STRSZ 10
722#define DT_SYMENT 11
723#define DT_INIT 12
724#define DT_FINI 13
725#define DT_SONAME 14
726#define DT_RPATH 15
727#define DT_SYMBOLIC 16
728#define DT_REL 17
729#define DT_RELSZ 18
730#define DT_RELENT 19
731#define DT_PLTREL 20
732#define DT_DEBUG 21
733#define DT_TEXTREL 22
734#define DT_JMPREL 23
735#define DT_BIND_NOW 24
736#define DT_INIT_ARRAY 25
737#define DT_FINI_ARRAY 26
738#define DT_INIT_ARRAYSZ 27
739#define DT_FINI_ARRAYSZ 28
740#define DT_RUNPATH 29
741#define DT_FLAGS 30
742#define DT_ENCODING 32
743#define DT_PREINIT_ARRAY 32
744#define DT_PREINIT_ARRAYSZ 33
745#define DT_SYMTAB_SHNDX 34
746#define DT_NUM 35
747#define DT_LOOS 0x6000000d
748#define DT_HIOS 0x6ffff000
749#define DT_LOPROC 0x70000000
750#define DT_HIPROC 0x7fffffff
751#define DT_PROCNUM DT_MIPS_NUM
752
753#define DT_VALRNGLO 0x6ffffd00
754#define DT_GNU_PRELINKED 0x6ffffdf5
755#define DT_GNU_CONFLICTSZ 0x6ffffdf6
756#define DT_GNU_LIBLISTSZ 0x6ffffdf7
757#define DT_CHECKSUM 0x6ffffdf8
758#define DT_PLTPADSZ 0x6ffffdf9
759#define DT_MOVEENT 0x6ffffdfa
760#define DT_MOVESZ 0x6ffffdfb
761#define DT_FEATURE_1 0x6ffffdfc
762#define DT_POSFLAG_1 0x6ffffdfd
763
764#define DT_SYMINSZ 0x6ffffdfe
765#define DT_SYMINENT 0x6ffffdff
766#define DT_VALRNGHI 0x6ffffdff
767#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
768#define DT_VALNUM 12
769
770#define DT_ADDRRNGLO 0x6ffffe00
771#define DT_GNU_HASH 0x6ffffef5
772#define DT_TLSDESC_PLT 0x6ffffef6
773#define DT_TLSDESC_GOT 0x6ffffef7
774#define DT_GNU_CONFLICT 0x6ffffef8
775#define DT_GNU_LIBLIST 0x6ffffef9
776#define DT_CONFIG 0x6ffffefa
777#define DT_DEPAUDIT 0x6ffffefb
778#define DT_AUDIT 0x6ffffefc
779#define DT_PLTPAD 0x6ffffefd
780#define DT_MOVETAB 0x6ffffefe
781#define DT_SYMINFO 0x6ffffeff
782#define DT_ADDRRNGHI 0x6ffffeff
783#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
784#define DT_ADDRNUM 11
785
786
787
788#define DT_VERSYM 0x6ffffff0
789
790#define DT_RELACOUNT 0x6ffffff9
791#define DT_RELCOUNT 0x6ffffffa
792
793
794#define DT_FLAGS_1 0x6ffffffb
795#define DT_VERDEF 0x6ffffffc
796
797#define DT_VERDEFNUM 0x6ffffffd
798#define DT_VERNEED 0x6ffffffe
799
800#define DT_VERNEEDNUM 0x6fffffff
801#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
802#define DT_VERSIONTAGNUM 16
803
804
805
806#define DT_AUXILIARY 0x7ffffffd
807#define DT_FILTER 0x7fffffff
808#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
809#define DT_EXTRANUM 3
810
811
812#define DF_ORIGIN 0x00000001
813#define DF_SYMBOLIC 0x00000002
814#define DF_TEXTREL 0x00000004
815#define DF_BIND_NOW 0x00000008
816#define DF_STATIC_TLS 0x00000010
817
818
819
820#define DF_1_NOW 0x00000001
821#define DF_1_GLOBAL 0x00000002
822#define DF_1_GROUP 0x00000004
823#define DF_1_NODELETE 0x00000008
824#define DF_1_LOADFLTR 0x00000010
825#define DF_1_INITFIRST 0x00000020
826#define DF_1_NOOPEN 0x00000040
827#define DF_1_ORIGIN 0x00000080
828#define DF_1_DIRECT 0x00000100
829#define DF_1_TRANS 0x00000200
830#define DF_1_INTERPOSE 0x00000400
831#define DF_1_NODEFLIB 0x00000800
832#define DF_1_NODUMP 0x00001000
833#define DF_1_CONFALT 0x00002000
834#define DF_1_ENDFILTEE 0x00004000
835#define DF_1_DISPRELDNE 0x00008000
836#define DF_1_DISPRELPND 0x00010000
837#define DF_1_NODIRECT 0x00020000
838#define DF_1_IGNMULDEF 0x00040000
839#define DF_1_NOKSYMS 0x00080000
840#define DF_1_NOHDR 0x00100000
841#define DF_1_EDITED 0x00200000
842#define DF_1_NORELOC 0x00400000
843#define DF_1_SYMINTPOSE 0x00800000
844#define DF_1_GLOBAUDIT 0x01000000
845#define DF_1_SINGLETON 0x02000000
846#define DF_1_STUB 0x04000000
847#define DF_1_PIE 0x08000000
848
849#define DTF_1_PARINIT 0x00000001
850#define DTF_1_CONFEXP 0x00000002
851
852
853#define DF_P1_LAZYLOAD 0x00000001
854#define DF_P1_GROUPPERM 0x00000002
855
856
857
858
859typedef struct {
860 Elf32_Half vd_version;
861 Elf32_Half vd_flags;
862 Elf32_Half vd_ndx;
863 Elf32_Half vd_cnt;
864 Elf32_Word vd_hash;
865 Elf32_Word vd_aux;
866 Elf32_Word vd_next;
867} Elf32_Verdef;
868
869typedef struct {
870 Elf64_Half vd_version;
871 Elf64_Half vd_flags;
872 Elf64_Half vd_ndx;
873 Elf64_Half vd_cnt;
874 Elf64_Word vd_hash;
875 Elf64_Word vd_aux;
876 Elf64_Word vd_next;
877} Elf64_Verdef;
878
879
880
881#define VER_DEF_NONE 0
882#define VER_DEF_CURRENT 1
883#define VER_DEF_NUM 2
884
885
886#define VER_FLG_BASE 0x1
887#define VER_FLG_WEAK 0x2
888
889
890#define VER_NDX_LOCAL 0
891#define VER_NDX_GLOBAL 1
892#define VER_NDX_LORESERVE 0xff00
893#define VER_NDX_ELIMINATE 0xff01
894
895
896
897typedef struct {
898 Elf32_Word vda_name;
899 Elf32_Word vda_next;
900} Elf32_Verdaux;
901
902typedef struct {
903 Elf64_Word vda_name;
904 Elf64_Word vda_next;
905} Elf64_Verdaux;
906
907
908
909
910typedef struct {
911 Elf32_Half vn_version;
912 Elf32_Half vn_cnt;
913 Elf32_Word vn_file;
914 Elf32_Word vn_aux;
915 Elf32_Word vn_next;
916} Elf32_Verneed;
917
918typedef struct {
919 Elf64_Half vn_version;
920 Elf64_Half vn_cnt;
921 Elf64_Word vn_file;
922 Elf64_Word vn_aux;
923 Elf64_Word vn_next;
924} Elf64_Verneed;
925
926
927
928#define VER_NEED_NONE 0
929#define VER_NEED_CURRENT 1
930#define VER_NEED_NUM 2
931
932
933
934typedef struct {
935 Elf32_Word vna_hash;
936 Elf32_Half vna_flags;
937 Elf32_Half vna_other;
938 Elf32_Word vna_name;
939 Elf32_Word vna_next;
940} Elf32_Vernaux;
941
942typedef struct {
943 Elf64_Word vna_hash;
944 Elf64_Half vna_flags;
945 Elf64_Half vna_other;
946 Elf64_Word vna_name;
947 Elf64_Word vna_next;
948} Elf64_Vernaux;
949
950
951
952#define VER_FLG_WEAK 0x2
953
954
955
956typedef struct {
957 uint32_t a_type;
958 union {
959 uint32_t a_val;
960 } a_un;
961} Elf32_auxv_t;
962
963typedef struct {
964 uint64_t a_type;
965 union {
966 uint64_t a_val;
967 } a_un;
968} Elf64_auxv_t;
969
970
971
972#define AT_NULL 0
973#define AT_IGNORE 1
974#define AT_EXECFD 2
975#define AT_PHDR 3
976#define AT_PHENT 4
977#define AT_PHNUM 5
978#define AT_PAGESZ 6
979#define AT_BASE 7
980#define AT_FLAGS 8
981#define AT_ENTRY 9
982#define AT_NOTELF 10
983#define AT_UID 11
984#define AT_EUID 12
985#define AT_GID 13
986#define AT_EGID 14
987#define AT_CLKTCK 17
988
989
990#define AT_PLATFORM 15
991#define AT_HWCAP 16
992
993
994
995
996#define AT_FPUCW 18
997
998
999#define AT_DCACHEBSIZE 19
1000#define AT_ICACHEBSIZE 20
1001#define AT_UCACHEBSIZE 21
1002
1003
1004
1005#define AT_IGNOREPPC 22
1006
1007#define AT_SECURE 23
1008
1009#define AT_BASE_PLATFORM 24
1010
1011#define AT_RANDOM 25
1012
1013#define AT_HWCAP2 26
1014
1015#define AT_EXECFN 31
1016
1017
1018
1019#define AT_SYSINFO 32
1020#define AT_SYSINFO_EHDR 33
1021
1022
1023
1024#define AT_L1I_CACHESHAPE 34
1025#define AT_L1D_CACHESHAPE 35
1026#define AT_L2_CACHESHAPE 36
1027#define AT_L3_CACHESHAPE 37
1028
1029#define AT_L1I_CACHESIZE 40
1030#define AT_L1I_CACHEGEOMETRY 41
1031#define AT_L1D_CACHESIZE 42
1032#define AT_L1D_CACHEGEOMETRY 43
1033#define AT_L2_CACHESIZE 44
1034#define AT_L2_CACHEGEOMETRY 45
1035#define AT_L3_CACHESIZE 46
1036#define AT_L3_CACHEGEOMETRY 47
1037
1038
1039
1040typedef struct {
1041 Elf32_Word n_namesz;
1042 Elf32_Word n_descsz;
1043 Elf32_Word n_type;
1044} Elf32_Nhdr;
1045
1046typedef struct {
1047 Elf64_Word n_namesz;
1048 Elf64_Word n_descsz;
1049 Elf64_Word n_type;
1050} Elf64_Nhdr;
1051
1052
1053
1054
1055#define ELF_NOTE_SOLARIS "SUNW Solaris"
1056
1057
1058#define ELF_NOTE_GNU "GNU"
1059
1060
1061
1062
1063
1064#define ELF_NOTE_PAGESIZE_HINT 1
1065
1066
1067#define NT_GNU_ABI_TAG 1
1068#define ELF_NOTE_ABI NT_GNU_ABI_TAG
1069
1070
1071
1072#define ELF_NOTE_OS_LINUX 0
1073#define ELF_NOTE_OS_GNU 1
1074#define ELF_NOTE_OS_SOLARIS2 2
1075#define ELF_NOTE_OS_FREEBSD 3
1076
1077#define NT_GNU_BUILD_ID 3
1078#define NT_GNU_GOLD_VERSION 4
1079
1080
1081
1082typedef struct {
1083 Elf32_Xword m_value;
1084 Elf32_Word m_info;
1085 Elf32_Word m_poffset;
1086 Elf32_Half m_repeat;
1087 Elf32_Half m_stride;
1088} Elf32_Move;
1089
1090typedef struct {
1091 Elf64_Xword m_value;
1092 Elf64_Xword m_info;
1093 Elf64_Xword m_poffset;
1094 Elf64_Half m_repeat;
1095 Elf64_Half m_stride;
1096} Elf64_Move;
1097
1098
1099#define ELF32_M_SYM(info) ((info) >> 8)
1100#define ELF32_M_SIZE(info) ((unsigned char) (info))
1101#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
1102
1103#define ELF64_M_SYM(info) ELF32_M_SYM (info)
1104#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
1105#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
1106
1107#define EF_CPU32 0x00810000
1108
1109#define R_68K_NONE 0
1110#define R_68K_32 1
1111#define R_68K_16 2
1112#define R_68K_8 3
1113#define R_68K_PC32 4
1114#define R_68K_PC16 5
1115#define R_68K_PC8 6
1116#define R_68K_GOT32 7
1117#define R_68K_GOT16 8
1118#define R_68K_GOT8 9
1119#define R_68K_GOT32O 10
1120#define R_68K_GOT16O 11
1121#define R_68K_GOT8O 12
1122#define R_68K_PLT32 13
1123#define R_68K_PLT16 14
1124#define R_68K_PLT8 15
1125#define R_68K_PLT32O 16
1126#define R_68K_PLT16O 17
1127#define R_68K_PLT8O 18
1128#define R_68K_COPY 19
1129#define R_68K_GLOB_DAT 20
1130#define R_68K_JMP_SLOT 21
1131#define R_68K_RELATIVE 22
1132#define R_68K_TLS_GD32 25
1133#define R_68K_TLS_GD16 26
1134#define R_68K_TLS_GD8 27
1135#define R_68K_TLS_LDM32 28
1136#define R_68K_TLS_LDM16 29
1137#define R_68K_TLS_LDM8 30
1138#define R_68K_TLS_LDO32 31
1139#define R_68K_TLS_LDO16 32
1140#define R_68K_TLS_LDO8 33
1141#define R_68K_TLS_IE32 34
1142#define R_68K_TLS_IE16 35
1143#define R_68K_TLS_IE8 36
1144#define R_68K_TLS_LE32 37
1145#define R_68K_TLS_LE16 38
1146#define R_68K_TLS_LE8 39
1147#define R_68K_TLS_DTPMOD32 40
1148#define R_68K_TLS_DTPREL32 41
1149#define R_68K_TLS_TPREL32 42
1150#define R_68K_NUM 43
1151
1152#define R_386_NONE 0
1153#define R_386_32 1
1154#define R_386_PC32 2
1155#define R_386_GOT32 3
1156#define R_386_PLT32 4
1157#define R_386_COPY 5
1158#define R_386_GLOB_DAT 6
1159#define R_386_JMP_SLOT 7
1160#define R_386_RELATIVE 8
1161#define R_386_GOTOFF 9
1162#define R_386_GOTPC 10
1163#define R_386_32PLT 11
1164#define R_386_TLS_TPOFF 14
1165#define R_386_TLS_IE 15
1166#define R_386_TLS_GOTIE 16
1167#define R_386_TLS_LE 17
1168#define R_386_TLS_GD 18
1169#define R_386_TLS_LDM 19
1170#define R_386_16 20
1171#define R_386_PC16 21
1172#define R_386_8 22
1173#define R_386_PC8 23
1174#define R_386_TLS_GD_32 24
1175#define R_386_TLS_GD_PUSH 25
1176#define R_386_TLS_GD_CALL 26
1177#define R_386_TLS_GD_POP 27
1178#define R_386_TLS_LDM_32 28
1179#define R_386_TLS_LDM_PUSH 29
1180#define R_386_TLS_LDM_CALL 30
1181#define R_386_TLS_LDM_POP 31
1182#define R_386_TLS_LDO_32 32
1183#define R_386_TLS_IE_32 33
1184#define R_386_TLS_LE_32 34
1185#define R_386_TLS_DTPMOD32 35
1186#define R_386_TLS_DTPOFF32 36
1187#define R_386_TLS_TPOFF32 37
1188#define R_386_SIZE32 38
1189#define R_386_TLS_GOTDESC 39
1190#define R_386_TLS_DESC_CALL 40
1191#define R_386_TLS_DESC 41
1192#define R_386_IRELATIVE 42
1193#define R_386_GOT32X 43
1194#define R_386_NUM 44
1195
1196
1197
1198
1199
1200#define STT_SPARC_REGISTER 13
1201
1202
1203
1204#define EF_SPARCV9_MM 3
1205#define EF_SPARCV9_TSO 0
1206#define EF_SPARCV9_PSO 1
1207#define EF_SPARCV9_RMO 2
1208#define EF_SPARC_LEDATA 0x800000
1209#define EF_SPARC_EXT_MASK 0xFFFF00
1210#define EF_SPARC_32PLUS 0x000100
1211#define EF_SPARC_SUN_US1 0x000200
1212#define EF_SPARC_HAL_R1 0x000400
1213#define EF_SPARC_SUN_US3 0x000800
1214
1215
1216
1217#define R_SPARC_NONE 0
1218#define R_SPARC_8 1
1219#define R_SPARC_16 2
1220#define R_SPARC_32 3
1221#define R_SPARC_DISP8 4
1222#define R_SPARC_DISP16 5
1223#define R_SPARC_DISP32 6
1224#define R_SPARC_WDISP30 7
1225#define R_SPARC_WDISP22 8
1226#define R_SPARC_HI22 9
1227#define R_SPARC_22 10
1228#define R_SPARC_13 11
1229#define R_SPARC_LO10 12
1230#define R_SPARC_GOT10 13
1231#define R_SPARC_GOT13 14
1232#define R_SPARC_GOT22 15
1233#define R_SPARC_PC10 16
1234#define R_SPARC_PC22 17
1235#define R_SPARC_WPLT30 18
1236#define R_SPARC_COPY 19
1237#define R_SPARC_GLOB_DAT 20
1238#define R_SPARC_JMP_SLOT 21
1239#define R_SPARC_RELATIVE 22
1240#define R_SPARC_UA32 23
1241
1242
1243
1244#define R_SPARC_PLT32 24
1245#define R_SPARC_HIPLT22 25
1246#define R_SPARC_LOPLT10 26
1247#define R_SPARC_PCPLT32 27
1248#define R_SPARC_PCPLT22 28
1249#define R_SPARC_PCPLT10 29
1250#define R_SPARC_10 30
1251#define R_SPARC_11 31
1252#define R_SPARC_64 32
1253#define R_SPARC_OLO10 33
1254#define R_SPARC_HH22 34
1255#define R_SPARC_HM10 35
1256#define R_SPARC_LM22 36
1257#define R_SPARC_PC_HH22 37
1258#define R_SPARC_PC_HM10 38
1259#define R_SPARC_PC_LM22 39
1260#define R_SPARC_WDISP16 40
1261#define R_SPARC_WDISP19 41
1262#define R_SPARC_GLOB_JMP 42
1263#define R_SPARC_7 43
1264#define R_SPARC_5 44
1265#define R_SPARC_6 45
1266#define R_SPARC_DISP64 46
1267#define R_SPARC_PLT64 47
1268#define R_SPARC_HIX22 48
1269#define R_SPARC_LOX10 49
1270#define R_SPARC_H44 50
1271#define R_SPARC_M44 51
1272#define R_SPARC_L44 52
1273#define R_SPARC_REGISTER 53
1274#define R_SPARC_UA64 54
1275#define R_SPARC_UA16 55
1276#define R_SPARC_TLS_GD_HI22 56
1277#define R_SPARC_TLS_GD_LO10 57
1278#define R_SPARC_TLS_GD_ADD 58
1279#define R_SPARC_TLS_GD_CALL 59
1280#define R_SPARC_TLS_LDM_HI22 60
1281#define R_SPARC_TLS_LDM_LO10 61
1282#define R_SPARC_TLS_LDM_ADD 62
1283#define R_SPARC_TLS_LDM_CALL 63
1284#define R_SPARC_TLS_LDO_HIX22 64
1285#define R_SPARC_TLS_LDO_LOX10 65
1286#define R_SPARC_TLS_LDO_ADD 66
1287#define R_SPARC_TLS_IE_HI22 67
1288#define R_SPARC_TLS_IE_LO10 68
1289#define R_SPARC_TLS_IE_LD 69
1290#define R_SPARC_TLS_IE_LDX 70
1291#define R_SPARC_TLS_IE_ADD 71
1292#define R_SPARC_TLS_LE_HIX22 72
1293#define R_SPARC_TLS_LE_LOX10 73
1294#define R_SPARC_TLS_DTPMOD32 74
1295#define R_SPARC_TLS_DTPMOD64 75
1296#define R_SPARC_TLS_DTPOFF32 76
1297#define R_SPARC_TLS_DTPOFF64 77
1298#define R_SPARC_TLS_TPOFF32 78
1299#define R_SPARC_TLS_TPOFF64 79
1300#define R_SPARC_GOTDATA_HIX22 80
1301#define R_SPARC_GOTDATA_LOX10 81
1302#define R_SPARC_GOTDATA_OP_HIX22 82
1303#define R_SPARC_GOTDATA_OP_LOX10 83
1304#define R_SPARC_GOTDATA_OP 84
1305#define R_SPARC_H34 85
1306#define R_SPARC_SIZE32 86
1307#define R_SPARC_SIZE64 87
1308#define R_SPARC_GNU_VTINHERIT 250
1309#define R_SPARC_GNU_VTENTRY 251
1310#define R_SPARC_REV32 252
1311
1312#define R_SPARC_NUM 253
1313
1314
1315
1316#define DT_SPARC_REGISTER 0x70000001
1317#define DT_SPARC_NUM 2
1318
1319
1320#define EF_MIPS_NOREORDER 1
1321#define EF_MIPS_PIC 2
1322#define EF_MIPS_CPIC 4
1323#define EF_MIPS_XGOT 8
1324#define EF_MIPS_64BIT_WHIRL 16
1325#define EF_MIPS_ABI2 32
1326#define EF_MIPS_ABI_ON32 64
1327#define EF_MIPS_FP64 512
1328#define EF_MIPS_NAN2008 1024
1329#define EF_MIPS_ARCH 0xf0000000
1330
1331
1332
1333#define EF_MIPS_ARCH_1 0x00000000
1334#define EF_MIPS_ARCH_2 0x10000000
1335#define EF_MIPS_ARCH_3 0x20000000
1336#define EF_MIPS_ARCH_4 0x30000000
1337#define EF_MIPS_ARCH_5 0x40000000
1338#define EF_MIPS_ARCH_32 0x50000000
1339#define EF_MIPS_ARCH_64 0x60000000
1340#define EF_MIPS_ARCH_32R2 0x70000000
1341#define EF_MIPS_ARCH_64R2 0x80000000
1342
1343
1344#define E_MIPS_ARCH_1 0x00000000
1345#define E_MIPS_ARCH_2 0x10000000
1346#define E_MIPS_ARCH_3 0x20000000
1347#define E_MIPS_ARCH_4 0x30000000
1348#define E_MIPS_ARCH_5 0x40000000
1349#define E_MIPS_ARCH_32 0x50000000
1350#define E_MIPS_ARCH_64 0x60000000
1351
1352
1353
1354#define SHN_MIPS_ACOMMON 0xff00
1355#define SHN_MIPS_TEXT 0xff01
1356#define SHN_MIPS_DATA 0xff02
1357#define SHN_MIPS_SCOMMON 0xff03
1358#define SHN_MIPS_SUNDEFINED 0xff04
1359
1360
1361
1362#define SHT_MIPS_LIBLIST 0x70000000
1363#define SHT_MIPS_MSYM 0x70000001
1364#define SHT_MIPS_CONFLICT 0x70000002
1365#define SHT_MIPS_GPTAB 0x70000003
1366#define SHT_MIPS_UCODE 0x70000004
1367#define SHT_MIPS_DEBUG 0x70000005
1368#define SHT_MIPS_REGINFO 0x70000006
1369#define SHT_MIPS_PACKAGE 0x70000007
1370#define SHT_MIPS_PACKSYM 0x70000008
1371#define SHT_MIPS_RELD 0x70000009
1372#define SHT_MIPS_IFACE 0x7000000b
1373#define SHT_MIPS_CONTENT 0x7000000c
1374#define SHT_MIPS_OPTIONS 0x7000000d
1375#define SHT_MIPS_SHDR 0x70000010
1376#define SHT_MIPS_FDESC 0x70000011
1377#define SHT_MIPS_EXTSYM 0x70000012
1378#define SHT_MIPS_DENSE 0x70000013
1379#define SHT_MIPS_PDESC 0x70000014
1380#define SHT_MIPS_LOCSYM 0x70000015
1381#define SHT_MIPS_AUXSYM 0x70000016
1382#define SHT_MIPS_OPTSYM 0x70000017
1383#define SHT_MIPS_LOCSTR 0x70000018
1384#define SHT_MIPS_LINE 0x70000019
1385#define SHT_MIPS_RFDESC 0x7000001a
1386#define SHT_MIPS_DELTASYM 0x7000001b
1387#define SHT_MIPS_DELTAINST 0x7000001c
1388#define SHT_MIPS_DELTACLASS 0x7000001d
1389#define SHT_MIPS_DWARF 0x7000001e
1390#define SHT_MIPS_DELTADECL 0x7000001f
1391#define SHT_MIPS_SYMBOL_LIB 0x70000020
1392#define SHT_MIPS_EVENTS 0x70000021
1393#define SHT_MIPS_TRANSLATE 0x70000022
1394#define SHT_MIPS_PIXIE 0x70000023
1395#define SHT_MIPS_XLATE 0x70000024
1396#define SHT_MIPS_XLATE_DEBUG 0x70000025
1397#define SHT_MIPS_WHIRL 0x70000026
1398#define SHT_MIPS_EH_REGION 0x70000027
1399#define SHT_MIPS_XLATE_OLD 0x70000028
1400#define SHT_MIPS_PDR_EXCEPTION 0x70000029
1401
1402
1403
1404#define SHF_MIPS_GPREL 0x10000000
1405#define SHF_MIPS_MERGE 0x20000000
1406#define SHF_MIPS_ADDR 0x40000000
1407#define SHF_MIPS_STRINGS 0x80000000
1408#define SHF_MIPS_NOSTRIP 0x08000000
1409#define SHF_MIPS_LOCAL 0x04000000
1410#define SHF_MIPS_NAMES 0x02000000
1411#define SHF_MIPS_NODUPE 0x01000000
1412
1413
1414
1415
1416
1417#define STO_MIPS_DEFAULT 0x0
1418#define STO_MIPS_INTERNAL 0x1
1419#define STO_MIPS_HIDDEN 0x2
1420#define STO_MIPS_PROTECTED 0x3
1421#define STO_MIPS_PLT 0x8
1422#define STO_MIPS_SC_ALIGN_UNUSED 0xff
1423
1424
1425#define STB_MIPS_SPLIT_COMMON 13
1426
1427
1428
1429typedef union {
1430 struct {
1431 Elf32_Word gt_current_g_value;
1432 Elf32_Word gt_unused;
1433 } gt_header;
1434 struct {
1435 Elf32_Word gt_g_value;
1436 Elf32_Word gt_bytes;
1437 } gt_entry;
1438} Elf32_gptab;
1439
1440
1441
1442typedef struct {
1443 Elf32_Word ri_gprmask;
1444 Elf32_Word ri_cprmask[4];
1445 Elf32_Sword ri_gp_value;
1446} Elf32_RegInfo;
1447
1448
1449
1450typedef struct {
1451 unsigned char kind;
1452
1453 unsigned char size;
1454 Elf32_Section section;
1455
1456 Elf32_Word info;
1457} Elf_Options;
1458
1459
1460
1461#define ODK_NULL 0
1462#define ODK_REGINFO 1
1463#define ODK_EXCEPTIONS 2
1464#define ODK_PAD 3
1465#define ODK_HWPATCH 4
1466#define ODK_FILL 5
1467#define ODK_TAGS 6
1468#define ODK_HWAND 7
1469#define ODK_HWOR 8
1470
1471
1472
1473#define OEX_FPU_MIN 0x1f
1474#define OEX_FPU_MAX 0x1f00
1475#define OEX_PAGE0 0x10000
1476#define OEX_SMM 0x20000
1477#define OEX_FPDBUG 0x40000
1478#define OEX_PRECISEFP OEX_FPDBUG
1479#define OEX_DISMISS 0x80000
1480
1481#define OEX_FPU_INVAL 0x10
1482#define OEX_FPU_DIV0 0x08
1483#define OEX_FPU_OFLO 0x04
1484#define OEX_FPU_UFLO 0x02
1485#define OEX_FPU_INEX 0x01
1486
1487
1488
1489#define OHW_R4KEOP 0x1
1490#define OHW_R8KPFETCH 0x2
1491#define OHW_R5KEOP 0x4
1492#define OHW_R5KCVTL 0x8
1493
1494#define OPAD_PREFIX 0x1
1495#define OPAD_POSTFIX 0x2
1496#define OPAD_SYMBOL 0x4
1497
1498
1499
1500typedef struct {
1501 Elf32_Word hwp_flags1;
1502 Elf32_Word hwp_flags2;
1503} Elf_Options_Hw;
1504
1505
1506
1507#define OHWA0_R4KEOP_CHECKED 0x00000001
1508#define OHWA1_R4KEOP_CLEAN 0x00000002
1509
1510
1511
1512#define R_MIPS_NONE 0
1513#define R_MIPS_16 1
1514#define R_MIPS_32 2
1515#define R_MIPS_REL32 3
1516#define R_MIPS_26 4
1517#define R_MIPS_HI16 5
1518#define R_MIPS_LO16 6
1519#define R_MIPS_GPREL16 7
1520#define R_MIPS_LITERAL 8
1521#define R_MIPS_GOT16 9
1522#define R_MIPS_PC16 10
1523#define R_MIPS_CALL16 11
1524#define R_MIPS_GPREL32 12
1525
1526#define R_MIPS_SHIFT5 16
1527#define R_MIPS_SHIFT6 17
1528#define R_MIPS_64 18
1529#define R_MIPS_GOT_DISP 19
1530#define R_MIPS_GOT_PAGE 20
1531#define R_MIPS_GOT_OFST 21
1532#define R_MIPS_GOT_HI16 22
1533#define R_MIPS_GOT_LO16 23
1534#define R_MIPS_SUB 24
1535#define R_MIPS_INSERT_A 25
1536#define R_MIPS_INSERT_B 26
1537#define R_MIPS_DELETE 27
1538#define R_MIPS_HIGHER 28
1539#define R_MIPS_HIGHEST 29
1540#define R_MIPS_CALL_HI16 30
1541#define R_MIPS_CALL_LO16 31
1542#define R_MIPS_SCN_DISP 32
1543#define R_MIPS_REL16 33
1544#define R_MIPS_ADD_IMMEDIATE 34
1545#define R_MIPS_PJUMP 35
1546#define R_MIPS_RELGOT 36
1547#define R_MIPS_JALR 37
1548#define R_MIPS_TLS_DTPMOD32 38
1549#define R_MIPS_TLS_DTPREL32 39
1550#define R_MIPS_TLS_DTPMOD64 40
1551#define R_MIPS_TLS_DTPREL64 41
1552#define R_MIPS_TLS_GD 42
1553#define R_MIPS_TLS_LDM 43
1554#define R_MIPS_TLS_DTPREL_HI16 44
1555#define R_MIPS_TLS_DTPREL_LO16 45
1556#define R_MIPS_TLS_GOTTPREL 46
1557#define R_MIPS_TLS_TPREL32 47
1558#define R_MIPS_TLS_TPREL64 48
1559#define R_MIPS_TLS_TPREL_HI16 49
1560#define R_MIPS_TLS_TPREL_LO16 50
1561#define R_MIPS_GLOB_DAT 51
1562#define R_MIPS_COPY 126
1563#define R_MIPS_JUMP_SLOT 127
1564
1565#define R_MIPS_NUM 128
1566
1567
1568
1569#define PT_MIPS_REGINFO 0x70000000
1570#define PT_MIPS_RTPROC 0x70000001
1571#define PT_MIPS_OPTIONS 0x70000002
1572#define PT_MIPS_ABIFLAGS 0x70000003
1573
1574
1575
1576#define PF_MIPS_LOCAL 0x10000000
1577
1578
1579
1580#define DT_MIPS_RLD_VERSION 0x70000001
1581#define DT_MIPS_TIME_STAMP 0x70000002
1582#define DT_MIPS_ICHECKSUM 0x70000003
1583#define DT_MIPS_IVERSION 0x70000004
1584#define DT_MIPS_FLAGS 0x70000005
1585#define DT_MIPS_BASE_ADDRESS 0x70000006
1586#define DT_MIPS_MSYM 0x70000007
1587#define DT_MIPS_CONFLICT 0x70000008
1588#define DT_MIPS_LIBLIST 0x70000009
1589#define DT_MIPS_LOCAL_GOTNO 0x7000000a
1590#define DT_MIPS_CONFLICTNO 0x7000000b
1591#define DT_MIPS_LIBLISTNO 0x70000010
1592#define DT_MIPS_SYMTABNO 0x70000011
1593#define DT_MIPS_UNREFEXTNO 0x70000012
1594#define DT_MIPS_GOTSYM 0x70000013
1595#define DT_MIPS_HIPAGENO 0x70000014
1596#define DT_MIPS_RLD_MAP 0x70000016
1597#define DT_MIPS_DELTA_CLASS 0x70000017
1598#define DT_MIPS_DELTA_CLASS_NO 0x70000018
1599
1600#define DT_MIPS_DELTA_INSTANCE 0x70000019
1601#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
1602
1603#define DT_MIPS_DELTA_RELOC 0x7000001b
1604#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
1605
1606#define DT_MIPS_DELTA_SYM 0x7000001d
1607
1608#define DT_MIPS_DELTA_SYM_NO 0x7000001e
1609
1610#define DT_MIPS_DELTA_CLASSSYM 0x70000020
1611
1612#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
1613
1614#define DT_MIPS_CXX_FLAGS 0x70000022
1615#define DT_MIPS_PIXIE_INIT 0x70000023
1616#define DT_MIPS_SYMBOL_LIB 0x70000024
1617#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
1618#define DT_MIPS_LOCAL_GOTIDX 0x70000026
1619#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
1620#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
1621#define DT_MIPS_OPTIONS 0x70000029
1622#define DT_MIPS_INTERFACE 0x7000002a
1623#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
1624#define DT_MIPS_INTERFACE_SIZE 0x7000002c
1625#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
1626
1627#define DT_MIPS_PERF_SUFFIX 0x7000002e
1628
1629#define DT_MIPS_COMPACT_SIZE 0x7000002f
1630#define DT_MIPS_GP_VALUE 0x70000030
1631#define DT_MIPS_AUX_DYNAMIC 0x70000031
1632
1633#define DT_MIPS_PLTGOT 0x70000032
1634
1635#define DT_MIPS_RWPLT 0x70000034
1636#define DT_MIPS_RLD_MAP_REL 0x70000035
1637#define DT_MIPS_NUM 0x36
1638
1639
1640
1641#define RHF_NONE 0
1642#define RHF_QUICKSTART (1 << 0)
1643#define RHF_NOTPOT (1 << 1)
1644#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
1645#define RHF_NO_MOVE (1 << 3)
1646#define RHF_SGI_ONLY (1 << 4)
1647#define RHF_GUARANTEE_INIT (1 << 5)
1648#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
1649#define RHF_GUARANTEE_START_INIT (1 << 7)
1650#define RHF_PIXIE (1 << 8)
1651#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
1652#define RHF_REQUICKSTART (1 << 10)
1653#define RHF_REQUICKSTARTED (1 << 11)
1654#define RHF_CORD (1 << 12)
1655#define RHF_NO_UNRES_UNDEF (1 << 13)
1656#define RHF_RLD_ORDER_SAFE (1 << 14)
1657
1658
1659
1660typedef struct {
1661 Elf32_Word l_name;
1662 Elf32_Word l_time_stamp;
1663 Elf32_Word l_checksum;
1664 Elf32_Word l_version;
1665 Elf32_Word l_flags;
1666} Elf32_Lib;
1667
1668typedef struct {
1669 Elf64_Word l_name;
1670 Elf64_Word l_time_stamp;
1671 Elf64_Word l_checksum;
1672 Elf64_Word l_version;
1673 Elf64_Word l_flags;
1674} Elf64_Lib;
1675
1676
1677
1678
1679#define LL_NONE 0
1680#define LL_EXACT_MATCH (1 << 0)
1681#define LL_IGNORE_INT_VER (1 << 1)
1682#define LL_REQUIRE_MINOR (1 << 2)
1683#define LL_EXPORTS (1 << 3)
1684#define LL_DELAY_LOAD (1 << 4)
1685#define LL_DELTA (1 << 5)
1686
1687
1688
1689typedef Elf32_Addr Elf32_Conflict;
1690
1691typedef struct {
1692 Elf32_Half version;
1693 unsigned char isa_level;
1694 unsigned char isa_rev;
1695 unsigned char gpr_size;
1696 unsigned char cpr1_size;
1697 unsigned char cpr2_size;
1698 unsigned char fp_abi;
1699 Elf32_Word isa_ext;
1700 Elf32_Word ases;
1701 Elf32_Word flags1;
1702 Elf32_Word flags2;
1703} Elf_MIPS_ABIFlags_v0;
1704
1705#define MIPS_AFL_REG_NONE 0x00
1706#define MIPS_AFL_REG_32 0x01
1707#define MIPS_AFL_REG_64 0x02
1708#define MIPS_AFL_REG_128 0x03
1709
1710#define MIPS_AFL_ASE_DSP 0x00000001
1711#define MIPS_AFL_ASE_DSPR2 0x00000002
1712#define MIPS_AFL_ASE_EVA 0x00000004
1713#define MIPS_AFL_ASE_MCU 0x00000008
1714#define MIPS_AFL_ASE_MDMX 0x00000010
1715#define MIPS_AFL_ASE_MIPS3D 0x00000020
1716#define MIPS_AFL_ASE_MT 0x00000040
1717#define MIPS_AFL_ASE_SMARTMIPS 0x00000080
1718#define MIPS_AFL_ASE_VIRT 0x00000100
1719#define MIPS_AFL_ASE_MSA 0x00000200
1720#define MIPS_AFL_ASE_MIPS16 0x00000400
1721#define MIPS_AFL_ASE_MICROMIPS 0x00000800
1722#define MIPS_AFL_ASE_XPA 0x00001000
1723#define MIPS_AFL_ASE_MASK 0x00001fff
1724
1725#define MIPS_AFL_EXT_XLR 1
1726#define MIPS_AFL_EXT_OCTEON2 2
1727#define MIPS_AFL_EXT_OCTEONP 3
1728#define MIPS_AFL_EXT_LOONGSON_3A 4
1729#define MIPS_AFL_EXT_OCTEON 5
1730#define MIPS_AFL_EXT_5900 6
1731#define MIPS_AFL_EXT_4650 7
1732#define MIPS_AFL_EXT_4010 8
1733#define MIPS_AFL_EXT_4100 9
1734#define MIPS_AFL_EXT_3900 10
1735#define MIPS_AFL_EXT_10000 11
1736#define MIPS_AFL_EXT_SB1 12
1737#define MIPS_AFL_EXT_4111 13
1738#define MIPS_AFL_EXT_4120 14
1739#define MIPS_AFL_EXT_5400 15
1740#define MIPS_AFL_EXT_5500 16
1741#define MIPS_AFL_EXT_LOONGSON_2E 17
1742#define MIPS_AFL_EXT_LOONGSON_2F 18
1743
1744#define MIPS_AFL_FLAGS1_ODDSPREG 1
1745
1746enum
1747{
1748 Val_GNU_MIPS_ABI_FP_ANY = 0,
1749 Val_GNU_MIPS_ABI_FP_DOUBLE = 1,
1750 Val_GNU_MIPS_ABI_FP_SINGLE = 2,
1751 Val_GNU_MIPS_ABI_FP_SOFT = 3,
1752 Val_GNU_MIPS_ABI_FP_OLD_64 = 4,
1753 Val_GNU_MIPS_ABI_FP_XX = 5,
1754 Val_GNU_MIPS_ABI_FP_64 = 6,
1755 Val_GNU_MIPS_ABI_FP_64A = 7,
1756 Val_GNU_MIPS_ABI_FP_MAX = 7
1757};
1758
1759
1760
1761
1762#define EF_PARISC_TRAPNIL 0x00010000
1763#define EF_PARISC_EXT 0x00020000
1764#define EF_PARISC_LSB 0x00040000
1765#define EF_PARISC_WIDE 0x00080000
1766#define EF_PARISC_NO_KABP 0x00100000
1767
1768#define EF_PARISC_LAZYSWAP 0x00400000
1769#define EF_PARISC_ARCH 0x0000ffff
1770
1771
1772
1773#define EFA_PARISC_1_0 0x020b
1774#define EFA_PARISC_1_1 0x0210
1775#define EFA_PARISC_2_0 0x0214
1776
1777
1778
1779#define SHN_PARISC_ANSI_COMMON 0xff00
1780
1781#define SHN_PARISC_HUGE_COMMON 0xff01
1782
1783
1784
1785#define SHT_PARISC_EXT 0x70000000
1786#define SHT_PARISC_UNWIND 0x70000001
1787#define SHT_PARISC_DOC 0x70000002
1788
1789
1790
1791#define SHF_PARISC_SHORT 0x20000000
1792#define SHF_PARISC_HUGE 0x40000000
1793#define SHF_PARISC_SBP 0x80000000
1794
1795
1796
1797#define STT_PARISC_MILLICODE 13
1798
1799#define STT_HP_OPAQUE (STT_LOOS + 0x1)
1800#define STT_HP_STUB (STT_LOOS + 0x2)
1801
1802
1803
1804#define R_PARISC_NONE 0
1805#define R_PARISC_DIR32 1
1806#define R_PARISC_DIR21L 2
1807#define R_PARISC_DIR17R 3
1808#define R_PARISC_DIR17F 4
1809#define R_PARISC_DIR14R 6
1810#define R_PARISC_PCREL32 9
1811#define R_PARISC_PCREL21L 10
1812#define R_PARISC_PCREL17R 11
1813#define R_PARISC_PCREL17F 12
1814#define R_PARISC_PCREL14R 14
1815#define R_PARISC_DPREL21L 18
1816#define R_PARISC_DPREL14R 22
1817#define R_PARISC_GPREL21L 26
1818#define R_PARISC_GPREL14R 30
1819#define R_PARISC_LTOFF21L 34
1820#define R_PARISC_LTOFF14R 38
1821#define R_PARISC_SECREL32 41
1822#define R_PARISC_SEGBASE 48
1823#define R_PARISC_SEGREL32 49
1824#define R_PARISC_PLTOFF21L 50
1825#define R_PARISC_PLTOFF14R 54
1826#define R_PARISC_LTOFF_FPTR32 57
1827#define R_PARISC_LTOFF_FPTR21L 58
1828#define R_PARISC_LTOFF_FPTR14R 62
1829#define R_PARISC_FPTR64 64
1830#define R_PARISC_PLABEL32 65
1831#define R_PARISC_PLABEL21L 66
1832#define R_PARISC_PLABEL14R 70
1833#define R_PARISC_PCREL64 72
1834#define R_PARISC_PCREL22F 74
1835#define R_PARISC_PCREL14WR 75
1836#define R_PARISC_PCREL14DR 76
1837#define R_PARISC_PCREL16F 77
1838#define R_PARISC_PCREL16WF 78
1839#define R_PARISC_PCREL16DF 79
1840#define R_PARISC_DIR64 80
1841#define R_PARISC_DIR14WR 83
1842#define R_PARISC_DIR14DR 84
1843#define R_PARISC_DIR16F 85
1844#define R_PARISC_DIR16WF 86
1845#define R_PARISC_DIR16DF 87
1846#define R_PARISC_GPREL64 88
1847#define R_PARISC_GPREL14WR 91
1848#define R_PARISC_GPREL14DR 92
1849#define R_PARISC_GPREL16F 93
1850#define R_PARISC_GPREL16WF 94
1851#define R_PARISC_GPREL16DF 95
1852#define R_PARISC_LTOFF64 96
1853#define R_PARISC_LTOFF14WR 99
1854#define R_PARISC_LTOFF14DR 100
1855#define R_PARISC_LTOFF16F 101
1856#define R_PARISC_LTOFF16WF 102
1857#define R_PARISC_LTOFF16DF 103
1858#define R_PARISC_SECREL64 104
1859#define R_PARISC_SEGREL64 112
1860#define R_PARISC_PLTOFF14WR 115
1861#define R_PARISC_PLTOFF14DR 116
1862#define R_PARISC_PLTOFF16F 117
1863#define R_PARISC_PLTOFF16WF 118
1864#define R_PARISC_PLTOFF16DF 119
1865#define R_PARISC_LTOFF_FPTR64 120
1866#define R_PARISC_LTOFF_FPTR14WR 123
1867#define R_PARISC_LTOFF_FPTR14DR 124
1868#define R_PARISC_LTOFF_FPTR16F 125
1869#define R_PARISC_LTOFF_FPTR16WF 126
1870#define R_PARISC_LTOFF_FPTR16DF 127
1871#define R_PARISC_LORESERVE 128
1872#define R_PARISC_COPY 128
1873#define R_PARISC_IPLT 129
1874#define R_PARISC_EPLT 130
1875#define R_PARISC_TPREL32 153
1876#define R_PARISC_TPREL21L 154
1877#define R_PARISC_TPREL14R 158
1878#define R_PARISC_LTOFF_TP21L 162
1879#define R_PARISC_LTOFF_TP14R 166
1880#define R_PARISC_LTOFF_TP14F 167
1881#define R_PARISC_TPREL64 216
1882#define R_PARISC_TPREL14WR 219
1883#define R_PARISC_TPREL14DR 220
1884#define R_PARISC_TPREL16F 221
1885#define R_PARISC_TPREL16WF 222
1886#define R_PARISC_TPREL16DF 223
1887#define R_PARISC_LTOFF_TP64 224
1888#define R_PARISC_LTOFF_TP14WR 227
1889#define R_PARISC_LTOFF_TP14DR 228
1890#define R_PARISC_LTOFF_TP16F 229
1891#define R_PARISC_LTOFF_TP16WF 230
1892#define R_PARISC_LTOFF_TP16DF 231
1893#define R_PARISC_GNU_VTENTRY 232
1894#define R_PARISC_GNU_VTINHERIT 233
1895#define R_PARISC_TLS_GD21L 234
1896#define R_PARISC_TLS_GD14R 235
1897#define R_PARISC_TLS_GDCALL 236
1898#define R_PARISC_TLS_LDM21L 237
1899#define R_PARISC_TLS_LDM14R 238
1900#define R_PARISC_TLS_LDMCALL 239
1901#define R_PARISC_TLS_LDO21L 240
1902#define R_PARISC_TLS_LDO14R 241
1903#define R_PARISC_TLS_DTPMOD32 242
1904#define R_PARISC_TLS_DTPMOD64 243
1905#define R_PARISC_TLS_DTPOFF32 244
1906#define R_PARISC_TLS_DTPOFF64 245
1907#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
1908#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
1909#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
1910#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
1911#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
1912#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
1913#define R_PARISC_HIRESERVE 255
1914
1915
1916
1917#define PT_HP_TLS (PT_LOOS + 0x0)
1918#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
1919#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
1920#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
1921#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
1922#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
1923#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
1924#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
1925#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
1926#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
1927#define PT_HP_PARALLEL (PT_LOOS + 0x10)
1928#define PT_HP_FASTBIND (PT_LOOS + 0x11)
1929#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
1930#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
1931#define PT_HP_STACK (PT_LOOS + 0x14)
1932
1933#define PT_PARISC_ARCHEXT 0x70000000
1934#define PT_PARISC_UNWIND 0x70000001
1935
1936
1937
1938#define PF_PARISC_SBP 0x08000000
1939
1940#define PF_HP_PAGE_SIZE 0x00100000
1941#define PF_HP_FAR_SHARED 0x00200000
1942#define PF_HP_NEAR_SHARED 0x00400000
1943#define PF_HP_CODE 0x01000000
1944#define PF_HP_MODIFY 0x02000000
1945#define PF_HP_LAZYSWAP 0x04000000
1946#define PF_HP_SBP 0x08000000
1947
1948
1949
1950
1951
1952
1953#define EF_ALPHA_32BIT 1
1954#define EF_ALPHA_CANRELAX 2
1955
1956
1957
1958
1959#define SHT_ALPHA_DEBUG 0x70000001
1960#define SHT_ALPHA_REGINFO 0x70000002
1961
1962
1963
1964#define SHF_ALPHA_GPREL 0x10000000
1965
1966
1967#define STO_ALPHA_NOPV 0x80
1968#define STO_ALPHA_STD_GPLOAD 0x88
1969
1970
1971
1972#define R_ALPHA_NONE 0
1973#define R_ALPHA_REFLONG 1
1974#define R_ALPHA_REFQUAD 2
1975#define R_ALPHA_GPREL32 3
1976#define R_ALPHA_LITERAL 4
1977#define R_ALPHA_LITUSE 5
1978#define R_ALPHA_GPDISP 6
1979#define R_ALPHA_BRADDR 7
1980#define R_ALPHA_HINT 8
1981#define R_ALPHA_SREL16 9
1982#define R_ALPHA_SREL32 10
1983#define R_ALPHA_SREL64 11
1984#define R_ALPHA_GPRELHIGH 17
1985#define R_ALPHA_GPRELLOW 18
1986#define R_ALPHA_GPREL16 19
1987#define R_ALPHA_COPY 24
1988#define R_ALPHA_GLOB_DAT 25
1989#define R_ALPHA_JMP_SLOT 26
1990#define R_ALPHA_RELATIVE 27
1991#define R_ALPHA_TLS_GD_HI 28
1992#define R_ALPHA_TLSGD 29
1993#define R_ALPHA_TLS_LDM 30
1994#define R_ALPHA_DTPMOD64 31
1995#define R_ALPHA_GOTDTPREL 32
1996#define R_ALPHA_DTPREL64 33
1997#define R_ALPHA_DTPRELHI 34
1998#define R_ALPHA_DTPRELLO 35
1999#define R_ALPHA_DTPREL16 36
2000#define R_ALPHA_GOTTPREL 37
2001#define R_ALPHA_TPREL64 38
2002#define R_ALPHA_TPRELHI 39
2003#define R_ALPHA_TPRELLO 40
2004#define R_ALPHA_TPREL16 41
2005
2006#define R_ALPHA_NUM 46
2007
2008
2009#define LITUSE_ALPHA_ADDR 0
2010#define LITUSE_ALPHA_BASE 1
2011#define LITUSE_ALPHA_BYTOFF 2
2012#define LITUSE_ALPHA_JSR 3
2013#define LITUSE_ALPHA_TLS_GD 4
2014#define LITUSE_ALPHA_TLS_LDM 5
2015
2016
2017#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
2018#define DT_ALPHA_NUM 1
2019
2020
2021
2022
2023#define EF_PPC_EMB 0x80000000
2024
2025
2026#define EF_PPC_RELOCATABLE 0x00010000
2027#define EF_PPC_RELOCATABLE_LIB 0x00008000
2028
2029
2030
2031#define R_PPC_NONE 0
2032#define R_PPC_ADDR32 1
2033#define R_PPC_ADDR24 2
2034#define R_PPC_ADDR16 3
2035#define R_PPC_ADDR16_LO 4
2036#define R_PPC_ADDR16_HI 5
2037#define R_PPC_ADDR16_HA 6
2038#define R_PPC_ADDR14 7
2039#define R_PPC_ADDR14_BRTAKEN 8
2040#define R_PPC_ADDR14_BRNTAKEN 9
2041#define R_PPC_REL24 10
2042#define R_PPC_REL14 11
2043#define R_PPC_REL14_BRTAKEN 12
2044#define R_PPC_REL14_BRNTAKEN 13
2045#define R_PPC_GOT16 14
2046#define R_PPC_GOT16_LO 15
2047#define R_PPC_GOT16_HI 16
2048#define R_PPC_GOT16_HA 17
2049#define R_PPC_PLTREL24 18
2050#define R_PPC_COPY 19
2051#define R_PPC_GLOB_DAT 20
2052#define R_PPC_JMP_SLOT 21
2053#define R_PPC_RELATIVE 22
2054#define R_PPC_LOCAL24PC 23
2055#define R_PPC_UADDR32 24
2056#define R_PPC_UADDR16 25
2057#define R_PPC_REL32 26
2058#define R_PPC_PLT32 27
2059#define R_PPC_PLTREL32 28
2060#define R_PPC_PLT16_LO 29
2061#define R_PPC_PLT16_HI 30
2062#define R_PPC_PLT16_HA 31
2063#define R_PPC_SDAREL16 32
2064#define R_PPC_SECTOFF 33
2065#define R_PPC_SECTOFF_LO 34
2066#define R_PPC_SECTOFF_HI 35
2067#define R_PPC_SECTOFF_HA 36
2068
2069
2070#define R_PPC_TLS 67
2071#define R_PPC_DTPMOD32 68
2072#define R_PPC_TPREL16 69
2073#define R_PPC_TPREL16_LO 70
2074#define R_PPC_TPREL16_HI 71
2075#define R_PPC_TPREL16_HA 72
2076#define R_PPC_TPREL32 73
2077#define R_PPC_DTPREL16 74
2078#define R_PPC_DTPREL16_LO 75
2079#define R_PPC_DTPREL16_HI 76
2080#define R_PPC_DTPREL16_HA 77
2081#define R_PPC_DTPREL32 78
2082#define R_PPC_GOT_TLSGD16 79
2083#define R_PPC_GOT_TLSGD16_LO 80
2084#define R_PPC_GOT_TLSGD16_HI 81
2085#define R_PPC_GOT_TLSGD16_HA 82
2086#define R_PPC_GOT_TLSLD16 83
2087#define R_PPC_GOT_TLSLD16_LO 84
2088#define R_PPC_GOT_TLSLD16_HI 85
2089#define R_PPC_GOT_TLSLD16_HA 86
2090#define R_PPC_GOT_TPREL16 87
2091#define R_PPC_GOT_TPREL16_LO 88
2092#define R_PPC_GOT_TPREL16_HI 89
2093#define R_PPC_GOT_TPREL16_HA 90
2094#define R_PPC_GOT_DTPREL16 91
2095#define R_PPC_GOT_DTPREL16_LO 92
2096#define R_PPC_GOT_DTPREL16_HI 93
2097#define R_PPC_GOT_DTPREL16_HA 94
2098#define R_PPC_TLSGD 95
2099#define R_PPC_TLSLD 96
2100
2101
2102#define R_PPC_EMB_NADDR32 101
2103#define R_PPC_EMB_NADDR16 102
2104#define R_PPC_EMB_NADDR16_LO 103
2105#define R_PPC_EMB_NADDR16_HI 104
2106#define R_PPC_EMB_NADDR16_HA 105
2107#define R_PPC_EMB_SDAI16 106
2108#define R_PPC_EMB_SDA2I16 107
2109#define R_PPC_EMB_SDA2REL 108
2110#define R_PPC_EMB_SDA21 109
2111#define R_PPC_EMB_MRKREF 110
2112#define R_PPC_EMB_RELSEC16 111
2113#define R_PPC_EMB_RELST_LO 112
2114#define R_PPC_EMB_RELST_HI 113
2115#define R_PPC_EMB_RELST_HA 114
2116#define R_PPC_EMB_BIT_FLD 115
2117#define R_PPC_EMB_RELSDA 116
2118
2119
2120#define R_PPC_DIAB_SDA21_LO 180
2121#define R_PPC_DIAB_SDA21_HI 181
2122#define R_PPC_DIAB_SDA21_HA 182
2123#define R_PPC_DIAB_RELSDA_LO 183
2124#define R_PPC_DIAB_RELSDA_HI 184
2125#define R_PPC_DIAB_RELSDA_HA 185
2126
2127
2128#define R_PPC_IRELATIVE 248
2129
2130
2131#define R_PPC_REL16 249
2132#define R_PPC_REL16_LO 250
2133#define R_PPC_REL16_HI 251
2134#define R_PPC_REL16_HA 252
2135
2136
2137
2138#define R_PPC_TOC16 255
2139
2140
2141#define DT_PPC_GOT (DT_LOPROC + 0)
2142#define DT_PPC_OPT (DT_LOPROC + 1)
2143#define DT_PPC_NUM 2
2144
2145#define PPC_OPT_TLS 1
2146
2147
2148#define R_PPC64_NONE R_PPC_NONE
2149#define R_PPC64_ADDR32 R_PPC_ADDR32
2150#define R_PPC64_ADDR24 R_PPC_ADDR24
2151#define R_PPC64_ADDR16 R_PPC_ADDR16
2152#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
2153#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
2154#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
2155#define R_PPC64_ADDR14 R_PPC_ADDR14
2156#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
2157#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
2158#define R_PPC64_REL24 R_PPC_REL24
2159#define R_PPC64_REL14 R_PPC_REL14
2160#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
2161#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
2162#define R_PPC64_GOT16 R_PPC_GOT16
2163#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
2164#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
2165#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
2166
2167#define R_PPC64_COPY R_PPC_COPY
2168#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
2169#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
2170#define R_PPC64_RELATIVE R_PPC_RELATIVE
2171
2172#define R_PPC64_UADDR32 R_PPC_UADDR32
2173#define R_PPC64_UADDR16 R_PPC_UADDR16
2174#define R_PPC64_REL32 R_PPC_REL32
2175#define R_PPC64_PLT32 R_PPC_PLT32
2176#define R_PPC64_PLTREL32 R_PPC_PLTREL32
2177#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
2178#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
2179#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
2180
2181#define R_PPC64_SECTOFF R_PPC_SECTOFF
2182#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
2183#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
2184#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
2185#define R_PPC64_ADDR30 37
2186#define R_PPC64_ADDR64 38
2187#define R_PPC64_ADDR16_HIGHER 39
2188#define R_PPC64_ADDR16_HIGHERA 40
2189#define R_PPC64_ADDR16_HIGHEST 41
2190#define R_PPC64_ADDR16_HIGHESTA 42
2191#define R_PPC64_UADDR64 43
2192#define R_PPC64_REL64 44
2193#define R_PPC64_PLT64 45
2194#define R_PPC64_PLTREL64 46
2195#define R_PPC64_TOC16 47
2196#define R_PPC64_TOC16_LO 48
2197#define R_PPC64_TOC16_HI 49
2198#define R_PPC64_TOC16_HA 50
2199#define R_PPC64_TOC 51
2200#define R_PPC64_PLTGOT16 52
2201#define R_PPC64_PLTGOT16_LO 53
2202#define R_PPC64_PLTGOT16_HI 54
2203#define R_PPC64_PLTGOT16_HA 55
2204
2205#define R_PPC64_ADDR16_DS 56
2206#define R_PPC64_ADDR16_LO_DS 57
2207#define R_PPC64_GOT16_DS 58
2208#define R_PPC64_GOT16_LO_DS 59
2209#define R_PPC64_PLT16_LO_DS 60
2210#define R_PPC64_SECTOFF_DS 61
2211#define R_PPC64_SECTOFF_LO_DS 62
2212#define R_PPC64_TOC16_DS 63
2213#define R_PPC64_TOC16_LO_DS 64
2214#define R_PPC64_PLTGOT16_DS 65
2215#define R_PPC64_PLTGOT16_LO_DS 66
2216
2217
2218#define R_PPC64_TLS 67
2219#define R_PPC64_DTPMOD64 68
2220#define R_PPC64_TPREL16 69
2221#define R_PPC64_TPREL16_LO 70
2222#define R_PPC64_TPREL16_HI 71
2223#define R_PPC64_TPREL16_HA 72
2224#define R_PPC64_TPREL64 73
2225#define R_PPC64_DTPREL16 74
2226#define R_PPC64_DTPREL16_LO 75
2227#define R_PPC64_DTPREL16_HI 76
2228#define R_PPC64_DTPREL16_HA 77
2229#define R_PPC64_DTPREL64 78
2230#define R_PPC64_GOT_TLSGD16 79
2231#define R_PPC64_GOT_TLSGD16_LO 80
2232#define R_PPC64_GOT_TLSGD16_HI 81
2233#define R_PPC64_GOT_TLSGD16_HA 82
2234#define R_PPC64_GOT_TLSLD16 83
2235#define R_PPC64_GOT_TLSLD16_LO 84
2236#define R_PPC64_GOT_TLSLD16_HI 85
2237#define R_PPC64_GOT_TLSLD16_HA 86
2238#define R_PPC64_GOT_TPREL16_DS 87
2239#define R_PPC64_GOT_TPREL16_LO_DS 88
2240#define R_PPC64_GOT_TPREL16_HI 89
2241#define R_PPC64_GOT_TPREL16_HA 90
2242#define R_PPC64_GOT_DTPREL16_DS 91
2243#define R_PPC64_GOT_DTPREL16_LO_DS 92
2244#define R_PPC64_GOT_DTPREL16_HI 93
2245#define R_PPC64_GOT_DTPREL16_HA 94
2246#define R_PPC64_TPREL16_DS 95
2247#define R_PPC64_TPREL16_LO_DS 96
2248#define R_PPC64_TPREL16_HIGHER 97
2249#define R_PPC64_TPREL16_HIGHERA 98
2250#define R_PPC64_TPREL16_HIGHEST 99
2251#define R_PPC64_TPREL16_HIGHESTA 100
2252#define R_PPC64_DTPREL16_DS 101
2253#define R_PPC64_DTPREL16_LO_DS 102
2254#define R_PPC64_DTPREL16_HIGHER 103
2255#define R_PPC64_DTPREL16_HIGHERA 104
2256#define R_PPC64_DTPREL16_HIGHEST 105
2257#define R_PPC64_DTPREL16_HIGHESTA 106
2258#define R_PPC64_TLSGD 107
2259#define R_PPC64_TLSLD 108
2260#define R_PPC64_TOCSAVE 109
2261#define R_PPC64_ADDR16_HIGH 110
2262#define R_PPC64_ADDR16_HIGHA 111
2263#define R_PPC64_TPREL16_HIGH 112
2264#define R_PPC64_TPREL16_HIGHA 113
2265#define R_PPC64_DTPREL16_HIGH 114
2266#define R_PPC64_DTPREL16_HIGHA 115
2267
2268
2269#define R_PPC64_JMP_IREL 247
2270#define R_PPC64_IRELATIVE 248
2271#define R_PPC64_REL16 249
2272#define R_PPC64_REL16_LO 250
2273#define R_PPC64_REL16_HI 251
2274#define R_PPC64_REL16_HA 252
2275
2276#define EF_PPC64_ABI 3
2277
2278#define DT_PPC64_GLINK (DT_LOPROC + 0)
2279#define DT_PPC64_OPD (DT_LOPROC + 1)
2280#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
2281#define DT_PPC64_OPT (DT_LOPROC + 3)
2282#define DT_PPC64_NUM 4
2283
2284#define PPC64_OPT_TLS 1
2285#define PPC64_OPT_MULTI_TOC 2
2286#define PPC64_OPT_LOCALENTRY 4
2287
2288#define STO_PPC64_LOCAL_BIT 5
2289#define STO_PPC64_LOCAL_MASK 0xe0
2290#define PPC64_LOCAL_ENTRY_OFFSET(x) (1 << (((x)&0xe0)>>5) & 0xfc)
2291
2292
2293#define EF_ARM_RELEXEC 0x01
2294#define EF_ARM_HASENTRY 0x02
2295#define EF_ARM_INTERWORK 0x04
2296#define EF_ARM_APCS_26 0x08
2297#define EF_ARM_APCS_FLOAT 0x10
2298#define EF_ARM_PIC 0x20
2299#define EF_ARM_ALIGN8 0x40
2300#define EF_ARM_NEW_ABI 0x80
2301#define EF_ARM_OLD_ABI 0x100
2302#define EF_ARM_SOFT_FLOAT 0x200
2303#define EF_ARM_VFP_FLOAT 0x400
2304#define EF_ARM_MAVERICK_FLOAT 0x800
2305
2306#define EF_ARM_ABI_FLOAT_SOFT 0x200
2307#define EF_ARM_ABI_FLOAT_HARD 0x400
2308
2309
2310#define EF_ARM_SYMSARESORTED 0x04
2311#define EF_ARM_DYNSYMSUSESEGIDX 0x08
2312#define EF_ARM_MAPSYMSFIRST 0x10
2313#define EF_ARM_EABIMASK 0XFF000000
2314
2315
2316#define EF_ARM_BE8 0x00800000
2317#define EF_ARM_LE8 0x00400000
2318
2319#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
2320#define EF_ARM_EABI_UNKNOWN 0x00000000
2321#define EF_ARM_EABI_VER1 0x01000000
2322#define EF_ARM_EABI_VER2 0x02000000
2323#define EF_ARM_EABI_VER3 0x03000000
2324#define EF_ARM_EABI_VER4 0x04000000
2325#define EF_ARM_EABI_VER5 0x05000000
2326
2327
2328#define STT_ARM_TFUNC STT_LOPROC
2329#define STT_ARM_16BIT STT_HIPROC
2330
2331
2332#define SHF_ARM_ENTRYSECT 0x10000000
2333#define SHF_ARM_COMDEF 0x80000000
2334
2335
2336
2337#define PF_ARM_SB 0x10000000
2338
2339#define PF_ARM_PI 0x20000000
2340#define PF_ARM_ABS 0x40000000
2341
2342
2343#define PT_ARM_EXIDX (PT_LOPROC + 1)
2344
2345
2346#define SHT_ARM_EXIDX (SHT_LOPROC + 1)
2347#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
2348#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
2349
2350#define R_AARCH64_NONE 0
2351#define R_AARCH64_P32_ABS32 1
2352#define R_AARCH64_P32_COPY 180
2353#define R_AARCH64_P32_GLOB_DAT 181
2354#define R_AARCH64_P32_JUMP_SLOT 182
2355#define R_AARCH64_P32_RELATIVE 183
2356#define R_AARCH64_P32_TLS_DTPMOD 184
2357#define R_AARCH64_P32_TLS_DTPREL 185
2358#define R_AARCH64_P32_TLS_TPREL 186
2359#define R_AARCH64_P32_TLSDESC 187
2360#define R_AARCH64_P32_IRELATIVE 188
2361#define R_AARCH64_ABS64 257
2362#define R_AARCH64_ABS32 258
2363#define R_AARCH64_ABS16 259
2364#define R_AARCH64_PREL64 260
2365#define R_AARCH64_PREL32 261
2366#define R_AARCH64_PREL16 262
2367#define R_AARCH64_MOVW_UABS_G0 263
2368#define R_AARCH64_MOVW_UABS_G0_NC 264
2369#define R_AARCH64_MOVW_UABS_G1 265
2370#define R_AARCH64_MOVW_UABS_G1_NC 266
2371#define R_AARCH64_MOVW_UABS_G2 267
2372#define R_AARCH64_MOVW_UABS_G2_NC 268
2373#define R_AARCH64_MOVW_UABS_G3 269
2374#define R_AARCH64_MOVW_SABS_G0 270
2375#define R_AARCH64_MOVW_SABS_G1 271
2376#define R_AARCH64_MOVW_SABS_G2 272
2377#define R_AARCH64_LD_PREL_LO19 273
2378#define R_AARCH64_ADR_PREL_LO21 274
2379#define R_AARCH64_ADR_PREL_PG_HI21 275
2380#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
2381#define R_AARCH64_ADD_ABS_LO12_NC 277
2382#define R_AARCH64_LDST8_ABS_LO12_NC 278
2383#define R_AARCH64_TSTBR14 279
2384#define R_AARCH64_CONDBR19 280
2385#define R_AARCH64_JUMP26 282
2386#define R_AARCH64_CALL26 283
2387#define R_AARCH64_LDST16_ABS_LO12_NC 284
2388#define R_AARCH64_LDST32_ABS_LO12_NC 285
2389#define R_AARCH64_LDST64_ABS_LO12_NC 286
2390#define R_AARCH64_MOVW_PREL_G0 287
2391#define R_AARCH64_MOVW_PREL_G0_NC 288
2392#define R_AARCH64_MOVW_PREL_G1 289
2393#define R_AARCH64_MOVW_PREL_G1_NC 290
2394#define R_AARCH64_MOVW_PREL_G2 291
2395#define R_AARCH64_MOVW_PREL_G2_NC 292
2396#define R_AARCH64_MOVW_PREL_G3 293
2397#define R_AARCH64_LDST128_ABS_LO12_NC 299
2398#define R_AARCH64_MOVW_GOTOFF_G0 300
2399#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
2400#define R_AARCH64_MOVW_GOTOFF_G1 302
2401#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
2402#define R_AARCH64_MOVW_GOTOFF_G2 304
2403#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
2404#define R_AARCH64_MOVW_GOTOFF_G3 306
2405#define R_AARCH64_GOTREL64 307
2406#define R_AARCH64_GOTREL32 308
2407#define R_AARCH64_GOT_LD_PREL19 309
2408#define R_AARCH64_LD64_GOTOFF_LO15 310
2409#define R_AARCH64_ADR_GOT_PAGE 311
2410#define R_AARCH64_LD64_GOT_LO12_NC 312
2411#define R_AARCH64_LD64_GOTPAGE_LO15 313
2412#define R_AARCH64_TLSGD_ADR_PREL21 512
2413#define R_AARCH64_TLSGD_ADR_PAGE21 513
2414#define R_AARCH64_TLSGD_ADD_LO12_NC 514
2415#define R_AARCH64_TLSGD_MOVW_G1 515
2416#define R_AARCH64_TLSGD_MOVW_G0_NC 516
2417#define R_AARCH64_TLSLD_ADR_PREL21 517
2418#define R_AARCH64_TLSLD_ADR_PAGE21 518
2419#define R_AARCH64_TLSLD_ADD_LO12_NC 519
2420#define R_AARCH64_TLSLD_MOVW_G1 520
2421#define R_AARCH64_TLSLD_MOVW_G0_NC 521
2422#define R_AARCH64_TLSLD_LD_PREL19 522
2423#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
2424#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
2425#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
2426#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
2427#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
2428#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
2429#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
2430#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
2431#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
2432#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
2433#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
2434#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
2435#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
2436#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
2437#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
2438#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
2439#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
2440#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
2441#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
2442#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
2443#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
2444#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
2445#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
2446#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
2447#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
2448#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
2449#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
2450#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
2451#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
2452#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
2453#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
2454#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
2455#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
2456#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
2457#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
2458#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
2459#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
2460#define R_AARCH64_TLSDESC_LD_PREL19 560
2461#define R_AARCH64_TLSDESC_ADR_PREL21 561
2462#define R_AARCH64_TLSDESC_ADR_PAGE21 562
2463#define R_AARCH64_TLSDESC_LD64_LO12 563
2464#define R_AARCH64_TLSDESC_ADD_LO12 564
2465#define R_AARCH64_TLSDESC_OFF_G1 565
2466#define R_AARCH64_TLSDESC_OFF_G0_NC 566
2467#define R_AARCH64_TLSDESC_LDR 567
2468#define R_AARCH64_TLSDESC_ADD 568
2469#define R_AARCH64_TLSDESC_CALL 569
2470#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
2471#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
2472#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
2473#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
2474#define R_AARCH64_COPY 1024
2475#define R_AARCH64_GLOB_DAT 1025
2476#define R_AARCH64_JUMP_SLOT 1026
2477#define R_AARCH64_RELATIVE 1027
2478#define R_AARCH64_TLS_DTPMOD 1028
2479#define R_AARCH64_TLS_DTPMOD64 1028
2480#define R_AARCH64_TLS_DTPREL 1029
2481#define R_AARCH64_TLS_DTPREL64 1029
2482#define R_AARCH64_TLS_TPREL 1030
2483#define R_AARCH64_TLS_TPREL64 1030
2484#define R_AARCH64_TLSDESC 1031
2485
2486
2487#define R_ARM_NONE 0
2488#define R_ARM_PC24 1
2489#define R_ARM_ABS32 2
2490#define R_ARM_REL32 3
2491#define R_ARM_PC13 4
2492#define R_ARM_ABS16 5
2493#define R_ARM_ABS12 6
2494#define R_ARM_THM_ABS5 7
2495#define R_ARM_ABS8 8
2496#define R_ARM_SBREL32 9
2497#define R_ARM_THM_PC22 10
2498#define R_ARM_THM_PC8 11
2499#define R_ARM_AMP_VCALL9 12
2500#define R_ARM_TLS_DESC 13
2501#define R_ARM_THM_SWI8 14
2502#define R_ARM_XPC25 15
2503#define R_ARM_THM_XPC22 16
2504#define R_ARM_TLS_DTPMOD32 17
2505#define R_ARM_TLS_DTPOFF32 18
2506#define R_ARM_TLS_TPOFF32 19
2507#define R_ARM_COPY 20
2508#define R_ARM_GLOB_DAT 21
2509#define R_ARM_JUMP_SLOT 22
2510#define R_ARM_RELATIVE 23
2511#define R_ARM_GOTOFF 24
2512#define R_ARM_GOTPC 25
2513#define R_ARM_GOT32 26
2514#define R_ARM_PLT32 27
2515#define R_ARM_CALL 28
2516#define R_ARM_JUMP24 29
2517#define R_ARM_THM_JUMP24 30
2518#define R_ARM_BASE_ABS 31
2519#define R_ARM_ALU_PCREL_7_0 32
2520#define R_ARM_ALU_PCREL_15_8 33
2521#define R_ARM_ALU_PCREL_23_15 34
2522#define R_ARM_LDR_SBREL_11_0 35
2523#define R_ARM_ALU_SBREL_19_12 36
2524#define R_ARM_ALU_SBREL_27_20 37
2525#define R_ARM_TARGET1 38
2526#define R_ARM_SBREL31 39
2527#define R_ARM_V4BX 40
2528#define R_ARM_TARGET2 41
2529#define R_ARM_PREL31 42
2530#define R_ARM_MOVW_ABS_NC 43
2531#define R_ARM_MOVT_ABS 44
2532#define R_ARM_MOVW_PREL_NC 45
2533#define R_ARM_MOVT_PREL 46
2534#define R_ARM_THM_MOVW_ABS_NC 47
2535#define R_ARM_THM_MOVT_ABS 48
2536#define R_ARM_THM_MOVW_PREL_NC 49
2537#define R_ARM_THM_MOVT_PREL 50
2538#define R_ARM_THM_JUMP19 51
2539#define R_ARM_THM_JUMP6 52
2540#define R_ARM_THM_ALU_PREL_11_0 53
2541#define R_ARM_THM_PC12 54
2542#define R_ARM_ABS32_NOI 55
2543#define R_ARM_REL32_NOI 56
2544#define R_ARM_ALU_PC_G0_NC 57
2545#define R_ARM_ALU_PC_G0 58
2546#define R_ARM_ALU_PC_G1_NC 59
2547#define R_ARM_ALU_PC_G1 60
2548#define R_ARM_ALU_PC_G2 61
2549#define R_ARM_LDR_PC_G1 62
2550#define R_ARM_LDR_PC_G2 63
2551#define R_ARM_LDRS_PC_G0 64
2552#define R_ARM_LDRS_PC_G1 65
2553#define R_ARM_LDRS_PC_G2 66
2554#define R_ARM_LDC_PC_G0 67
2555#define R_ARM_LDC_PC_G1 68
2556#define R_ARM_LDC_PC_G2 69
2557#define R_ARM_ALU_SB_G0_NC 70
2558#define R_ARM_ALU_SB_G0 71
2559#define R_ARM_ALU_SB_G1_NC 72
2560#define R_ARM_ALU_SB_G1 73
2561#define R_ARM_ALU_SB_G2 74
2562#define R_ARM_LDR_SB_G0 75
2563#define R_ARM_LDR_SB_G1 76
2564#define R_ARM_LDR_SB_G2 77
2565#define R_ARM_LDRS_SB_G0 78
2566#define R_ARM_LDRS_SB_G1 79
2567#define R_ARM_LDRS_SB_G2 80
2568#define R_ARM_LDC_SB_G0 81
2569#define R_ARM_LDC_SB_G1 82
2570#define R_ARM_LDC_SB_G2 83
2571#define R_ARM_MOVW_BREL_NC 84
2572#define R_ARM_MOVT_BREL 85
2573#define R_ARM_MOVW_BREL 86
2574#define R_ARM_THM_MOVW_BREL_NC 87
2575#define R_ARM_THM_MOVT_BREL 88
2576#define R_ARM_THM_MOVW_BREL 89
2577#define R_ARM_TLS_GOTDESC 90
2578#define R_ARM_TLS_CALL 91
2579#define R_ARM_TLS_DESCSEQ 92
2580#define R_ARM_THM_TLS_CALL 93
2581#define R_ARM_PLT32_ABS 94
2582#define R_ARM_GOT_ABS 95
2583#define R_ARM_GOT_PREL 96
2584#define R_ARM_GOT_BREL12 97
2585#define R_ARM_GOTOFF12 98
2586#define R_ARM_GOTRELAX 99
2587#define R_ARM_GNU_VTENTRY 100
2588#define R_ARM_GNU_VTINHERIT 101
2589#define R_ARM_THM_PC11 102
2590#define R_ARM_THM_PC9 103
2591#define R_ARM_TLS_GD32 104
2592
2593#define R_ARM_TLS_LDM32 105
2594
2595#define R_ARM_TLS_LDO32 106
2596
2597#define R_ARM_TLS_IE32 107
2598
2599#define R_ARM_TLS_LE32 108
2600#define R_ARM_TLS_LDO12 109
2601#define R_ARM_TLS_LE12 110
2602#define R_ARM_TLS_IE12GP 111
2603#define R_ARM_ME_TOO 128
2604#define R_ARM_THM_TLS_DESCSEQ 129
2605#define R_ARM_THM_TLS_DESCSEQ16 129
2606#define R_ARM_THM_TLS_DESCSEQ32 130
2607#define R_ARM_THM_GOT_BREL12 131
2608#define R_ARM_IRELATIVE 160
2609#define R_ARM_RXPC25 249
2610#define R_ARM_RSBREL32 250
2611#define R_ARM_THM_RPC22 251
2612#define R_ARM_RREL32 252
2613#define R_ARM_RABS22 253
2614#define R_ARM_RPC24 254
2615#define R_ARM_RBASE 255
2616
2617#define R_ARM_NUM 256
2618
2619
2620
2621
2622#define EF_IA_64_MASKOS 0x0000000f
2623#define EF_IA_64_ABI64 0x00000010
2624#define EF_IA_64_ARCH 0xff000000
2625
2626
2627#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
2628#define PT_IA_64_UNWIND (PT_LOPROC + 1)
2629#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
2630#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
2631#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
2632
2633
2634#define PF_IA_64_NORECOV 0x80000000
2635
2636
2637#define SHT_IA_64_EXT (SHT_LOPROC + 0)
2638#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
2639
2640
2641#define SHF_IA_64_SHORT 0x10000000
2642#define SHF_IA_64_NORECOV 0x20000000
2643
2644
2645#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
2646#define DT_IA_64_NUM 1
2647
2648
2649#define R_IA64_NONE 0x00
2650#define R_IA64_IMM14 0x21
2651#define R_IA64_IMM22 0x22
2652#define R_IA64_IMM64 0x23
2653#define R_IA64_DIR32MSB 0x24
2654#define R_IA64_DIR32LSB 0x25
2655#define R_IA64_DIR64MSB 0x26
2656#define R_IA64_DIR64LSB 0x27
2657#define R_IA64_GPREL22 0x2a
2658#define R_IA64_GPREL64I 0x2b
2659#define R_IA64_GPREL32MSB 0x2c
2660#define R_IA64_GPREL32LSB 0x2d
2661#define R_IA64_GPREL64MSB 0x2e
2662#define R_IA64_GPREL64LSB 0x2f
2663#define R_IA64_LTOFF22 0x32
2664#define R_IA64_LTOFF64I 0x33
2665#define R_IA64_PLTOFF22 0x3a
2666#define R_IA64_PLTOFF64I 0x3b
2667#define R_IA64_PLTOFF64MSB 0x3e
2668#define R_IA64_PLTOFF64LSB 0x3f
2669#define R_IA64_FPTR64I 0x43
2670#define R_IA64_FPTR32MSB 0x44
2671#define R_IA64_FPTR32LSB 0x45
2672#define R_IA64_FPTR64MSB 0x46
2673#define R_IA64_FPTR64LSB 0x47
2674#define R_IA64_PCREL60B 0x48
2675#define R_IA64_PCREL21B 0x49
2676#define R_IA64_PCREL21M 0x4a
2677#define R_IA64_PCREL21F 0x4b
2678#define R_IA64_PCREL32MSB 0x4c
2679#define R_IA64_PCREL32LSB 0x4d
2680#define R_IA64_PCREL64MSB 0x4e
2681#define R_IA64_PCREL64LSB 0x4f
2682#define R_IA64_LTOFF_FPTR22 0x52
2683#define R_IA64_LTOFF_FPTR64I 0x53
2684#define R_IA64_LTOFF_FPTR32MSB 0x54
2685#define R_IA64_LTOFF_FPTR32LSB 0x55
2686#define R_IA64_LTOFF_FPTR64MSB 0x56
2687#define R_IA64_LTOFF_FPTR64LSB 0x57
2688#define R_IA64_SEGREL32MSB 0x5c
2689#define R_IA64_SEGREL32LSB 0x5d
2690#define R_IA64_SEGREL64MSB 0x5e
2691#define R_IA64_SEGREL64LSB 0x5f
2692#define R_IA64_SECREL32MSB 0x64
2693#define R_IA64_SECREL32LSB 0x65
2694#define R_IA64_SECREL64MSB 0x66
2695#define R_IA64_SECREL64LSB 0x67
2696#define R_IA64_REL32MSB 0x6c
2697#define R_IA64_REL32LSB 0x6d
2698#define R_IA64_REL64MSB 0x6e
2699#define R_IA64_REL64LSB 0x6f
2700#define R_IA64_LTV32MSB 0x74
2701#define R_IA64_LTV32LSB 0x75
2702#define R_IA64_LTV64MSB 0x76
2703#define R_IA64_LTV64LSB 0x77
2704#define R_IA64_PCREL21BI 0x79
2705#define R_IA64_PCREL22 0x7a
2706#define R_IA64_PCREL64I 0x7b
2707#define R_IA64_IPLTMSB 0x80
2708#define R_IA64_IPLTLSB 0x81
2709#define R_IA64_COPY 0x84
2710#define R_IA64_SUB 0x85
2711#define R_IA64_LTOFF22X 0x86
2712#define R_IA64_LDXMOV 0x87
2713#define R_IA64_TPREL14 0x91
2714#define R_IA64_TPREL22 0x92
2715#define R_IA64_TPREL64I 0x93
2716#define R_IA64_TPREL64MSB 0x96
2717#define R_IA64_TPREL64LSB 0x97
2718#define R_IA64_LTOFF_TPREL22 0x9a
2719#define R_IA64_DTPMOD64MSB 0xa6
2720#define R_IA64_DTPMOD64LSB 0xa7
2721#define R_IA64_LTOFF_DTPMOD22 0xaa
2722#define R_IA64_DTPREL14 0xb1
2723#define R_IA64_DTPREL22 0xb2
2724#define R_IA64_DTPREL64I 0xb3
2725#define R_IA64_DTPREL32MSB 0xb4
2726#define R_IA64_DTPREL32LSB 0xb5
2727#define R_IA64_DTPREL64MSB 0xb6
2728#define R_IA64_DTPREL64LSB 0xb7
2729#define R_IA64_LTOFF_DTPREL22 0xba
2730
2731
2732#define EF_SH_MACH_MASK 0x1f
2733#define EF_SH_UNKNOWN 0x0
2734#define EF_SH1 0x1
2735#define EF_SH2 0x2
2736#define EF_SH3 0x3
2737#define EF_SH_DSP 0x4
2738#define EF_SH3_DSP 0x5
2739#define EF_SH4AL_DSP 0x6
2740#define EF_SH3E 0x8
2741#define EF_SH4 0x9
2742#define EF_SH2E 0xb
2743#define EF_SH4A 0xc
2744#define EF_SH2A 0xd
2745#define EF_SH4_NOFPU 0x10
2746#define EF_SH4A_NOFPU 0x11
2747#define EF_SH4_NOMMU_NOFPU 0x12
2748#define EF_SH2A_NOFPU 0x13
2749#define EF_SH3_NOMMU 0x14
2750#define EF_SH2A_SH4_NOFPU 0x15
2751#define EF_SH2A_SH3_NOFPU 0x16
2752#define EF_SH2A_SH4 0x17
2753#define EF_SH2A_SH3E 0x18
2754
2755#define R_SH_NONE 0
2756#define R_SH_DIR32 1
2757#define R_SH_REL32 2
2758#define R_SH_DIR8WPN 3
2759#define R_SH_IND12W 4
2760#define R_SH_DIR8WPL 5
2761#define R_SH_DIR8WPZ 6
2762#define R_SH_DIR8BP 7
2763#define R_SH_DIR8W 8
2764#define R_SH_DIR8L 9
2765#define R_SH_SWITCH16 25
2766#define R_SH_SWITCH32 26
2767#define R_SH_USES 27
2768#define R_SH_COUNT 28
2769#define R_SH_ALIGN 29
2770#define R_SH_CODE 30
2771#define R_SH_DATA 31
2772#define R_SH_LABEL 32
2773#define R_SH_SWITCH8 33
2774#define R_SH_GNU_VTINHERIT 34
2775#define R_SH_GNU_VTENTRY 35
2776#define R_SH_TLS_GD_32 144
2777#define R_SH_TLS_LD_32 145
2778#define R_SH_TLS_LDO_32 146
2779#define R_SH_TLS_IE_32 147
2780#define R_SH_TLS_LE_32 148
2781#define R_SH_TLS_DTPMOD32 149
2782#define R_SH_TLS_DTPOFF32 150
2783#define R_SH_TLS_TPOFF32 151
2784#define R_SH_GOT32 160
2785#define R_SH_PLT32 161
2786#define R_SH_COPY 162
2787#define R_SH_GLOB_DAT 163
2788#define R_SH_JMP_SLOT 164
2789#define R_SH_RELATIVE 165
2790#define R_SH_GOTOFF 166
2791#define R_SH_GOTPC 167
2792#define R_SH_GOT20 201
2793#define R_SH_GOTOFF20 202
2794#define R_SH_GOTFUNCDESC 203
2795#define R_SH_GOTFUNCDEST20 204
2796#define R_SH_GOTOFFFUNCDESC 205
2797#define R_SH_GOTOFFFUNCDEST20 206
2798#define R_SH_FUNCDESC 207
2799#define R_SH_FUNCDESC_VALUE 208
2800
2801#define R_SH_NUM 256
2802
2803
2804
2805#define R_390_NONE 0
2806#define R_390_8 1
2807#define R_390_12 2
2808#define R_390_16 3
2809#define R_390_32 4
2810#define R_390_PC32 5
2811#define R_390_GOT12 6
2812#define R_390_GOT32 7
2813#define R_390_PLT32 8
2814#define R_390_COPY 9
2815#define R_390_GLOB_DAT 10
2816#define R_390_JMP_SLOT 11
2817#define R_390_RELATIVE 12
2818#define R_390_GOTOFF32 13
2819#define R_390_GOTPC 14
2820#define R_390_GOT16 15
2821#define R_390_PC16 16
2822#define R_390_PC16DBL 17
2823#define R_390_PLT16DBL 18
2824#define R_390_PC32DBL 19
2825#define R_390_PLT32DBL 20
2826#define R_390_GOTPCDBL 21
2827#define R_390_64 22
2828#define R_390_PC64 23
2829#define R_390_GOT64 24
2830#define R_390_PLT64 25
2831#define R_390_GOTENT 26
2832#define R_390_GOTOFF16 27
2833#define R_390_GOTOFF64 28
2834#define R_390_GOTPLT12 29
2835#define R_390_GOTPLT16 30
2836#define R_390_GOTPLT32 31
2837#define R_390_GOTPLT64 32
2838#define R_390_GOTPLTENT 33
2839#define R_390_PLTOFF16 34
2840#define R_390_PLTOFF32 35
2841#define R_390_PLTOFF64 36
2842#define R_390_TLS_LOAD 37
2843#define R_390_TLS_GDCALL 38
2844
2845#define R_390_TLS_LDCALL 39
2846
2847#define R_390_TLS_GD32 40
2848
2849#define R_390_TLS_GD64 41
2850
2851#define R_390_TLS_GOTIE12 42
2852
2853#define R_390_TLS_GOTIE32 43
2854
2855#define R_390_TLS_GOTIE64 44
2856
2857#define R_390_TLS_LDM32 45
2858
2859#define R_390_TLS_LDM64 46
2860
2861#define R_390_TLS_IE32 47
2862
2863#define R_390_TLS_IE64 48
2864
2865#define R_390_TLS_IEENT 49
2866
2867#define R_390_TLS_LE32 50
2868
2869#define R_390_TLS_LE64 51
2870
2871#define R_390_TLS_LDO32 52
2872
2873#define R_390_TLS_LDO64 53
2874
2875#define R_390_TLS_DTPMOD 54
2876#define R_390_TLS_DTPOFF 55
2877#define R_390_TLS_TPOFF 56
2878
2879#define R_390_20 57
2880#define R_390_GOT20 58
2881#define R_390_GOTPLT20 59
2882#define R_390_TLS_GOTIE20 60
2883
2884
2885#define R_390_NUM 61
2886
2887
2888
2889#define R_CRIS_NONE 0
2890#define R_CRIS_8 1
2891#define R_CRIS_16 2
2892#define R_CRIS_32 3
2893#define R_CRIS_8_PCREL 4
2894#define R_CRIS_16_PCREL 5
2895#define R_CRIS_32_PCREL 6
2896#define R_CRIS_GNU_VTINHERIT 7
2897#define R_CRIS_GNU_VTENTRY 8
2898#define R_CRIS_COPY 9
2899#define R_CRIS_GLOB_DAT 10
2900#define R_CRIS_JUMP_SLOT 11
2901#define R_CRIS_RELATIVE 12
2902#define R_CRIS_16_GOT 13
2903#define R_CRIS_32_GOT 14
2904#define R_CRIS_16_GOTPLT 15
2905#define R_CRIS_32_GOTPLT 16
2906#define R_CRIS_32_GOTREL 17
2907#define R_CRIS_32_PLT_GOTREL 18
2908#define R_CRIS_32_PLT_PCREL 19
2909
2910#define R_CRIS_NUM 20
2911
2912
2913
2914#define R_X86_64_NONE 0
2915#define R_X86_64_64 1
2916#define R_X86_64_PC32 2
2917#define R_X86_64_GOT32 3
2918#define R_X86_64_PLT32 4
2919#define R_X86_64_COPY 5
2920#define R_X86_64_GLOB_DAT 6
2921#define R_X86_64_JUMP_SLOT 7
2922#define R_X86_64_RELATIVE 8
2923#define R_X86_64_GOTPCREL 9
2924
2925#define R_X86_64_32 10
2926#define R_X86_64_32S 11
2927#define R_X86_64_16 12
2928#define R_X86_64_PC16 13
2929#define R_X86_64_8 14
2930#define R_X86_64_PC8 15
2931#define R_X86_64_DTPMOD64 16
2932#define R_X86_64_DTPOFF64 17
2933#define R_X86_64_TPOFF64 18
2934#define R_X86_64_TLSGD 19
2935
2936#define R_X86_64_TLSLD 20
2937
2938#define R_X86_64_DTPOFF32 21
2939#define R_X86_64_GOTTPOFF 22
2940
2941#define R_X86_64_TPOFF32 23
2942#define R_X86_64_PC64 24
2943#define R_X86_64_GOTOFF64 25
2944#define R_X86_64_GOTPC32 26
2945#define R_X86_64_GOT64 27
2946#define R_X86_64_GOTPCREL64 28
2947#define R_X86_64_GOTPC64 29
2948#define R_X86_64_GOTPLT64 30
2949#define R_X86_64_PLTOFF64 31
2950#define R_X86_64_SIZE32 32
2951#define R_X86_64_SIZE64 33
2952
2953#define R_X86_64_GOTPC32_TLSDESC 34
2954#define R_X86_64_TLSDESC_CALL 35
2955
2956#define R_X86_64_TLSDESC 36
2957#define R_X86_64_IRELATIVE 37
2958#define R_X86_64_RELATIVE64 38
2959#define R_X86_64_GOTPCRELX 41
2960#define R_X86_64_REX_GOTPCRELX 42
2961#define R_X86_64_NUM 43
2962
2963
2964
2965#define R_MN10300_NONE 0
2966#define R_MN10300_32 1
2967#define R_MN10300_16 2
2968#define R_MN10300_8 3
2969#define R_MN10300_PCREL32 4
2970#define R_MN10300_PCREL16 5
2971#define R_MN10300_PCREL8 6
2972#define R_MN10300_GNU_VTINHERIT 7
2973#define R_MN10300_GNU_VTENTRY 8
2974#define R_MN10300_24 9
2975#define R_MN10300_GOTPC32 10
2976#define R_MN10300_GOTPC16 11
2977#define R_MN10300_GOTOFF32 12
2978#define R_MN10300_GOTOFF24 13
2979#define R_MN10300_GOTOFF16 14
2980#define R_MN10300_PLT32 15
2981#define R_MN10300_PLT16 16
2982#define R_MN10300_GOT32 17
2983#define R_MN10300_GOT24 18
2984#define R_MN10300_GOT16 19
2985#define R_MN10300_COPY 20
2986#define R_MN10300_GLOB_DAT 21
2987#define R_MN10300_JMP_SLOT 22
2988#define R_MN10300_RELATIVE 23
2989
2990#define R_MN10300_NUM 24
2991
2992
2993
2994#define R_M32R_NONE 0
2995#define R_M32R_16 1
2996#define R_M32R_32 2
2997#define R_M32R_24 3
2998#define R_M32R_10_PCREL 4
2999#define R_M32R_18_PCREL 5
3000#define R_M32R_26_PCREL 6
3001#define R_M32R_HI16_ULO 7
3002#define R_M32R_HI16_SLO 8
3003#define R_M32R_LO16 9
3004#define R_M32R_SDA16 10
3005#define R_M32R_GNU_VTINHERIT 11
3006#define R_M32R_GNU_VTENTRY 12
3007
3008#define R_M32R_16_RELA 33
3009#define R_M32R_32_RELA 34
3010#define R_M32R_24_RELA 35
3011#define R_M32R_10_PCREL_RELA 36
3012#define R_M32R_18_PCREL_RELA 37
3013#define R_M32R_26_PCREL_RELA 38
3014#define R_M32R_HI16_ULO_RELA 39
3015#define R_M32R_HI16_SLO_RELA 40
3016#define R_M32R_LO16_RELA 41
3017#define R_M32R_SDA16_RELA 42
3018#define R_M32R_RELA_GNU_VTINHERIT 43
3019#define R_M32R_RELA_GNU_VTENTRY 44
3020#define R_M32R_REL32 45
3021
3022#define R_M32R_GOT24 48
3023#define R_M32R_26_PLTREL 49
3024#define R_M32R_COPY 50
3025#define R_M32R_GLOB_DAT 51
3026#define R_M32R_JMP_SLOT 52
3027#define R_M32R_RELATIVE 53
3028#define R_M32R_GOTOFF 54
3029#define R_M32R_GOTPC24 55
3030#define R_M32R_GOT16_HI_ULO 56
3031
3032#define R_M32R_GOT16_HI_SLO 57
3033
3034#define R_M32R_GOT16_LO 58
3035#define R_M32R_GOTPC_HI_ULO 59
3036
3037#define R_M32R_GOTPC_HI_SLO 60
3038
3039#define R_M32R_GOTPC_LO 61
3040
3041#define R_M32R_GOTOFF_HI_ULO 62
3042
3043#define R_M32R_GOTOFF_HI_SLO 63
3044
3045#define R_M32R_GOTOFF_LO 64
3046#define R_M32R_NUM 256
3047
3048#define R_MICROBLAZE_NONE 0
3049#define R_MICROBLAZE_32 1
3050#define R_MICROBLAZE_32_PCREL 2
3051#define R_MICROBLAZE_64_PCREL 3
3052#define R_MICROBLAZE_32_PCREL_LO 4
3053#define R_MICROBLAZE_64 5
3054#define R_MICROBLAZE_32_LO 6
3055#define R_MICROBLAZE_SRO32 7
3056#define R_MICROBLAZE_SRW32 8
3057#define R_MICROBLAZE_64_NONE 9
3058#define R_MICROBLAZE_32_SYM_OP_SYM 10
3059#define R_MICROBLAZE_GNU_VTINHERIT 11
3060#define R_MICROBLAZE_GNU_VTENTRY 12
3061#define R_MICROBLAZE_GOTPC_64 13
3062#define R_MICROBLAZE_GOT_64 14
3063#define R_MICROBLAZE_PLT_64 15
3064#define R_MICROBLAZE_REL 16
3065#define R_MICROBLAZE_JUMP_SLOT 17
3066#define R_MICROBLAZE_GLOB_DAT 18
3067#define R_MICROBLAZE_GOTOFF_64 19
3068#define R_MICROBLAZE_GOTOFF_32 20
3069#define R_MICROBLAZE_COPY 21
3070#define R_MICROBLAZE_TLS 22
3071#define R_MICROBLAZE_TLSGD 23
3072#define R_MICROBLAZE_TLSLD 24
3073#define R_MICROBLAZE_TLSDTPMOD32 25
3074#define R_MICROBLAZE_TLSDTPREL32 26
3075#define R_MICROBLAZE_TLSDTPREL64 27
3076#define R_MICROBLAZE_TLSGOTTPREL32 28
3077#define R_MICROBLAZE_TLSTPREL32 29
3078
3079#define DT_NIOS2_GP 0x70000002
3080
3081#define R_NIOS2_NONE 0
3082#define R_NIOS2_S16 1
3083#define R_NIOS2_U16 2
3084#define R_NIOS2_PCREL16 3
3085#define R_NIOS2_CALL26 4
3086#define R_NIOS2_IMM5 5
3087#define R_NIOS2_CACHE_OPX 6
3088#define R_NIOS2_IMM6 7
3089#define R_NIOS2_IMM8 8
3090#define R_NIOS2_HI16 9
3091#define R_NIOS2_LO16 10
3092#define R_NIOS2_HIADJ16 11
3093#define R_NIOS2_BFD_RELOC_32 12
3094#define R_NIOS2_BFD_RELOC_16 13
3095#define R_NIOS2_BFD_RELOC_8 14
3096#define R_NIOS2_GPREL 15
3097#define R_NIOS2_GNU_VTINHERIT 16
3098#define R_NIOS2_GNU_VTENTRY 17
3099#define R_NIOS2_UJMP 18
3100#define R_NIOS2_CJMP 19
3101#define R_NIOS2_CALLR 20
3102#define R_NIOS2_ALIGN 21
3103#define R_NIOS2_GOT16 22
3104#define R_NIOS2_CALL16 23
3105#define R_NIOS2_GOTOFF_LO 24
3106#define R_NIOS2_GOTOFF_HA 25
3107#define R_NIOS2_PCREL_LO 26
3108#define R_NIOS2_PCREL_HA 27
3109#define R_NIOS2_TLS_GD16 28
3110#define R_NIOS2_TLS_LDM16 29
3111#define R_NIOS2_TLS_LDO16 30
3112#define R_NIOS2_TLS_IE16 31
3113#define R_NIOS2_TLS_LE16 32
3114#define R_NIOS2_TLS_DTPMOD 33
3115#define R_NIOS2_TLS_DTPREL 34
3116#define R_NIOS2_TLS_TPREL 35
3117#define R_NIOS2_COPY 36
3118#define R_NIOS2_GLOB_DAT 37
3119#define R_NIOS2_JUMP_SLOT 38
3120#define R_NIOS2_RELATIVE 39
3121#define R_NIOS2_GOTOFF 40
3122#define R_NIOS2_CALL26_NOAT 41
3123#define R_NIOS2_GOT_LO 42
3124#define R_NIOS2_GOT_HA 43
3125#define R_NIOS2_CALL_LO 44
3126#define R_NIOS2_CALL_HA 45
3127
3128#define R_OR1K_NONE 0
3129#define R_OR1K_32 1
3130#define R_OR1K_16 2
3131#define R_OR1K_8 3
3132#define R_OR1K_LO_16_IN_INSN 4
3133#define R_OR1K_HI_16_IN_INSN 5
3134#define R_OR1K_INSN_REL_26 6
3135#define R_OR1K_GNU_VTENTRY 7
3136#define R_OR1K_GNU_VTINHERIT 8
3137#define R_OR1K_32_PCREL 9
3138#define R_OR1K_16_PCREL 10
3139#define R_OR1K_8_PCREL 11
3140#define R_OR1K_GOTPC_HI16 12
3141#define R_OR1K_GOTPC_LO16 13
3142#define R_OR1K_GOT16 14
3143#define R_OR1K_PLT26 15
3144#define R_OR1K_GOTOFF_HI16 16
3145#define R_OR1K_GOTOFF_LO16 17
3146#define R_OR1K_COPY 18
3147#define R_OR1K_GLOB_DAT 19
3148#define R_OR1K_JMP_SLOT 20
3149#define R_OR1K_RELATIVE 21
3150#define R_OR1K_TLS_GD_HI16 22
3151#define R_OR1K_TLS_GD_LO16 23
3152#define R_OR1K_TLS_LDM_HI16 24
3153#define R_OR1K_TLS_LDM_LO16 25
3154#define R_OR1K_TLS_LDO_HI16 26
3155#define R_OR1K_TLS_LDO_LO16 27
3156#define R_OR1K_TLS_IE_HI16 28
3157#define R_OR1K_TLS_IE_LO16 29
3158#define R_OR1K_TLS_LE_HI16 30
3159#define R_OR1K_TLS_LE_LO16 31
3160#define R_OR1K_TLS_TPOFF 32
3161#define R_OR1K_TLS_DTPOFF 33
3162#define R_OR1K_TLS_DTPMOD 34
3163
3164#define R_BPF_NONE 0
3165#define R_BPF_MAP_FD 1
3166
3167#define R_RISCV_NONE 0
3168#define R_RISCV_32 1
3169#define R_RISCV_64 2
3170#define R_RISCV_RELATIVE 3
3171#define R_RISCV_COPY 4
3172#define R_RISCV_JUMP_SLOT 5
3173#define R_RISCV_TLS_DTPMOD32 6
3174#define R_RISCV_TLS_DTPMOD64 7
3175#define R_RISCV_TLS_DTPREL32 8
3176#define R_RISCV_TLS_DTPREL64 9
3177#define R_RISCV_TLS_TPREL32 10
3178#define R_RISCV_TLS_TPREL64 11
3179
3180#define R_RISCV_BRANCH 16
3181#define R_RISCV_JAL 17
3182#define R_RISCV_CALL 18
3183#define R_RISCV_CALL_PLT 19
3184#define R_RISCV_GOT_HI20 20
3185#define R_RISCV_TLS_GOT_HI20 21
3186#define R_RISCV_TLS_GD_HI20 22
3187#define R_RISCV_PCREL_HI20 23
3188#define R_RISCV_PCREL_LO12_I 24
3189#define R_RISCV_PCREL_LO12_S 25
3190#define R_RISCV_HI20 26
3191#define R_RISCV_LO12_I 27
3192#define R_RISCV_LO12_S 28
3193#define R_RISCV_TPREL_HI20 29
3194#define R_RISCV_TPREL_LO12_I 30
3195#define R_RISCV_TPREL_LO12_S 31
3196#define R_RISCV_TPREL_ADD 32
3197#define R_RISCV_ADD8 33
3198#define R_RISCV_ADD16 34
3199#define R_RISCV_ADD32 35
3200#define R_RISCV_ADD64 36
3201#define R_RISCV_SUB8 37
3202#define R_RISCV_SUB16 38
3203#define R_RISCV_SUB32 39
3204#define R_RISCV_SUB64 40
3205#define R_RISCV_GNU_VTINHERIT 41
3206#define R_RISCV_GNU_VTENTRY 42
3207#define R_RISCV_ALIGN 43
3208#define R_RISCV_RVC_BRANCH 44
3209#define R_RISCV_RVC_JUMP 45
3210#define R_RISCV_RVC_LUI 46
3211#define R_RISCV_GPREL_I 47
3212#define R_RISCV_GPREL_S 48
3213#define R_RISCV_TPREL_I 49
3214#define R_RISCV_TPREL_S 50
3215#define R_RISCV_RELAX 51
3216#define R_RISCV_SUB6 52
3217#define R_RISCV_SET6 53
3218#define R_RISCV_SET8 54
3219#define R_RISCV_SET16 55
3220#define R_RISCV_SET32 56
3221#define R_RISCV_32_PCREL 57
3222
3223#ifdef __cplusplus
3224}
3225#endif
3226
3227
3228#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/netinet/tcp.h deleted-253
...@@ -1,253 +0,0 @@
1#ifndef _NETINET_TCP_H
2#define _NETINET_TCP_H
3
4#include <features.h>
5
6#define TCP_NODELAY 1
7#define TCP_MAXSEG 2
8#define TCP_CORK 3
9#define TCP_KEEPIDLE 4
10#define TCP_KEEPINTVL 5
11#define TCP_KEEPCNT 6
12#define TCP_SYNCNT 7
13#define TCP_LINGER2 8
14#define TCP_DEFER_ACCEPT 9
15#define TCP_WINDOW_CLAMP 10
16#define TCP_INFO 11
17#define TCP_QUICKACK 12
18#define TCP_CONGESTION 13
19#define TCP_MD5SIG 14
20#define TCP_THIN_LINEAR_TIMEOUTS 16
21#define TCP_THIN_DUPACK 17
22#define TCP_USER_TIMEOUT 18
23#define TCP_REPAIR 19
24#define TCP_REPAIR_QUEUE 20
25#define TCP_QUEUE_SEQ 21
26#define TCP_REPAIR_OPTIONS 22
27#define TCP_FASTOPEN 23
28#define TCP_TIMESTAMP 24
29#define TCP_NOTSENT_LOWAT 25
30#define TCP_CC_INFO 26
31#define TCP_SAVE_SYN 27
32#define TCP_SAVED_SYN 28
33#define TCP_REPAIR_WINDOW 29
34#define TCP_FASTOPEN_CONNECT 30
35#define TCP_ULP 31
36#define TCP_MD5SIG_EXT 32
37#define TCP_FASTOPEN_KEY 33
38#define TCP_FASTOPEN_NO_COOKIE 34
39
40#define TCP_ESTABLISHED 1
41#define TCP_SYN_SENT 2
42#define TCP_SYN_RECV 3
43#define TCP_FIN_WAIT1 4
44#define TCP_FIN_WAIT2 5
45#define TCP_TIME_WAIT 6
46#define TCP_CLOSE 7
47#define TCP_CLOSE_WAIT 8
48#define TCP_LAST_ACK 9
49#define TCP_LISTEN 10
50#define TCP_CLOSING 11
51
52enum {
53 TCP_NLA_PAD,
54 TCP_NLA_BUSY,
55 TCP_NLA_RWND_LIMITED,
56 TCP_NLA_SNDBUF_LIMITED,
57 TCP_NLA_DATA_SEGS_OUT,
58 TCP_NLA_TOTAL_RETRANS,
59 TCP_NLA_PACING_RATE,
60 TCP_NLA_DELIVERY_RATE,
61 TCP_NLA_SND_CWND,
62 TCP_NLA_REORDERING,
63 TCP_NLA_MIN_RTT,
64 TCP_NLA_RECUR_RETRANS,
65 TCP_NLA_DELIVERY_RATE_APP_LMT,
66 TCP_NLA_SNDQ_SIZE,
67 TCP_NLA_CA_STATE,
68 TCP_NLA_SND_SSTHRESH,
69};
70
71#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
72#define TCPOPT_EOL 0
73#define TCPOPT_NOP 1
74#define TCPOPT_MAXSEG 2
75#define TCPOPT_WINDOW 3
76#define TCPOPT_SACK_PERMITTED 4
77#define TCPOPT_SACK 5
78#define TCPOPT_TIMESTAMP 8
79#define TCPOLEN_SACK_PERMITTED 2
80#define TCPOLEN_WINDOW 3
81#define TCPOLEN_MAXSEG 4
82#define TCPOLEN_TIMESTAMP 10
83
84#define SOL_TCP 6
85
86#include <sys/types.h>
87#include <sys/socket.h>
88#include <stdint.h>
89#include <endian.h>
90
91typedef uint32_t tcp_seq;
92
93#define TH_FIN 0x01
94#define TH_SYN 0x02
95#define TH_RST 0x04
96#define TH_PUSH 0x08
97#define TH_ACK 0x10
98#define TH_URG 0x20
99
100struct tcphdr {
101#ifdef _GNU_SOURCE
102#ifdef __GNUC__
103 __extension__
104#endif
105 union { struct {
106
107 uint16_t source;
108 uint16_t dest;
109 uint32_t seq;
110 uint32_t ack_seq;
111#if __BYTE_ORDER == __LITTLE_ENDIAN
112 uint16_t res1:4;
113 uint16_t doff:4;
114 uint16_t fin:1;
115 uint16_t syn:1;
116 uint16_t rst:1;
117 uint16_t psh:1;
118 uint16_t ack:1;
119 uint16_t urg:1;
120 uint16_t res2:2;
121#else
122 uint16_t doff:4;
123 uint16_t res1:4;
124 uint16_t res2:2;
125 uint16_t urg:1;
126 uint16_t ack:1;
127 uint16_t psh:1;
128 uint16_t rst:1;
129 uint16_t syn:1;
130 uint16_t fin:1;
131#endif
132 uint16_t window;
133 uint16_t check;
134 uint16_t urg_ptr;
135
136 }; struct {
137#endif
138
139 uint16_t th_sport;
140 uint16_t th_dport;
141 uint32_t th_seq;
142 uint32_t th_ack;
143#if __BYTE_ORDER == __LITTLE_ENDIAN
144 uint8_t th_x2:4;
145 uint8_t th_off:4;
146#else
147 uint8_t th_off:4;
148 uint8_t th_x2:4;
149#endif
150 uint8_t th_flags;
151 uint16_t th_win;
152 uint16_t th_sum;
153 uint16_t th_urp;
154
155#ifdef _GNU_SOURCE
156 }; };
157#endif
158};
159#endif
160
161#ifdef _GNU_SOURCE
162#define TCPI_OPT_TIMESTAMPS 1
163#define TCPI_OPT_SACK 2
164#define TCPI_OPT_WSCALE 4
165#define TCPI_OPT_ECN 8
166
167#define TCP_CA_Open 0
168#define TCP_CA_Disorder 1
169#define TCP_CA_CWR 2
170#define TCP_CA_Recovery 3
171#define TCP_CA_Loss 4
172
173struct tcp_info {
174 uint8_t tcpi_state;
175 uint8_t tcpi_ca_state;
176 uint8_t tcpi_retransmits;
177 uint8_t tcpi_probes;
178 uint8_t tcpi_backoff;
179 uint8_t tcpi_options;
180 uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
181 uint8_t tcpi_delivery_rate_app_limited : 1;
182 uint32_t tcpi_rto;
183 uint32_t tcpi_ato;
184 uint32_t tcpi_snd_mss;
185 uint32_t tcpi_rcv_mss;
186 uint32_t tcpi_unacked;
187 uint32_t tcpi_sacked;
188 uint32_t tcpi_lost;
189 uint32_t tcpi_retrans;
190 uint32_t tcpi_fackets;
191 uint32_t tcpi_last_data_sent;
192 uint32_t tcpi_last_ack_sent;
193 uint32_t tcpi_last_data_recv;
194 uint32_t tcpi_last_ack_recv;
195 uint32_t tcpi_pmtu;
196 uint32_t tcpi_rcv_ssthresh;
197 uint32_t tcpi_rtt;
198 uint32_t tcpi_rttvar;
199 uint32_t tcpi_snd_ssthresh;
200 uint32_t tcpi_snd_cwnd;
201 uint32_t tcpi_advmss;
202 uint32_t tcpi_reordering;
203 uint32_t tcpi_rcv_rtt;
204 uint32_t tcpi_rcv_space;
205 uint32_t tcpi_total_retrans;
206 uint64_t tcpi_pacing_rate;
207 uint64_t tcpi_max_pacing_rate;
208 uint64_t tcpi_bytes_acked;
209 uint64_t tcpi_bytes_received;
210 uint32_t tcpi_segs_out;
211 uint32_t tcpi_segs_in;
212 uint32_t tcpi_notsent_bytes;
213 uint32_t tcpi_min_rtt;
214 uint32_t tcpi_data_segs_in;
215 uint32_t tcpi_data_segs_out;
216 uint64_t tcpi_delivery_rate;
217 uint64_t tcpi_busy_time;
218 uint64_t tcpi_rwnd_limited;
219 uint64_t tcpi_sndbuf_limited;
220};
221
222#define TCP_MD5SIG_MAXKEYLEN 80
223
224#define TCP_MD5SIG_FLAG_PREFIX 1
225
226struct tcp_md5sig {
227 struct sockaddr_storage tcpm_addr;
228 uint8_t tcpm_flags;
229 uint8_t tcpm_prefixlen;
230 uint16_t tcpm_keylen;
231 uint32_t __tcpm_pad;
232 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
233};
234
235struct tcp_diag_md5sig {
236 uint8_t tcpm_family;
237 uint8_t tcpm_prefixlen;
238 uint16_t tcpm_keylen;
239 uint32_t tcpm_addr[4];
240 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
241};
242
243struct tcp_repair_window {
244 uint32_t snd_wl1;
245 uint32_t snd_wnd;
246 uint32_t max_window;
247 uint32_t rcv_wnd;
248 uint32_t rcv_wup;
249};
250
251#endif
252
253#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/netinet/udp.h deleted-40
...@@ -1,40 +0,0 @@
1#ifndef _NETINET_UDP_H
2#define _NETINET_UDP_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9#include <stdint.h>
10
11#ifdef _GNU_SOURCE
12#define uh_sport source
13#define uh_dport dest
14#define uh_ulen len
15#define uh_sum check
16#endif
17
18struct udphdr {
19 uint16_t uh_sport;
20 uint16_t uh_dport;
21 uint16_t uh_ulen;
22 uint16_t uh_sum;
23};
24
25#define UDP_CORK 1
26#define UDP_ENCAP 100
27
28#define UDP_ENCAP_ESPINUDP_NON_IKE 1
29#define UDP_ENCAP_ESPINUDP 2
30#define UDP_ENCAP_L2TPINUDP 3
31#define UDP_ENCAP_GTP0 4
32#define UDP_ENCAP_GTP1U 5
33
34#define SOL_UDP 17
35
36#ifdef __cplusplus
37}
38#endif
39
40#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/signal.h deleted-277
...@@ -1,277 +0,0 @@
1#ifndef _SIGNAL_H
2#define _SIGNAL_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
11 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
12 || defined(_BSD_SOURCE)
13
14#ifdef _GNU_SOURCE
15#define __ucontext ucontext
16#endif
17
18#define __NEED_size_t
19#define __NEED_pid_t
20#define __NEED_uid_t
21#define __NEED_struct_timespec
22#define __NEED_pthread_t
23#define __NEED_pthread_attr_t
24#define __NEED_time_t
25#define __NEED_clock_t
26#define __NEED_sigset_t
27
28#include <bits/alltypes.h>
29
30#define SIG_BLOCK 0
31#define SIG_UNBLOCK 1
32#define SIG_SETMASK 2
33
34#define SI_ASYNCNL (-60)
35#define SI_TKILL (-6)
36#define SI_SIGIO (-5)
37#define SI_ASYNCIO (-4)
38#define SI_MESGQ (-3)
39#define SI_TIMER (-2)
40#define SI_QUEUE (-1)
41#define SI_USER 0
42#define SI_KERNEL 128
43
44typedef struct sigaltstack stack_t;
45
46#endif
47
48#include <bits/signal.h>
49
50#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
51 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
52 || defined(_BSD_SOURCE)
53
54#define SIG_HOLD ((void (*)(int)) 2)
55
56#define FPE_INTDIV 1
57#define FPE_INTOVF 2
58#define FPE_FLTDIV 3
59#define FPE_FLTOVF 4
60#define FPE_FLTUND 5
61#define FPE_FLTRES 6
62#define FPE_FLTINV 7
63#define FPE_FLTSUB 8
64
65#define ILL_ILLOPC 1
66#define ILL_ILLOPN 2
67#define ILL_ILLADR 3
68#define ILL_ILLTRP 4
69#define ILL_PRVOPC 5
70#define ILL_PRVREG 6
71#define ILL_COPROC 7
72#define ILL_BADSTK 8
73
74#define SEGV_MAPERR 1
75#define SEGV_ACCERR 2
76#define SEGV_BNDERR 3
77#define SEGV_PKUERR 4
78
79#define BUS_ADRALN 1
80#define BUS_ADRERR 2
81#define BUS_OBJERR 3
82#define BUS_MCEERR_AR 4
83#define BUS_MCEERR_AO 5
84
85#define CLD_EXITED 1
86#define CLD_KILLED 2
87#define CLD_DUMPED 3
88#define CLD_TRAPPED 4
89#define CLD_STOPPED 5
90#define CLD_CONTINUED 6
91
92union sigval {
93 int sival_int;
94 void *sival_ptr;
95};
96
97typedef struct {
98#ifdef __SI_SWAP_ERRNO_CODE
99 int si_signo, si_code, si_errno;
100#else
101 int si_signo, si_errno, si_code;
102#endif
103 union {
104 char __pad[128 - 2*sizeof(int) - sizeof(long)];
105 struct {
106 union {
107 struct {
108 pid_t si_pid;
109 uid_t si_uid;
110 } __piduid;
111 struct {
112 int si_timerid;
113 int si_overrun;
114 } __timer;
115 } __first;
116 union {
117 union sigval si_value;
118 struct {
119 int si_status;
120 clock_t si_utime, si_stime;
121 } __sigchld;
122 } __second;
123 } __si_common;
124 struct {
125 void *si_addr;
126 short si_addr_lsb;
127 union {
128 struct {
129 void *si_lower;
130 void *si_upper;
131 } __addr_bnd;
132 unsigned si_pkey;
133 } __first;
134 } __sigfault;
135 struct {
136 long si_band;
137 int si_fd;
138 } __sigpoll;
139 struct {
140 void *si_call_addr;
141 int si_syscall;
142 unsigned si_arch;
143 } __sigsys;
144 } __si_fields;
145} siginfo_t;
146#define si_pid __si_fields.__si_common.__first.__piduid.si_pid
147#define si_uid __si_fields.__si_common.__first.__piduid.si_uid
148#define si_status __si_fields.__si_common.__second.__sigchld.si_status
149#define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
150#define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
151#define si_value __si_fields.__si_common.__second.si_value
152#define si_addr __si_fields.__sigfault.si_addr
153#define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
154#define si_lower __si_fields.__sigfault.__first.__addr_bnd.si_lower
155#define si_upper __si_fields.__sigfault.__first.__addr_bnd.si_upper
156#define si_pkey __si_fields.__sigfault.__first.si_pkey
157#define si_band __si_fields.__sigpoll.si_band
158#define si_fd __si_fields.__sigpoll.si_fd
159#define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
160#define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
161#define si_ptr si_value.sival_ptr
162#define si_int si_value.sival_int
163#define si_call_addr __si_fields.__sigsys.si_call_addr
164#define si_syscall __si_fields.__sigsys.si_syscall
165#define si_arch __si_fields.__sigsys.si_arch
166
167struct sigaction {
168 union {
169 void (*sa_handler)(int);
170 void (*sa_sigaction)(int, siginfo_t *, void *);
171 } __sa_handler;
172 sigset_t sa_mask;
173 int sa_flags;
174 void (*sa_restorer)(void);
175};
176#define sa_handler __sa_handler.sa_handler
177#define sa_sigaction __sa_handler.sa_sigaction
178
179struct sigevent {
180 union sigval sigev_value;
181 int sigev_signo;
182 int sigev_notify;
183 void (*sigev_notify_function)(union sigval);
184 pthread_attr_t *sigev_notify_attributes;
185 char __pad[56-3*sizeof(long)];
186};
187
188#define SIGEV_SIGNAL 0
189#define SIGEV_NONE 1
190#define SIGEV_THREAD 2
191
192int __libc_current_sigrtmin(void);
193int __libc_current_sigrtmax(void);
194
195#define SIGRTMIN (__libc_current_sigrtmin())
196#define SIGRTMAX (__libc_current_sigrtmax())
197
198int kill(pid_t, int);
199
200int sigemptyset(sigset_t *);
201int sigfillset(sigset_t *);
202int sigaddset(sigset_t *, int);
203int sigdelset(sigset_t *, int);
204int sigismember(const sigset_t *, int);
205
206int sigprocmask(int, const sigset_t *__restrict, sigset_t *__restrict);
207int sigsuspend(const sigset_t *);
208int sigaction(int, const struct sigaction *__restrict, struct sigaction *__restrict);
209int sigpending(sigset_t *);
210int sigwait(const sigset_t *__restrict, int *__restrict);
211int sigwaitinfo(const sigset_t *__restrict, siginfo_t *__restrict);
212int sigtimedwait(const sigset_t *__restrict, siginfo_t *__restrict, const struct timespec *__restrict);
213int sigqueue(pid_t, int, union sigval);
214
215int pthread_sigmask(int, const sigset_t *__restrict, sigset_t *__restrict);
216int pthread_kill(pthread_t, int);
217
218void psiginfo(const siginfo_t *, const char *);
219void psignal(int, const char *);
220
221#endif
222
223#if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
224int killpg(pid_t, int);
225int sigaltstack(const stack_t *__restrict, stack_t *__restrict);
226int sighold(int);
227int sigignore(int);
228int siginterrupt(int, int);
229int sigpause(int);
230int sigrelse(int);
231void (*sigset(int, void (*)(int)))(int);
232#define TRAP_BRKPT 1
233#define TRAP_TRACE 2
234#define TRAP_BRANCH 3
235#define TRAP_HWBKPT 4
236#define POLL_IN 1
237#define POLL_OUT 2
238#define POLL_MSG 3
239#define POLL_ERR 4
240#define POLL_PRI 5
241#define POLL_HUP 6
242#define SS_ONSTACK 1
243#define SS_DISABLE 2
244#define SS_AUTODISARM (1U << 31)
245#define SS_FLAG_BITS SS_AUTODISARM
246#endif
247
248#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
249#define NSIG _NSIG
250typedef void (*sig_t)(int);
251#endif
252
253#ifdef _GNU_SOURCE
254typedef void (*sighandler_t)(int);
255void (*bsd_signal(int, void (*)(int)))(int);
256int sigisemptyset(const sigset_t *);
257int sigorset (sigset_t *, const sigset_t *, const sigset_t *);
258int sigandset(sigset_t *, const sigset_t *, const sigset_t *);
259
260#define SA_NOMASK SA_NODEFER
261#define SA_ONESHOT SA_RESETHAND
262#endif
263
264#define SIG_ERR ((void (*)(int))-1)
265#define SIG_DFL ((void (*)(int)) 0)
266#define SIG_IGN ((void (*)(int)) 1)
267
268typedef int sig_atomic_t;
269
270void (*signal(int, void (*)(int)))(int);
271int raise(int);
272
273#ifdef __cplusplus
274}
275#endif
276
277#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/sys/signalfd.h deleted-45
...@@ -1,45 +0,0 @@
1#ifndef _SYS_SIGNALFD_H
2#define _SYS_SIGNALFD_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include <fcntl.h>
10
11#define __NEED_sigset_t
12
13#include <bits/alltypes.h>
14
15#define SFD_CLOEXEC O_CLOEXEC
16#define SFD_NONBLOCK O_NONBLOCK
17
18int signalfd(int, const sigset_t *, int);
19
20struct signalfd_siginfo {
21 uint32_t ssi_signo;
22 int32_t ssi_errno;
23 int32_t ssi_code;
24 uint32_t ssi_pid;
25 uint32_t ssi_uid;
26 int32_t ssi_fd;
27 uint32_t ssi_tid;
28 uint32_t ssi_band;
29 uint32_t ssi_overrun;
30 uint32_t ssi_trapno;
31 int32_t ssi_status;
32 int32_t ssi_int;
33 uint64_t ssi_ptr;
34 uint64_t ssi_utime;
35 uint64_t ssi_stime;
36 uint64_t ssi_addr;
37 uint16_t ssi_addr_lsb;
38 uint8_t pad[128-12*4-4*8-2];
39};
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-musl/sys/socket.h deleted-350
...@@ -1,350 +0,0 @@
1#ifndef _SYS_SOCKET_H
2#define _SYS_SOCKET_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <features.h>
8
9#define __NEED_socklen_t
10#define __NEED_sa_family_t
11#define __NEED_size_t
12#define __NEED_ssize_t
13#define __NEED_uid_t
14#define __NEED_pid_t
15#define __NEED_gid_t
16#define __NEED_struct_iovec
17
18#include <bits/alltypes.h>
19
20#include <bits/socket.h>
21
22#ifdef _GNU_SOURCE
23struct ucred {
24 pid_t pid;
25 uid_t uid;
26 gid_t gid;
27};
28
29struct mmsghdr {
30 struct msghdr msg_hdr;
31 unsigned int msg_len;
32};
33
34struct timespec;
35
36int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int);
37int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *);
38#endif
39
40struct linger {
41 int l_onoff;
42 int l_linger;
43};
44
45#define SHUT_RD 0
46#define SHUT_WR 1
47#define SHUT_RDWR 2
48
49#ifndef SOCK_STREAM
50#define SOCK_STREAM 1
51#define SOCK_DGRAM 2
52#endif
53
54#define SOCK_RAW 3
55#define SOCK_RDM 4
56#define SOCK_SEQPACKET 5
57#define SOCK_DCCP 6
58#define SOCK_PACKET 10
59
60#ifndef SOCK_CLOEXEC
61#define SOCK_CLOEXEC 02000000
62#define SOCK_NONBLOCK 04000
63#endif
64
65#define PF_UNSPEC 0
66#define PF_LOCAL 1
67#define PF_UNIX PF_LOCAL
68#define PF_FILE PF_LOCAL
69#define PF_INET 2
70#define PF_AX25 3
71#define PF_IPX 4
72#define PF_APPLETALK 5
73#define PF_NETROM 6
74#define PF_BRIDGE 7
75#define PF_ATMPVC 8
76#define PF_X25 9
77#define PF_INET6 10
78#define PF_ROSE 11
79#define PF_DECnet 12
80#define PF_NETBEUI 13
81#define PF_SECURITY 14
82#define PF_KEY 15
83#define PF_NETLINK 16
84#define PF_ROUTE PF_NETLINK
85#define PF_PACKET 17
86#define PF_ASH 18
87#define PF_ECONET 19
88#define PF_ATMSVC 20
89#define PF_RDS 21
90#define PF_SNA 22
91#define PF_IRDA 23
92#define PF_PPPOX 24
93#define PF_WANPIPE 25
94#define PF_LLC 26
95#define PF_IB 27
96#define PF_MPLS 28
97#define PF_CAN 29
98#define PF_TIPC 30
99#define PF_BLUETOOTH 31
100#define PF_IUCV 32
101#define PF_RXRPC 33
102#define PF_ISDN 34
103#define PF_PHONET 35
104#define PF_IEEE802154 36
105#define PF_CAIF 37
106#define PF_ALG 38
107#define PF_NFC 39
108#define PF_VSOCK 40
109#define PF_KCM 41
110#define PF_QIPCRTR 42
111#define PF_SMC 43
112#define PF_MAX 44
113
114#define AF_UNSPEC PF_UNSPEC
115#define AF_LOCAL PF_LOCAL
116#define AF_UNIX AF_LOCAL
117#define AF_FILE AF_LOCAL
118#define AF_INET PF_INET
119#define AF_AX25 PF_AX25
120#define AF_IPX PF_IPX
121#define AF_APPLETALK PF_APPLETALK
122#define AF_NETROM PF_NETROM
123#define AF_BRIDGE PF_BRIDGE
124#define AF_ATMPVC PF_ATMPVC
125#define AF_X25 PF_X25
126#define AF_INET6 PF_INET6
127#define AF_ROSE PF_ROSE
128#define AF_DECnet PF_DECnet
129#define AF_NETBEUI PF_NETBEUI
130#define AF_SECURITY PF_SECURITY
131#define AF_KEY PF_KEY
132#define AF_NETLINK PF_NETLINK
133#define AF_ROUTE PF_ROUTE
134#define AF_PACKET PF_PACKET
135#define AF_ASH PF_ASH
136#define AF_ECONET PF_ECONET
137#define AF_ATMSVC PF_ATMSVC
138#define AF_RDS PF_RDS
139#define AF_SNA PF_SNA
140#define AF_IRDA PF_IRDA
141#define AF_PPPOX PF_PPPOX
142#define AF_WANPIPE PF_WANPIPE
143#define AF_LLC PF_LLC
144#define AF_IB PF_IB
145#define AF_MPLS PF_MPLS
146#define AF_CAN PF_CAN
147#define AF_TIPC PF_TIPC
148#define AF_BLUETOOTH PF_BLUETOOTH
149#define AF_IUCV PF_IUCV
150#define AF_RXRPC PF_RXRPC
151#define AF_ISDN PF_ISDN
152#define AF_PHONET PF_PHONET
153#define AF_IEEE802154 PF_IEEE802154
154#define AF_CAIF PF_CAIF
155#define AF_ALG PF_ALG
156#define AF_NFC PF_NFC
157#define AF_VSOCK PF_VSOCK
158#define AF_KCM PF_KCM
159#define AF_QIPCRTR PF_QIPCRTR
160#define AF_SMC PF_SMC
161#define AF_MAX PF_MAX
162
163#ifndef SO_DEBUG
164#define SO_DEBUG 1
165#define SO_REUSEADDR 2
166#define SO_TYPE 3
167#define SO_ERROR 4
168#define SO_DONTROUTE 5
169#define SO_BROADCAST 6
170#define SO_SNDBUF 7
171#define SO_RCVBUF 8
172#define SO_KEEPALIVE 9
173#define SO_OOBINLINE 10
174#define SO_NO_CHECK 11
175#define SO_PRIORITY 12
176#define SO_LINGER 13
177#define SO_BSDCOMPAT 14
178#define SO_REUSEPORT 15
179#define SO_PASSCRED 16
180#define SO_PEERCRED 17
181#define SO_RCVLOWAT 18
182#define SO_SNDLOWAT 19
183#define SO_RCVTIMEO 20
184#define SO_SNDTIMEO 21
185#define SO_ACCEPTCONN 30
186#define SO_PEERSEC 31
187#define SO_SNDBUFFORCE 32
188#define SO_RCVBUFFORCE 33
189#define SO_PROTOCOL 38
190#define SO_DOMAIN 39
191#endif
192
193#define SO_SECURITY_AUTHENTICATION 22
194#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
195#define SO_SECURITY_ENCRYPTION_NETWORK 24
196
197#define SO_BINDTODEVICE 25
198
199#define SO_ATTACH_FILTER 26
200#define SO_DETACH_FILTER 27
201#define SO_GET_FILTER SO_ATTACH_FILTER
202
203#define SO_PEERNAME 28
204#define SO_TIMESTAMP 29
205#define SCM_TIMESTAMP SO_TIMESTAMP
206
207#define SO_PASSSEC 34
208#define SO_TIMESTAMPNS 35
209#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
210#define SO_MARK 36
211#define SO_TIMESTAMPING 37
212#define SCM_TIMESTAMPING SO_TIMESTAMPING
213#define SO_RXQ_OVFL 40
214#define SO_WIFI_STATUS 41
215#define SCM_WIFI_STATUS SO_WIFI_STATUS
216#define SO_PEEK_OFF 42
217#define SO_NOFCS 43
218#define SO_LOCK_FILTER 44
219#define SO_SELECT_ERR_QUEUE 45
220#define SO_BUSY_POLL 46
221#define SO_MAX_PACING_RATE 47
222#define SO_BPF_EXTENSIONS 48
223#define SO_INCOMING_CPU 49
224#define SO_ATTACH_BPF 50
225#define SO_DETACH_BPF SO_DETACH_FILTER
226#define SO_ATTACH_REUSEPORT_CBPF 51
227#define SO_ATTACH_REUSEPORT_EBPF 52
228#define SO_CNX_ADVICE 53
229#define SCM_TIMESTAMPING_OPT_STATS 54
230#define SO_MEMINFO 55
231#define SO_INCOMING_NAPI_ID 56
232#define SO_COOKIE 57
233#define SCM_TIMESTAMPING_PKTINFO 58
234#define SO_PEERGROUPS 59
235#define SO_ZEROCOPY 60
236
237#ifndef SOL_SOCKET
238#define SOL_SOCKET 1
239#endif
240
241#define SOL_IP 0
242#define SOL_IPV6 41
243#define SOL_ICMPV6 58
244
245#define SOL_RAW 255
246#define SOL_DECNET 261
247#define SOL_X25 262
248#define SOL_PACKET 263
249#define SOL_ATM 264
250#define SOL_AAL 265
251#define SOL_IRDA 266
252#define SOL_NETBEUI 267
253#define SOL_LLC 268
254#define SOL_DCCP 269
255#define SOL_NETLINK 270
256#define SOL_TIPC 271
257#define SOL_RXRPC 272
258#define SOL_PPPOL2TP 273
259#define SOL_BLUETOOTH 274
260#define SOL_PNPIPE 275
261#define SOL_RDS 276
262#define SOL_IUCV 277
263#define SOL_CAIF 278
264#define SOL_ALG 279
265#define SOL_NFC 280
266#define SOL_KCM 281
267#define SOL_TLS 282
268
269#define SOMAXCONN 128
270
271#define MSG_OOB 0x0001
272#define MSG_PEEK 0x0002
273#define MSG_DONTROUTE 0x0004
274#define MSG_CTRUNC 0x0008
275#define MSG_PROXY 0x0010
276#define MSG_TRUNC 0x0020
277#define MSG_DONTWAIT 0x0040
278#define MSG_EOR 0x0080
279#define MSG_WAITALL 0x0100
280#define MSG_FIN 0x0200
281#define MSG_SYN 0x0400
282#define MSG_CONFIRM 0x0800
283#define MSG_RST 0x1000
284#define MSG_ERRQUEUE 0x2000
285#define MSG_NOSIGNAL 0x4000
286#define MSG_MORE 0x8000
287#define MSG_WAITFORONE 0x10000
288#define MSG_BATCH 0x40000
289#define MSG_ZEROCOPY 0x4000000
290#define MSG_FASTOPEN 0x20000000
291#define MSG_CMSG_CLOEXEC 0x40000000
292
293#define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1))
294#define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))
295#define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)
296
297#define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
298#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) || \
299 __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
300 ? 0 : (struct cmsghdr *)__CMSG_NEXT(cmsg))
301#define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
302
303#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
304#define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr)))
305#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
306
307#define SCM_RIGHTS 0x01
308#define SCM_CREDENTIALS 0x02
309
310struct sockaddr {
311 sa_family_t sa_family;
312 char sa_data[14];
313};
314
315struct sockaddr_storage {
316 sa_family_t ss_family;
317 char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)];
318 unsigned long __ss_align;
319};
320
321int socket (int, int, int);
322int socketpair (int, int, int, int [2]);
323
324int shutdown (int, int);
325
326int bind (int, const struct sockaddr *, socklen_t);
327int connect (int, const struct sockaddr *, socklen_t);
328int listen (int, int);
329int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);
330int accept4(int, struct sockaddr *__restrict, socklen_t *__restrict, int);
331
332int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
333int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict);
334
335ssize_t send (int, const void *, size_t, int);
336ssize_t recv (int, void *, size_t, int);
337ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
338ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict);
339ssize_t sendmsg (int, const struct msghdr *, int);
340ssize_t recvmsg (int, struct msghdr *, int);
341
342int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict);
343int setsockopt (int, int, int, const void *, socklen_t);
344
345int sockatmark (int);
346
347#ifdef __cplusplus
348}
349#endif
350#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for riscv64-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/alltypes.h deleted-396
...@@ -1,396 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
22#endif
23
24#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
25typedef int blksize_t;
26#define __DEFINED_blksize_t
27#endif
28
29#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
30typedef unsigned int nlink_t;
31#define __DEFINED_nlink_t
32#endif
33
34
35#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
36typedef float float_t;
37#define __DEFINED_float_t
38#endif
39
40#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
41typedef double double_t;
42#define __DEFINED_double_t
43#endif
44
45
46#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
47typedef struct { long long __ll; long double __ld; } max_align_t;
48#define __DEFINED_max_align_t
49#endif
50
51
52#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
53typedef long time_t;
54#define __DEFINED_time_t
55#endif
56
57#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
58typedef long suseconds_t;
59#define __DEFINED_suseconds_t
60#endif
61
62
63#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
64typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
65#define __DEFINED_pthread_attr_t
66#endif
67
68#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
69typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
70#define __DEFINED_pthread_mutex_t
71#endif
72
73#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
74typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
75#define __DEFINED_mtx_t
76#endif
77
78#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
79typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
80#define __DEFINED_pthread_cond_t
81#endif
82
83#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
84typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
85#define __DEFINED_cnd_t
86#endif
87
88#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
89typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
90#define __DEFINED_pthread_rwlock_t
91#endif
92
93#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
94typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
95#define __DEFINED_pthread_barrier_t
96#endif
97
98#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
99typedef unsigned _Addr size_t;
100#define __DEFINED_size_t
101#endif
102
103#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
104typedef unsigned _Addr uintptr_t;
105#define __DEFINED_uintptr_t
106#endif
107
108#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
109typedef _Addr ptrdiff_t;
110#define __DEFINED_ptrdiff_t
111#endif
112
113#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
114typedef _Addr ssize_t;
115#define __DEFINED_ssize_t
116#endif
117
118#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
119typedef _Addr intptr_t;
120#define __DEFINED_intptr_t
121#endif
122
123#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
124typedef _Addr regoff_t;
125#define __DEFINED_regoff_t
126#endif
127
128#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
129typedef _Reg register_t;
130#define __DEFINED_register_t
131#endif
132
133
134#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
135typedef signed char int8_t;
136#define __DEFINED_int8_t
137#endif
138
139#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
140typedef signed short int16_t;
141#define __DEFINED_int16_t
142#endif
143
144#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
145typedef signed int int32_t;
146#define __DEFINED_int32_t
147#endif
148
149#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
150typedef signed _Int64 int64_t;
151#define __DEFINED_int64_t
152#endif
153
154#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
155typedef signed _Int64 intmax_t;
156#define __DEFINED_intmax_t
157#endif
158
159#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
160typedef unsigned char uint8_t;
161#define __DEFINED_uint8_t
162#endif
163
164#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
165typedef unsigned short uint16_t;
166#define __DEFINED_uint16_t
167#endif
168
169#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
170typedef unsigned int uint32_t;
171#define __DEFINED_uint32_t
172#endif
173
174#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
175typedef unsigned _Int64 uint64_t;
176#define __DEFINED_uint64_t
177#endif
178
179#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
180typedef unsigned _Int64 u_int64_t;
181#define __DEFINED_u_int64_t
182#endif
183
184#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
185typedef unsigned _Int64 uintmax_t;
186#define __DEFINED_uintmax_t
187#endif
188
189
190#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
191typedef unsigned mode_t;
192#define __DEFINED_mode_t
193#endif
194
195#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
196typedef unsigned _Reg nlink_t;
197#define __DEFINED_nlink_t
198#endif
199
200#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
201typedef _Int64 off_t;
202#define __DEFINED_off_t
203#endif
204
205#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
206typedef unsigned _Int64 ino_t;
207#define __DEFINED_ino_t
208#endif
209
210#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
211typedef unsigned _Int64 dev_t;
212#define __DEFINED_dev_t
213#endif
214
215#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
216typedef long blksize_t;
217#define __DEFINED_blksize_t
218#endif
219
220#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
221typedef _Int64 blkcnt_t;
222#define __DEFINED_blkcnt_t
223#endif
224
225#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
226typedef unsigned _Int64 fsblkcnt_t;
227#define __DEFINED_fsblkcnt_t
228#endif
229
230#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
231typedef unsigned _Int64 fsfilcnt_t;
232#define __DEFINED_fsfilcnt_t
233#endif
234
235
236#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
237typedef unsigned wint_t;
238#define __DEFINED_wint_t
239#endif
240
241#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
242typedef unsigned long wctype_t;
243#define __DEFINED_wctype_t
244#endif
245
246
247#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
248typedef void * timer_t;
249#define __DEFINED_timer_t
250#endif
251
252#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
253typedef int clockid_t;
254#define __DEFINED_clockid_t
255#endif
256
257#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
258typedef long clock_t;
259#define __DEFINED_clock_t
260#endif
261
262#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
263struct timeval { time_t tv_sec; suseconds_t tv_usec; };
264#define __DEFINED_struct_timeval
265#endif
266
267#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
268struct timespec { time_t tv_sec; long tv_nsec; };
269#define __DEFINED_struct_timespec
270#endif
271
272
273#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
274typedef int pid_t;
275#define __DEFINED_pid_t
276#endif
277
278#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
279typedef unsigned id_t;
280#define __DEFINED_id_t
281#endif
282
283#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
284typedef unsigned uid_t;
285#define __DEFINED_uid_t
286#endif
287
288#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
289typedef unsigned gid_t;
290#define __DEFINED_gid_t
291#endif
292
293#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
294typedef int key_t;
295#define __DEFINED_key_t
296#endif
297
298#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
299typedef unsigned useconds_t;
300#define __DEFINED_useconds_t
301#endif
302
303
304#ifdef __cplusplus
305#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
306typedef unsigned long pthread_t;
307#define __DEFINED_pthread_t
308#endif
309
310#else
311#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
312typedef struct __pthread * pthread_t;
313#define __DEFINED_pthread_t
314#endif
315
316#endif
317#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
318typedef int pthread_once_t;
319#define __DEFINED_pthread_once_t
320#endif
321
322#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
323typedef unsigned pthread_key_t;
324#define __DEFINED_pthread_key_t
325#endif
326
327#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
328typedef int pthread_spinlock_t;
329#define __DEFINED_pthread_spinlock_t
330#endif
331
332#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
333typedef struct { unsigned __attr; } pthread_mutexattr_t;
334#define __DEFINED_pthread_mutexattr_t
335#endif
336
337#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
338typedef struct { unsigned __attr; } pthread_condattr_t;
339#define __DEFINED_pthread_condattr_t
340#endif
341
342#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
343typedef struct { unsigned __attr; } pthread_barrierattr_t;
344#define __DEFINED_pthread_barrierattr_t
345#endif
346
347#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
348typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
349#define __DEFINED_pthread_rwlockattr_t
350#endif
351
352
353#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
354typedef struct _IO_FILE FILE;
355#define __DEFINED_FILE
356#endif
357
358
359#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
360typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
361#define __DEFINED_mbstate_t
362#endif
363
364
365#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
366typedef struct __locale_struct * locale_t;
367#define __DEFINED_locale_t
368#endif
369
370
371#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
372typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
373#define __DEFINED_sigset_t
374#endif
375
376
377#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
378struct iovec { void *iov_base; size_t iov_len; };
379#define __DEFINED_struct_iovec
380#endif
381
382
383#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
384typedef unsigned socklen_t;
385#define __DEFINED_socklen_t
386#endif
387
388#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
389typedef unsigned short sa_family_t;
390#define __DEFINED_sa_family_t
391#endif
392
393
394#undef _Addr
395#undef _Int64
396#undef _Reg
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/endian.h deleted-5
...@@ -1,5 +0,0 @@
1#if __RISCVEB__
2#define __BYTE_ORDER __BIG_ENDIAN
3#else
4#define __BYTE_ORDER __LITTLE_ENDIAN
5#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/fcntl.h created+38
...@@ -0,0 +1,38 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 040000
16#define O_LARGEFILE 0100000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27#define F_GETLK 5
28#define F_SETLK 6
29#define F_SETLKW 7
30#define F_SETOWN 8
31#define F_GETOWN 9
32#define F_SETSIG 10
33#define F_GETSIG 11
34
35#define F_SETOWN_EX 15
36#define F_GETOWN_EX 16
37
38#define F_GETOWNER_UIDS 17
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/mman.h deleted-1
...@@ -1 +0,0 @@
1#define MAP_32BIT 0x40
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/setjmp.h+1-1
...@@ -1 +1 @@...@@ -1 +1 @@
1typedef unsigned long __jmp_buf[28];
\ No newline at end of file
1typedef unsigned long __jmp_buf[26];
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/signal.h-1
...@@ -60,7 +60,6 @@ typedef struct __ucontext...@@ -60,7 +60,6 @@ typedef struct __ucontext
60 struct __ucontext *uc_link;60 struct __ucontext *uc_link;
61 stack_t uc_stack;61 stack_t uc_stack;
62 sigset_t uc_sigmask;62 sigset_t uc_sigmask;
63 char __unused[1024 / 8 - sizeof(sigset_t)];
64 mcontext_t uc_mcontext;63 mcontext_t uc_mcontext;
65} ucontext_t;64} ucontext_t;
6665
lib/libc/include/riscv64-linux-musl/bits/socket.h-14
...@@ -4,30 +4,16 @@ struct msghdr {...@@ -4,30 +4,16 @@ struct msghdr {
4 void *msg_name;4 void *msg_name;
5 socklen_t msg_namelen;5 socklen_t msg_namelen;
6 struct iovec *msg_iov;6 struct iovec *msg_iov;
7#if __BYTE_ORDER == __BIG_ENDIAN
8 int __pad1, msg_iovlen;
9#else
10 int msg_iovlen, __pad1;7 int msg_iovlen, __pad1;
11#endif
12 void *msg_control;8 void *msg_control;
13#if __BYTE_ORDER == __BIG_ENDIAN
14 int __pad2;
15 socklen_t msg_controllen;
16#else
17 socklen_t msg_controllen;9 socklen_t msg_controllen;
18 int __pad2;10 int __pad2;
19#endif
20 int msg_flags;11 int msg_flags;
21};12};
2213
23struct cmsghdr {14struct cmsghdr {
24#if __BYTE_ORDER == __BIG_ENDIAN
25 int __pad1;
26 socklen_t cmsg_len;
27#else
28 socklen_t cmsg_len;15 socklen_t cmsg_len;
29 int __pad1;16 int __pad1;
30#endif
31 int cmsg_level;17 int cmsg_level;
32 int cmsg_type;18 int cmsg_type;
33};19};
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/syscall.h deleted-555
...@@ -1,555 +0,0 @@
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_range 84
86#define __NR_timerfd_create 85
87#define __NR_timerfd_settime 86
88#define __NR_timerfd_gettime 87
89#define __NR_utimensat 88
90#define __NR_acct 89
91#define __NR_capget 90
92#define __NR_capset 91
93#define __NR_personality 92
94#define __NR_exit 93
95#define __NR_exit_group 94
96#define __NR_waitid 95
97#define __NR_set_tid_address 96
98#define __NR_unshare 97
99#define __NR_futex 98
100#define __NR_set_robust_list 99
101#define __NR_get_robust_list 100
102#define __NR_nanosleep 101
103#define __NR_getitimer 102
104#define __NR_setitimer 103
105#define __NR_kexec_load 104
106#define __NR_init_module 105
107#define __NR_delete_module 106
108#define __NR_timer_create 107
109#define __NR_timer_gettime 108
110#define __NR_timer_getoverrun 109
111#define __NR_timer_settime 110
112#define __NR_timer_delete 111
113#define __NR_clock_settime 112
114#define __NR_clock_gettime 113
115#define __NR_clock_getres 114
116#define __NR_clock_nanosleep 115
117#define __NR_syslog 116
118#define __NR_ptrace 117
119#define __NR_sched_setparam 118
120#define __NR_sched_setscheduler 119
121#define __NR_sched_getscheduler 120
122#define __NR_sched_getparam 121
123#define __NR_sched_setaffinity 122
124#define __NR_sched_getaffinity 123
125#define __NR_sched_yield 124
126#define __NR_sched_get_priority_max 125
127#define __NR_sched_get_priority_min 126
128#define __NR_sched_rr_get_interval 127
129#define __NR_restart_syscall 128
130#define __NR_kill 129
131#define __NR_tkill 130
132#define __NR_tgkill 131
133#define __NR_sigaltstack 132
134#define __NR_rt_sigsuspend 133
135#define __NR_rt_sigaction 134
136#define __NR_rt_sigprocmask 135
137#define __NR_rt_sigpending 136
138#define __NR_rt_sigtimedwait 137
139#define __NR_rt_sigqueueinfo 138
140#define __NR_rt_sigreturn 139
141#define __NR_setpriority 140
142#define __NR_getpriority 141
143#define __NR_reboot 142
144#define __NR_setregid 143
145#define __NR_setgid 144
146#define __NR_setreuid 145
147#define __NR_setuid 146
148#define __NR_setresuid 147
149#define __NR_getresuid 148
150#define __NR_setresgid 149
151#define __NR_getresgid 150
152#define __NR_setfsuid 151
153#define __NR_setfsgid 152
154#define __NR_times 153
155#define __NR_setpgid 154
156#define __NR_getpgid 155
157#define __NR_getsid 156
158#define __NR_setsid 157
159#define __NR_getgroups 158
160#define __NR_setgroups 159
161#define __NR_uname 160
162#define __NR_sethostname 161
163#define __NR_setdomainname 162
164#define __NR_getrlimit 163
165#define __NR_setrlimit 164
166#define __NR_getrusage 165
167#define __NR_umask 166
168#define __NR_prctl 167
169#define __NR_getcpu 168
170#define __NR_gettimeofday 169
171#define __NR_settimeofday 170
172#define __NR_adjtimex 171
173#define __NR_getpid 172
174#define __NR_getppid 173
175#define __NR_getuid 174
176#define __NR_geteuid 175
177#define __NR_getgid 176
178#define __NR_getegid 177
179#define __NR_gettid 178
180#define __NR_sysinfo 179
181#define __NR_mq_open 180
182#define __NR_mq_unlink 181
183#define __NR_mq_timedsend 182
184#define __NR_mq_timedreceive 183
185#define __NR_mq_notify 184
186#define __NR_mq_getsetattr 185
187#define __NR_msgget 186
188#define __NR_msgctl 187
189#define __NR_msgrcv 188
190#define __NR_msgsnd 189
191#define __NR_semget 190
192#define __NR_semctl 191
193#define __NR_semtimedop 192
194#define __NR_semop 193
195#define __NR_shmget 194
196#define __NR_shmctl 195
197#define __NR_shmat 196
198#define __NR_shmdt 197
199#define __NR_socket 198
200#define __NR_socketpair 199
201#define __NR_bind 200
202#define __NR_listen 201
203#define __NR_accept 202
204#define __NR_connect 203
205#define __NR_getsockname 204
206#define __NR_getpeername 205
207#define __NR_sendto 206
208#define __NR_recvfrom 207
209#define __NR_setsockopt 208
210#define __NR_getsockopt 209
211#define __NR_shutdown 210
212#define __NR_sendmsg 211
213#define __NR_recvmsg 212
214#define __NR_readahead 213
215#define __NR_brk 214
216#define __NR_munmap 215
217#define __NR_mremap 216
218#define __NR_add_key 217
219#define __NR_request_key 218
220#define __NR_keyctl 219
221#define __NR_clone 220
222#define __NR_execve 221
223#define __NR_mmap 222
224#define __NR_fadvise64 223
225#define __NR_swapon 224
226#define __NR_swapoff 225
227#define __NR_mprotect 226
228#define __NR_msync 227
229#define __NR_mlock 228
230#define __NR_munlock 229
231#define __NR_mlockall 230
232#define __NR_munlockall 231
233#define __NR_mincore 232
234#define __NR_madvise 233
235#define __NR_remap_file_pages 234
236#define __NR_mbind 235
237#define __NR_get_mempolicy 236
238#define __NR_set_mempolicy 237
239#define __NR_migrate_pages 238
240#define __NR_move_pages 239
241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_perf_event_open 241
243#define __NR_accept4 242
244#define __NR_recvmmsg 243
245#define __NR_arch_specific_syscall 244
246#define __NR_wait4 260
247#define __NR_prlimit64 261
248#define __NR_fanotify_init 262
249#define __NR_fanotify_mark 263
250#define __NR_name_to_handle_at 264
251#define __NR_open_by_handle_at 265
252#define __NR_clock_adjtime 266
253#define __NR_syncfs 267
254#define __NR_setns 268
255#define __NR_sendmmsg 269
256#define __NR_process_vm_readv 270
257#define __NR_process_vm_writev 271
258#define __NR_kcmp 272
259#define __NR_finit_module 273
260#define __NR_sched_setattr 274
261#define __NR_sched_getattr 275
262#define __NR_renameat2 276
263#define __NR_seccomp 277
264#define __NR_getrandom 278
265#define __NR_memfd_create 279
266#define __NR_bpf 280
267#define __NR_execveat 281
268#define __NR_userfaultfd 282
269#define __NR_membarrier 283
270#define __NR_mlock2 284
271#define __NR_copy_file_range 285
272#define __NR_preadv2 286
273#define __NR_pwritev2 287
274#define __NR_pkey_mprotect 288
275#define __NR_pkey_alloc 289
276#define __NR_pkey_free 290
277#define __NR_sysriscv __NR_arch_specific_syscall
278
279#define SYS_io_setup 0
280#define SYS_io_destroy 1
281#define SYS_io_submit 2
282#define SYS_io_cancel 3
283#define SYS_io_getevents 4
284#define SYS_setxattr 5
285#define SYS_lsetxattr 6
286#define SYS_fsetxattr 7
287#define SYS_getxattr 8
288#define SYS_lgetxattr 9
289#define SYS_fgetxattr 10
290#define SYS_listxattr 11
291#define SYS_llistxattr 12
292#define SYS_flistxattr 13
293#define SYS_removexattr 14
294#define SYS_lremovexattr 15
295#define SYS_fremovexattr 16
296#define SYS_getcwd 17
297#define SYS_lookup_dcookie 18
298#define SYS_eventfd2 19
299#define SYS_epoll_create1 20
300#define SYS_epoll_ctl 21
301#define SYS_epoll_pwait 22
302#define SYS_dup 23
303#define SYS_dup3 24
304#define SYS_fcntl 25
305#define SYS_inotify_init1 26
306#define SYS_inotify_add_watch 27
307#define SYS_inotify_rm_watch 28
308#define SYS_ioctl 29
309#define SYS_ioprio_set 30
310#define SYS_ioprio_get 31
311#define SYS_flock 32
312#define SYS_mknodat 33
313#define SYS_mkdirat 34
314#define SYS_unlinkat 35
315#define SYS_symlinkat 36
316#define SYS_linkat 37
317#define SYS_renameat 38
318#define SYS_umount2 39
319#define SYS_mount 40
320#define SYS_pivot_root 41
321#define SYS_nfsservctl 42
322#define SYS_statfs 43
323#define SYS_fstatfs 44
324#define SYS_truncate 45
325#define SYS_ftruncate 46
326#define SYS_fallocate 47
327#define SYS_faccessat 48
328#define SYS_chdir 49
329#define SYS_fchdir 50
330#define SYS_chroot 51
331#define SYS_fchmod 52
332#define SYS_fchmodat 53
333#define SYS_fchownat 54
334#define SYS_fchown 55
335#define SYS_openat 56
336#define SYS_close 57
337#define SYS_vhangup 58
338#define SYS_pipe2 59
339#define SYS_quotactl 60
340#define SYS_getdents64 61
341#define SYS_lseek 62
342#define SYS_read 63
343#define SYS_write 64
344#define SYS_readv 65
345#define SYS_writev 66
346#define SYS_pread64 67
347#define SYS_pwrite64 68
348#define SYS_preadv 69
349#define SYS_pwritev 70
350#define SYS_sendfile 71
351#define SYS_pselect6 72
352#define SYS_ppoll 73
353#define SYS_signalfd4 74
354#define SYS_vmsplice 75
355#define SYS_splice 76
356#define SYS_tee 77
357#define SYS_readlinkat 78
358#define SYS_fstatat 79
359#define SYS_fstat 80
360#define SYS_sync 81
361#define SYS_fsync 82
362#define SYS_fdatasync 83
363#define SYS_sync_file_range 84
364#define SYS_timerfd_create 85
365#define SYS_timerfd_settime 86
366#define SYS_timerfd_gettime 87
367#define SYS_utimensat 88
368#define SYS_acct 89
369#define SYS_capget 90
370#define SYS_capset 91
371#define SYS_personality 92
372#define SYS_exit 93
373#define SYS_exit_group 94
374#define SYS_waitid 95
375#define SYS_set_tid_address 96
376#define SYS_unshare 97
377#define SYS_futex 98
378#define SYS_set_robust_list 99
379#define SYS_get_robust_list 100
380#define SYS_nanosleep 101
381#define SYS_getitimer 102
382#define SYS_setitimer 103
383#define SYS_kexec_load 104
384#define SYS_init_module 105
385#define SYS_delete_module 106
386#define SYS_timer_create 107
387#define SYS_timer_gettime 108
388#define SYS_timer_getoverrun 109
389#define SYS_timer_settime 110
390#define SYS_timer_delete 111
391#define SYS_clock_settime 112
392#define SYS_clock_gettime 113
393#define SYS_clock_getres 114
394#define SYS_clock_nanosleep 115
395#define SYS_syslog 116
396#define SYS_ptrace 117
397#define SYS_sched_setparam 118
398#define SYS_sched_setscheduler 119
399#define SYS_sched_getscheduler 120
400#define SYS_sched_getparam 121
401#define SYS_sched_setaffinity 122
402#define SYS_sched_getaffinity 123
403#define SYS_sched_yield 124
404#define SYS_sched_get_priority_max 125
405#define SYS_sched_get_priority_min 126
406#define SYS_sched_rr_get_interval 127
407#define SYS_restart_syscall 128
408#define SYS_kill 129
409#define SYS_tkill 130
410#define SYS_tgkill 131
411#define SYS_sigaltstack 132
412#define SYS_rt_sigsuspend 133
413#define SYS_rt_sigaction 134
414#define SYS_rt_sigprocmask 135
415#define SYS_rt_sigpending 136
416#define SYS_rt_sigtimedwait 137
417#define SYS_rt_sigqueueinfo 138
418#define SYS_rt_sigreturn 139
419#define SYS_setpriority 140
420#define SYS_getpriority 141
421#define SYS_reboot 142
422#define SYS_setregid 143
423#define SYS_setgid 144
424#define SYS_setreuid 145
425#define SYS_setuid 146
426#define SYS_setresuid 147
427#define SYS_getresuid 148
428#define SYS_setresgid 149
429#define SYS_getresgid 150
430#define SYS_setfsuid 151
431#define SYS_setfsgid 152
432#define SYS_times 153
433#define SYS_setpgid 154
434#define SYS_getpgid 155
435#define SYS_getsid 156
436#define SYS_setsid 157
437#define SYS_getgroups 158
438#define SYS_setgroups 159
439#define SYS_uname 160
440#define SYS_sethostname 161
441#define SYS_setdomainname 162
442#define SYS_getrlimit 163
443#define SYS_setrlimit 164
444#define SYS_getrusage 165
445#define SYS_umask 166
446#define SYS_prctl 167
447#define SYS_getcpu 168
448#define SYS_gettimeofday 169
449#define SYS_settimeofday 170
450#define SYS_adjtimex 171
451#define SYS_getpid 172
452#define SYS_getppid 173
453#define SYS_getuid 174
454#define SYS_geteuid 175
455#define SYS_getgid 176
456#define SYS_getegid 177
457#define SYS_gettid 178
458#define SYS_sysinfo 179
459#define SYS_mq_open 180
460#define SYS_mq_unlink 181
461#define SYS_mq_timedsend 182
462#define SYS_mq_timedreceive 183
463#define SYS_mq_notify 184
464#define SYS_mq_getsetattr 185
465#define SYS_msgget 186
466#define SYS_msgctl 187
467#define SYS_msgrcv 188
468#define SYS_msgsnd 189
469#define SYS_semget 190
470#define SYS_semctl 191
471#define SYS_semtimedop 192
472#define SYS_semop 193
473#define SYS_shmget 194
474#define SYS_shmctl 195
475#define SYS_shmat 196
476#define SYS_shmdt 197
477#define SYS_socket 198
478#define SYS_socketpair 199
479#define SYS_bind 200
480#define SYS_listen 201
481#define SYS_accept 202
482#define SYS_connect 203
483#define SYS_getsockname 204
484#define SYS_getpeername 205
485#define SYS_sendto 206
486#define SYS_recvfrom 207
487#define SYS_setsockopt 208
488#define SYS_getsockopt 209
489#define SYS_shutdown 210
490#define SYS_sendmsg 211
491#define SYS_recvmsg 212
492#define SYS_readahead 213
493#define SYS_brk 214
494#define SYS_munmap 215
495#define SYS_mremap 216
496#define SYS_add_key 217
497#define SYS_request_key 218
498#define SYS_keyctl 219
499#define SYS_clone 220
500#define SYS_execve 221
501#define SYS_mmap 222
502#define SYS_fadvise64 223
503#define SYS_swapon 224
504#define SYS_swapoff 225
505#define SYS_mprotect 226
506#define SYS_msync 227
507#define SYS_mlock 228
508#define SYS_munlock 229
509#define SYS_mlockall 230
510#define SYS_munlockall 231
511#define SYS_mincore 232
512#define SYS_madvise 233
513#define SYS_remap_file_pages 234
514#define SYS_mbind 235
515#define SYS_get_mempolicy 236
516#define SYS_set_mempolicy 237
517#define SYS_migrate_pages 238
518#define SYS_move_pages 239
519#define SYS_rt_tgsigqueueinfo 240
520#define SYS_perf_event_open 241
521#define SYS_accept4 242
522#define SYS_recvmmsg 243
523#define SYS_arch_specific_syscall 244
524#define SYS_wait4 260
525#define SYS_prlimit64 261
526#define SYS_fanotify_init 262
527#define SYS_fanotify_mark 263
528#define SYS_name_to_handle_at 264
529#define SYS_open_by_handle_at 265
530#define SYS_clock_adjtime 266
531#define SYS_syncfs 267
532#define SYS_setns 268
533#define SYS_sendmmsg 269
534#define SYS_process_vm_readv 270
535#define SYS_process_vm_writev 271
536#define SYS_kcmp 272
537#define SYS_finit_module 273
538#define SYS_sched_setattr 274
539#define SYS_sched_getattr 275
540#define SYS_renameat2 276
541#define SYS_seccomp 277
542#define SYS_getrandom 278
543#define SYS_memfd_create 279
544#define SYS_bpf 280
545#define SYS_execveat 281
546#define SYS_userfaultfd 282
547#define SYS_membarrier 283
548#define SYS_mlock2 284
549#define SYS_copy_file_range 285
550#define SYS_preadv2 286
551#define SYS_pwritev2 287
552#define SYS_pkey_mprotect 288
553#define SYS_pkey_alloc 289
554#define SYS_pkey_free 290
555#define SYS_sysriscv __NR_arch_specific_syscall
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/elf.h deleted-3228
...@@ -1,3228 +0,0 @@
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_NUM 248
318
319#define EM_ALPHA 0x9026
320
321#define EV_NONE 0
322#define EV_CURRENT 1
323#define EV_NUM 2
324
325typedef struct {
326 Elf32_Word sh_name;
327 Elf32_Word sh_type;
328 Elf32_Word sh_flags;
329 Elf32_Addr sh_addr;
330 Elf32_Off sh_offset;
331 Elf32_Word sh_size;
332 Elf32_Word sh_link;
333 Elf32_Word sh_info;
334 Elf32_Word sh_addralign;
335 Elf32_Word sh_entsize;
336} Elf32_Shdr;
337
338typedef struct {
339 Elf64_Word sh_name;
340 Elf64_Word sh_type;
341 Elf64_Xword sh_flags;
342 Elf64_Addr sh_addr;
343 Elf64_Off sh_offset;
344 Elf64_Xword sh_size;
345 Elf64_Word sh_link;
346 Elf64_Word sh_info;
347 Elf64_Xword sh_addralign;
348 Elf64_Xword sh_entsize;
349} Elf64_Shdr;
350
351
352
353#define SHN_UNDEF 0
354#define SHN_LORESERVE 0xff00
355#define SHN_LOPROC 0xff00
356#define SHN_BEFORE 0xff00
357
358#define SHN_AFTER 0xff01
359
360#define SHN_HIPROC 0xff1f
361#define SHN_LOOS 0xff20
362#define SHN_HIOS 0xff3f
363#define SHN_ABS 0xfff1
364#define SHN_COMMON 0xfff2
365#define SHN_XINDEX 0xffff
366#define SHN_HIRESERVE 0xffff
367
368
369
370#define SHT_NULL 0
371#define SHT_PROGBITS 1
372#define SHT_SYMTAB 2
373#define SHT_STRTAB 3
374#define SHT_RELA 4
375#define SHT_HASH 5
376#define SHT_DYNAMIC 6
377#define SHT_NOTE 7
378#define SHT_NOBITS 8
379#define SHT_REL 9
380#define SHT_SHLIB 10
381#define SHT_DYNSYM 11
382#define SHT_INIT_ARRAY 14
383#define SHT_FINI_ARRAY 15
384#define SHT_PREINIT_ARRAY 16
385#define SHT_GROUP 17
386#define SHT_SYMTAB_SHNDX 18
387#define SHT_NUM 19
388#define SHT_LOOS 0x60000000
389#define SHT_GNU_ATTRIBUTES 0x6ffffff5
390#define SHT_GNU_HASH 0x6ffffff6
391#define SHT_GNU_LIBLIST 0x6ffffff7
392#define SHT_CHECKSUM 0x6ffffff8
393#define SHT_LOSUNW 0x6ffffffa
394#define SHT_SUNW_move 0x6ffffffa
395#define SHT_SUNW_COMDAT 0x6ffffffb
396#define SHT_SUNW_syminfo 0x6ffffffc
397#define SHT_GNU_verdef 0x6ffffffd
398#define SHT_GNU_verneed 0x6ffffffe
399#define SHT_GNU_versym 0x6fffffff
400#define SHT_HISUNW 0x6fffffff
401#define SHT_HIOS 0x6fffffff
402#define SHT_LOPROC 0x70000000
403#define SHT_HIPROC 0x7fffffff
404#define SHT_LOUSER 0x80000000
405#define SHT_HIUSER 0x8fffffff
406
407#define SHF_WRITE (1 << 0)
408#define SHF_ALLOC (1 << 1)
409#define SHF_EXECINSTR (1 << 2)
410#define SHF_MERGE (1 << 4)
411#define SHF_STRINGS (1 << 5)
412#define SHF_INFO_LINK (1 << 6)
413#define SHF_LINK_ORDER (1 << 7)
414#define SHF_OS_NONCONFORMING (1 << 8)
415
416#define SHF_GROUP (1 << 9)
417#define SHF_TLS (1 << 10)
418#define SHF_COMPRESSED (1 << 11)
419#define SHF_MASKOS 0x0ff00000
420#define SHF_MASKPROC 0xf0000000
421#define SHF_ORDERED (1 << 30)
422#define SHF_EXCLUDE (1U << 31)
423
424typedef struct {
425 Elf32_Word ch_type;
426 Elf32_Word ch_size;
427 Elf32_Word ch_addralign;
428} Elf32_Chdr;
429
430typedef struct {
431 Elf64_Word ch_type;
432 Elf64_Word ch_reserved;
433 Elf64_Xword ch_size;
434 Elf64_Xword ch_addralign;
435} Elf64_Chdr;
436
437#define ELFCOMPRESS_ZLIB 1
438#define ELFCOMPRESS_LOOS 0x60000000
439#define ELFCOMPRESS_HIOS 0x6fffffff
440#define ELFCOMPRESS_LOPROC 0x70000000
441#define ELFCOMPRESS_HIPROC 0x7fffffff
442
443
444#define GRP_COMDAT 0x1
445
446typedef struct {
447 Elf32_Word st_name;
448 Elf32_Addr st_value;
449 Elf32_Word st_size;
450 unsigned char st_info;
451 unsigned char st_other;
452 Elf32_Section st_shndx;
453} Elf32_Sym;
454
455typedef struct {
456 Elf64_Word st_name;
457 unsigned char st_info;
458 unsigned char st_other;
459 Elf64_Section st_shndx;
460 Elf64_Addr st_value;
461 Elf64_Xword st_size;
462} Elf64_Sym;
463
464typedef struct {
465 Elf32_Half si_boundto;
466 Elf32_Half si_flags;
467} Elf32_Syminfo;
468
469typedef struct {
470 Elf64_Half si_boundto;
471 Elf64_Half si_flags;
472} Elf64_Syminfo;
473
474#define SYMINFO_BT_SELF 0xffff
475#define SYMINFO_BT_PARENT 0xfffe
476#define SYMINFO_BT_LOWRESERVE 0xff00
477
478#define SYMINFO_FLG_DIRECT 0x0001
479#define SYMINFO_FLG_PASSTHRU 0x0002
480#define SYMINFO_FLG_COPY 0x0004
481#define SYMINFO_FLG_LAZYLOAD 0x0008
482
483#define SYMINFO_NONE 0
484#define SYMINFO_CURRENT 1
485#define SYMINFO_NUM 2
486
487#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
488#define ELF32_ST_TYPE(val) ((val) & 0xf)
489#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
490
491#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
492#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
493#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
494
495#define STB_LOCAL 0
496#define STB_GLOBAL 1
497#define STB_WEAK 2
498#define STB_NUM 3
499#define STB_LOOS 10
500#define STB_GNU_UNIQUE 10
501#define STB_HIOS 12
502#define STB_LOPROC 13
503#define STB_HIPROC 15
504
505#define STT_NOTYPE 0
506#define STT_OBJECT 1
507#define STT_FUNC 2
508#define STT_SECTION 3
509#define STT_FILE 4
510#define STT_COMMON 5
511#define STT_TLS 6
512#define STT_NUM 7
513#define STT_LOOS 10
514#define STT_GNU_IFUNC 10
515#define STT_HIOS 12
516#define STT_LOPROC 13
517#define STT_HIPROC 15
518
519#define STN_UNDEF 0
520
521#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
522#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
523
524#define STV_DEFAULT 0
525#define STV_INTERNAL 1
526#define STV_HIDDEN 2
527#define STV_PROTECTED 3
528
529
530
531
532typedef struct {
533 Elf32_Addr r_offset;
534 Elf32_Word r_info;
535} Elf32_Rel;
536
537typedef struct {
538 Elf64_Addr r_offset;
539 Elf64_Xword r_info;
540} Elf64_Rel;
541
542
543
544typedef struct {
545 Elf32_Addr r_offset;
546 Elf32_Word r_info;
547 Elf32_Sword r_addend;
548} Elf32_Rela;
549
550typedef struct {
551 Elf64_Addr r_offset;
552 Elf64_Xword r_info;
553 Elf64_Sxword r_addend;
554} Elf64_Rela;
555
556
557
558#define ELF32_R_SYM(val) ((val) >> 8)
559#define ELF32_R_TYPE(val) ((val) & 0xff)
560#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
561
562#define ELF64_R_SYM(i) ((i) >> 32)
563#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
564#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
565
566
567
568typedef struct {
569 Elf32_Word p_type;
570 Elf32_Off p_offset;
571 Elf32_Addr p_vaddr;
572 Elf32_Addr p_paddr;
573 Elf32_Word p_filesz;
574 Elf32_Word p_memsz;
575 Elf32_Word p_flags;
576 Elf32_Word p_align;
577} Elf32_Phdr;
578
579typedef struct {
580 Elf64_Word p_type;
581 Elf64_Word p_flags;
582 Elf64_Off p_offset;
583 Elf64_Addr p_vaddr;
584 Elf64_Addr p_paddr;
585 Elf64_Xword p_filesz;
586 Elf64_Xword p_memsz;
587 Elf64_Xword p_align;
588} Elf64_Phdr;
589
590
591
592#define PT_NULL 0
593#define PT_LOAD 1
594#define PT_DYNAMIC 2
595#define PT_INTERP 3
596#define PT_NOTE 4
597#define PT_SHLIB 5
598#define PT_PHDR 6
599#define PT_TLS 7
600#define PT_NUM 8
601#define PT_LOOS 0x60000000
602#define PT_GNU_EH_FRAME 0x6474e550
603#define PT_GNU_STACK 0x6474e551
604#define PT_GNU_RELRO 0x6474e552
605#define PT_LOSUNW 0x6ffffffa
606#define PT_SUNWBSS 0x6ffffffa
607#define PT_SUNWSTACK 0x6ffffffb
608#define PT_HISUNW 0x6fffffff
609#define PT_HIOS 0x6fffffff
610#define PT_LOPROC 0x70000000
611#define PT_HIPROC 0x7fffffff
612
613
614#define PN_XNUM 0xffff
615
616
617#define PF_X (1 << 0)
618#define PF_W (1 << 1)
619#define PF_R (1 << 2)
620#define PF_MASKOS 0x0ff00000
621#define PF_MASKPROC 0xf0000000
622
623
624
625#define NT_PRSTATUS 1
626#define NT_PRFPREG 2
627#define NT_FPREGSET 2
628#define NT_PRPSINFO 3
629#define NT_PRXREG 4
630#define NT_TASKSTRUCT 4
631#define NT_PLATFORM 5
632#define NT_AUXV 6
633#define NT_GWINDOWS 7
634#define NT_ASRS 8
635#define NT_PSTATUS 10
636#define NT_PSINFO 13
637#define NT_PRCRED 14
638#define NT_UTSNAME 15
639#define NT_LWPSTATUS 16
640#define NT_LWPSINFO 17
641#define NT_PRFPXREG 20
642#define NT_SIGINFO 0x53494749
643#define NT_FILE 0x46494c45
644#define NT_PRXFPREG 0x46e62b7f
645#define NT_PPC_VMX 0x100
646#define NT_PPC_SPE 0x101
647#define NT_PPC_VSX 0x102
648#define NT_PPC_TAR 0x103
649#define NT_PPC_PPR 0x104
650#define NT_PPC_DSCR 0x105
651#define NT_PPC_EBB 0x106
652#define NT_PPC_PMU 0x107
653#define NT_PPC_TM_CGPR 0x108
654#define NT_PPC_TM_CFPR 0x109
655#define NT_PPC_TM_CVMX 0x10a
656#define NT_PPC_TM_CVSX 0x10b
657#define NT_PPC_TM_SPR 0x10c
658#define NT_PPC_TM_CTAR 0x10d
659#define NT_PPC_TM_CPPR 0x10e
660#define NT_PPC_TM_CDSCR 0x10f
661#define NT_386_TLS 0x200
662#define NT_386_IOPERM 0x201
663#define NT_X86_XSTATE 0x202
664#define NT_S390_HIGH_GPRS 0x300
665#define NT_S390_TIMER 0x301
666#define NT_S390_TODCMP 0x302
667#define NT_S390_TODPREG 0x303
668#define NT_S390_CTRS 0x304
669#define NT_S390_PREFIX 0x305
670#define NT_S390_LAST_BREAK 0x306
671#define NT_S390_SYSTEM_CALL 0x307
672#define NT_S390_TDB 0x308
673#define NT_S390_VXRS_LOW 0x309
674#define NT_S390_VXRS_HIGH 0x30a
675#define NT_S390_GS_CB 0x30b
676#define NT_S390_GS_BC 0x30c
677#define NT_S390_RI_CB 0x30d
678#define NT_ARM_VFP 0x400
679#define NT_ARM_TLS 0x401
680#define NT_ARM_HW_BREAK 0x402
681#define NT_ARM_HW_WATCH 0x403
682#define NT_ARM_SYSTEM_CALL 0x404
683#define NT_ARM_SVE 0x405
684#define NT_METAG_CBUF 0x500
685#define NT_METAG_RPIPE 0x501
686#define NT_METAG_TLS 0x502
687#define NT_ARC_V2 0x600
688#define NT_VERSION 1
689
690
691
692
693typedef struct {
694 Elf32_Sword d_tag;
695 union {
696 Elf32_Word d_val;
697 Elf32_Addr d_ptr;
698 } d_un;
699} Elf32_Dyn;
700
701typedef struct {
702 Elf64_Sxword d_tag;
703 union {
704 Elf64_Xword d_val;
705 Elf64_Addr d_ptr;
706 } d_un;
707} Elf64_Dyn;
708
709
710
711#define DT_NULL 0
712#define DT_NEEDED 1
713#define DT_PLTRELSZ 2
714#define DT_PLTGOT 3
715#define DT_HASH 4
716#define DT_STRTAB 5
717#define DT_SYMTAB 6
718#define DT_RELA 7
719#define DT_RELASZ 8
720#define DT_RELAENT 9
721#define DT_STRSZ 10
722#define DT_SYMENT 11
723#define DT_INIT 12
724#define DT_FINI 13
725#define DT_SONAME 14
726#define DT_RPATH 15
727#define DT_SYMBOLIC 16
728#define DT_REL 17
729#define DT_RELSZ 18
730#define DT_RELENT 19
731#define DT_PLTREL 20
732#define DT_DEBUG 21
733#define DT_TEXTREL 22
734#define DT_JMPREL 23
735#define DT_BIND_NOW 24
736#define DT_INIT_ARRAY 25
737#define DT_FINI_ARRAY 26
738#define DT_INIT_ARRAYSZ 27
739#define DT_FINI_ARRAYSZ 28
740#define DT_RUNPATH 29
741#define DT_FLAGS 30
742#define DT_ENCODING 32
743#define DT_PREINIT_ARRAY 32
744#define DT_PREINIT_ARRAYSZ 33
745#define DT_SYMTAB_SHNDX 34
746#define DT_NUM 35
747#define DT_LOOS 0x6000000d
748#define DT_HIOS 0x6ffff000
749#define DT_LOPROC 0x70000000
750#define DT_HIPROC 0x7fffffff
751#define DT_PROCNUM DT_MIPS_NUM
752
753#define DT_VALRNGLO 0x6ffffd00
754#define DT_GNU_PRELINKED 0x6ffffdf5
755#define DT_GNU_CONFLICTSZ 0x6ffffdf6
756#define DT_GNU_LIBLISTSZ 0x6ffffdf7
757#define DT_CHECKSUM 0x6ffffdf8
758#define DT_PLTPADSZ 0x6ffffdf9
759#define DT_MOVEENT 0x6ffffdfa
760#define DT_MOVESZ 0x6ffffdfb
761#define DT_FEATURE_1 0x6ffffdfc
762#define DT_POSFLAG_1 0x6ffffdfd
763
764#define DT_SYMINSZ 0x6ffffdfe
765#define DT_SYMINENT 0x6ffffdff
766#define DT_VALRNGHI 0x6ffffdff
767#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
768#define DT_VALNUM 12
769
770#define DT_ADDRRNGLO 0x6ffffe00
771#define DT_GNU_HASH 0x6ffffef5
772#define DT_TLSDESC_PLT 0x6ffffef6
773#define DT_TLSDESC_GOT 0x6ffffef7
774#define DT_GNU_CONFLICT 0x6ffffef8
775#define DT_GNU_LIBLIST 0x6ffffef9
776#define DT_CONFIG 0x6ffffefa
777#define DT_DEPAUDIT 0x6ffffefb
778#define DT_AUDIT 0x6ffffefc
779#define DT_PLTPAD 0x6ffffefd
780#define DT_MOVETAB 0x6ffffefe
781#define DT_SYMINFO 0x6ffffeff
782#define DT_ADDRRNGHI 0x6ffffeff
783#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
784#define DT_ADDRNUM 11
785
786
787
788#define DT_VERSYM 0x6ffffff0
789
790#define DT_RELACOUNT 0x6ffffff9
791#define DT_RELCOUNT 0x6ffffffa
792
793
794#define DT_FLAGS_1 0x6ffffffb
795#define DT_VERDEF 0x6ffffffc
796
797#define DT_VERDEFNUM 0x6ffffffd
798#define DT_VERNEED 0x6ffffffe
799
800#define DT_VERNEEDNUM 0x6fffffff
801#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
802#define DT_VERSIONTAGNUM 16
803
804
805
806#define DT_AUXILIARY 0x7ffffffd
807#define DT_FILTER 0x7fffffff
808#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
809#define DT_EXTRANUM 3
810
811
812#define DF_ORIGIN 0x00000001
813#define DF_SYMBOLIC 0x00000002
814#define DF_TEXTREL 0x00000004
815#define DF_BIND_NOW 0x00000008
816#define DF_STATIC_TLS 0x00000010
817
818
819
820#define DF_1_NOW 0x00000001
821#define DF_1_GLOBAL 0x00000002
822#define DF_1_GROUP 0x00000004
823#define DF_1_NODELETE 0x00000008
824#define DF_1_LOADFLTR 0x00000010
825#define DF_1_INITFIRST 0x00000020
826#define DF_1_NOOPEN 0x00000040
827#define DF_1_ORIGIN 0x00000080
828#define DF_1_DIRECT 0x00000100
829#define DF_1_TRANS 0x00000200
830#define DF_1_INTERPOSE 0x00000400
831#define DF_1_NODEFLIB 0x00000800
832#define DF_1_NODUMP 0x00001000
833#define DF_1_CONFALT 0x00002000
834#define DF_1_ENDFILTEE 0x00004000
835#define DF_1_DISPRELDNE 0x00008000
836#define DF_1_DISPRELPND 0x00010000
837#define DF_1_NODIRECT 0x00020000
838#define DF_1_IGNMULDEF 0x00040000
839#define DF_1_NOKSYMS 0x00080000
840#define DF_1_NOHDR 0x00100000
841#define DF_1_EDITED 0x00200000
842#define DF_1_NORELOC 0x00400000
843#define DF_1_SYMINTPOSE 0x00800000
844#define DF_1_GLOBAUDIT 0x01000000
845#define DF_1_SINGLETON 0x02000000
846#define DF_1_STUB 0x04000000
847#define DF_1_PIE 0x08000000
848
849#define DTF_1_PARINIT 0x00000001
850#define DTF_1_CONFEXP 0x00000002
851
852
853#define DF_P1_LAZYLOAD 0x00000001
854#define DF_P1_GROUPPERM 0x00000002
855
856
857
858
859typedef struct {
860 Elf32_Half vd_version;
861 Elf32_Half vd_flags;
862 Elf32_Half vd_ndx;
863 Elf32_Half vd_cnt;
864 Elf32_Word vd_hash;
865 Elf32_Word vd_aux;
866 Elf32_Word vd_next;
867} Elf32_Verdef;
868
869typedef struct {
870 Elf64_Half vd_version;
871 Elf64_Half vd_flags;
872 Elf64_Half vd_ndx;
873 Elf64_Half vd_cnt;
874 Elf64_Word vd_hash;
875 Elf64_Word vd_aux;
876 Elf64_Word vd_next;
877} Elf64_Verdef;
878
879
880
881#define VER_DEF_NONE 0
882#define VER_DEF_CURRENT 1
883#define VER_DEF_NUM 2
884
885
886#define VER_FLG_BASE 0x1
887#define VER_FLG_WEAK 0x2
888
889
890#define VER_NDX_LOCAL 0
891#define VER_NDX_GLOBAL 1
892#define VER_NDX_LORESERVE 0xff00
893#define VER_NDX_ELIMINATE 0xff01
894
895
896
897typedef struct {
898 Elf32_Word vda_name;
899 Elf32_Word vda_next;
900} Elf32_Verdaux;
901
902typedef struct {
903 Elf64_Word vda_name;
904 Elf64_Word vda_next;
905} Elf64_Verdaux;
906
907
908
909
910typedef struct {
911 Elf32_Half vn_version;
912 Elf32_Half vn_cnt;
913 Elf32_Word vn_file;
914 Elf32_Word vn_aux;
915 Elf32_Word vn_next;
916} Elf32_Verneed;
917
918typedef struct {
919 Elf64_Half vn_version;
920 Elf64_Half vn_cnt;
921 Elf64_Word vn_file;
922 Elf64_Word vn_aux;
923 Elf64_Word vn_next;
924} Elf64_Verneed;
925
926
927
928#define VER_NEED_NONE 0
929#define VER_NEED_CURRENT 1
930#define VER_NEED_NUM 2
931
932
933
934typedef struct {
935 Elf32_Word vna_hash;
936 Elf32_Half vna_flags;
937 Elf32_Half vna_other;
938 Elf32_Word vna_name;
939 Elf32_Word vna_next;
940} Elf32_Vernaux;
941
942typedef struct {
943 Elf64_Word vna_hash;
944 Elf64_Half vna_flags;
945 Elf64_Half vna_other;
946 Elf64_Word vna_name;
947 Elf64_Word vna_next;
948} Elf64_Vernaux;
949
950
951
952#define VER_FLG_WEAK 0x2
953
954
955
956typedef struct {
957 uint32_t a_type;
958 union {
959 uint32_t a_val;
960 } a_un;
961} Elf32_auxv_t;
962
963typedef struct {
964 uint64_t a_type;
965 union {
966 uint64_t a_val;
967 } a_un;
968} Elf64_auxv_t;
969
970
971
972#define AT_NULL 0
973#define AT_IGNORE 1
974#define AT_EXECFD 2
975#define AT_PHDR 3
976#define AT_PHENT 4
977#define AT_PHNUM 5
978#define AT_PAGESZ 6
979#define AT_BASE 7
980#define AT_FLAGS 8
981#define AT_ENTRY 9
982#define AT_NOTELF 10
983#define AT_UID 11
984#define AT_EUID 12
985#define AT_GID 13
986#define AT_EGID 14
987#define AT_CLKTCK 17
988
989
990#define AT_PLATFORM 15
991#define AT_HWCAP 16
992
993
994
995
996#define AT_FPUCW 18
997
998
999#define AT_DCACHEBSIZE 19
1000#define AT_ICACHEBSIZE 20
1001#define AT_UCACHEBSIZE 21
1002
1003
1004
1005#define AT_IGNOREPPC 22
1006
1007#define AT_SECURE 23
1008
1009#define AT_BASE_PLATFORM 24
1010
1011#define AT_RANDOM 25
1012
1013#define AT_HWCAP2 26
1014
1015#define AT_EXECFN 31
1016
1017
1018
1019#define AT_SYSINFO 32
1020#define AT_SYSINFO_EHDR 33
1021
1022
1023
1024#define AT_L1I_CACHESHAPE 34
1025#define AT_L1D_CACHESHAPE 35
1026#define AT_L2_CACHESHAPE 36
1027#define AT_L3_CACHESHAPE 37
1028
1029#define AT_L1I_CACHESIZE 40
1030#define AT_L1I_CACHEGEOMETRY 41
1031#define AT_L1D_CACHESIZE 42
1032#define AT_L1D_CACHEGEOMETRY 43
1033#define AT_L2_CACHESIZE 44
1034#define AT_L2_CACHEGEOMETRY 45
1035#define AT_L3_CACHESIZE 46
1036#define AT_L3_CACHEGEOMETRY 47
1037
1038
1039
1040typedef struct {
1041 Elf32_Word n_namesz;
1042 Elf32_Word n_descsz;
1043 Elf32_Word n_type;
1044} Elf32_Nhdr;
1045
1046typedef struct {
1047 Elf64_Word n_namesz;
1048 Elf64_Word n_descsz;
1049 Elf64_Word n_type;
1050} Elf64_Nhdr;
1051
1052
1053
1054
1055#define ELF_NOTE_SOLARIS "SUNW Solaris"
1056
1057
1058#define ELF_NOTE_GNU "GNU"
1059
1060
1061
1062
1063
1064#define ELF_NOTE_PAGESIZE_HINT 1
1065
1066
1067#define NT_GNU_ABI_TAG 1
1068#define ELF_NOTE_ABI NT_GNU_ABI_TAG
1069
1070
1071
1072#define ELF_NOTE_OS_LINUX 0
1073#define ELF_NOTE_OS_GNU 1
1074#define ELF_NOTE_OS_SOLARIS2 2
1075#define ELF_NOTE_OS_FREEBSD 3
1076
1077#define NT_GNU_BUILD_ID 3
1078#define NT_GNU_GOLD_VERSION 4
1079
1080
1081
1082typedef struct {
1083 Elf32_Xword m_value;
1084 Elf32_Word m_info;
1085 Elf32_Word m_poffset;
1086 Elf32_Half m_repeat;
1087 Elf32_Half m_stride;
1088} Elf32_Move;
1089
1090typedef struct {
1091 Elf64_Xword m_value;
1092 Elf64_Xword m_info;
1093 Elf64_Xword m_poffset;
1094 Elf64_Half m_repeat;
1095 Elf64_Half m_stride;
1096} Elf64_Move;
1097
1098
1099#define ELF32_M_SYM(info) ((info) >> 8)
1100#define ELF32_M_SIZE(info) ((unsigned char) (info))
1101#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
1102
1103#define ELF64_M_SYM(info) ELF32_M_SYM (info)
1104#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
1105#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
1106
1107#define EF_CPU32 0x00810000
1108
1109#define R_68K_NONE 0
1110#define R_68K_32 1
1111#define R_68K_16 2
1112#define R_68K_8 3
1113#define R_68K_PC32 4
1114#define R_68K_PC16 5
1115#define R_68K_PC8 6
1116#define R_68K_GOT32 7
1117#define R_68K_GOT16 8
1118#define R_68K_GOT8 9
1119#define R_68K_GOT32O 10
1120#define R_68K_GOT16O 11
1121#define R_68K_GOT8O 12
1122#define R_68K_PLT32 13
1123#define R_68K_PLT16 14
1124#define R_68K_PLT8 15
1125#define R_68K_PLT32O 16
1126#define R_68K_PLT16O 17
1127#define R_68K_PLT8O 18
1128#define R_68K_COPY 19
1129#define R_68K_GLOB_DAT 20
1130#define R_68K_JMP_SLOT 21
1131#define R_68K_RELATIVE 22
1132#define R_68K_TLS_GD32 25
1133#define R_68K_TLS_GD16 26
1134#define R_68K_TLS_GD8 27
1135#define R_68K_TLS_LDM32 28
1136#define R_68K_TLS_LDM16 29
1137#define R_68K_TLS_LDM8 30
1138#define R_68K_TLS_LDO32 31
1139#define R_68K_TLS_LDO16 32
1140#define R_68K_TLS_LDO8 33
1141#define R_68K_TLS_IE32 34
1142#define R_68K_TLS_IE16 35
1143#define R_68K_TLS_IE8 36
1144#define R_68K_TLS_LE32 37
1145#define R_68K_TLS_LE16 38
1146#define R_68K_TLS_LE8 39
1147#define R_68K_TLS_DTPMOD32 40
1148#define R_68K_TLS_DTPREL32 41
1149#define R_68K_TLS_TPREL32 42
1150#define R_68K_NUM 43
1151
1152#define R_386_NONE 0
1153#define R_386_32 1
1154#define R_386_PC32 2
1155#define R_386_GOT32 3
1156#define R_386_PLT32 4
1157#define R_386_COPY 5
1158#define R_386_GLOB_DAT 6
1159#define R_386_JMP_SLOT 7
1160#define R_386_RELATIVE 8
1161#define R_386_GOTOFF 9
1162#define R_386_GOTPC 10
1163#define R_386_32PLT 11
1164#define R_386_TLS_TPOFF 14
1165#define R_386_TLS_IE 15
1166#define R_386_TLS_GOTIE 16
1167#define R_386_TLS_LE 17
1168#define R_386_TLS_GD 18
1169#define R_386_TLS_LDM 19
1170#define R_386_16 20
1171#define R_386_PC16 21
1172#define R_386_8 22
1173#define R_386_PC8 23
1174#define R_386_TLS_GD_32 24
1175#define R_386_TLS_GD_PUSH 25
1176#define R_386_TLS_GD_CALL 26
1177#define R_386_TLS_GD_POP 27
1178#define R_386_TLS_LDM_32 28
1179#define R_386_TLS_LDM_PUSH 29
1180#define R_386_TLS_LDM_CALL 30
1181#define R_386_TLS_LDM_POP 31
1182#define R_386_TLS_LDO_32 32
1183#define R_386_TLS_IE_32 33
1184#define R_386_TLS_LE_32 34
1185#define R_386_TLS_DTPMOD32 35
1186#define R_386_TLS_DTPOFF32 36
1187#define R_386_TLS_TPOFF32 37
1188#define R_386_SIZE32 38
1189#define R_386_TLS_GOTDESC 39
1190#define R_386_TLS_DESC_CALL 40
1191#define R_386_TLS_DESC 41
1192#define R_386_IRELATIVE 42
1193#define R_386_GOT32X 43
1194#define R_386_NUM 44
1195
1196
1197
1198
1199
1200#define STT_SPARC_REGISTER 13
1201
1202
1203
1204#define EF_SPARCV9_MM 3
1205#define EF_SPARCV9_TSO 0
1206#define EF_SPARCV9_PSO 1
1207#define EF_SPARCV9_RMO 2
1208#define EF_SPARC_LEDATA 0x800000
1209#define EF_SPARC_EXT_MASK 0xFFFF00
1210#define EF_SPARC_32PLUS 0x000100
1211#define EF_SPARC_SUN_US1 0x000200
1212#define EF_SPARC_HAL_R1 0x000400
1213#define EF_SPARC_SUN_US3 0x000800
1214
1215
1216
1217#define R_SPARC_NONE 0
1218#define R_SPARC_8 1
1219#define R_SPARC_16 2
1220#define R_SPARC_32 3
1221#define R_SPARC_DISP8 4
1222#define R_SPARC_DISP16 5
1223#define R_SPARC_DISP32 6
1224#define R_SPARC_WDISP30 7
1225#define R_SPARC_WDISP22 8
1226#define R_SPARC_HI22 9
1227#define R_SPARC_22 10
1228#define R_SPARC_13 11
1229#define R_SPARC_LO10 12
1230#define R_SPARC_GOT10 13
1231#define R_SPARC_GOT13 14
1232#define R_SPARC_GOT22 15
1233#define R_SPARC_PC10 16
1234#define R_SPARC_PC22 17
1235#define R_SPARC_WPLT30 18
1236#define R_SPARC_COPY 19
1237#define R_SPARC_GLOB_DAT 20
1238#define R_SPARC_JMP_SLOT 21
1239#define R_SPARC_RELATIVE 22
1240#define R_SPARC_UA32 23
1241
1242
1243
1244#define R_SPARC_PLT32 24
1245#define R_SPARC_HIPLT22 25
1246#define R_SPARC_LOPLT10 26
1247#define R_SPARC_PCPLT32 27
1248#define R_SPARC_PCPLT22 28
1249#define R_SPARC_PCPLT10 29
1250#define R_SPARC_10 30
1251#define R_SPARC_11 31
1252#define R_SPARC_64 32
1253#define R_SPARC_OLO10 33
1254#define R_SPARC_HH22 34
1255#define R_SPARC_HM10 35
1256#define R_SPARC_LM22 36
1257#define R_SPARC_PC_HH22 37
1258#define R_SPARC_PC_HM10 38
1259#define R_SPARC_PC_LM22 39
1260#define R_SPARC_WDISP16 40
1261#define R_SPARC_WDISP19 41
1262#define R_SPARC_GLOB_JMP 42
1263#define R_SPARC_7 43
1264#define R_SPARC_5 44
1265#define R_SPARC_6 45
1266#define R_SPARC_DISP64 46
1267#define R_SPARC_PLT64 47
1268#define R_SPARC_HIX22 48
1269#define R_SPARC_LOX10 49
1270#define R_SPARC_H44 50
1271#define R_SPARC_M44 51
1272#define R_SPARC_L44 52
1273#define R_SPARC_REGISTER 53
1274#define R_SPARC_UA64 54
1275#define R_SPARC_UA16 55
1276#define R_SPARC_TLS_GD_HI22 56
1277#define R_SPARC_TLS_GD_LO10 57
1278#define R_SPARC_TLS_GD_ADD 58
1279#define R_SPARC_TLS_GD_CALL 59
1280#define R_SPARC_TLS_LDM_HI22 60
1281#define R_SPARC_TLS_LDM_LO10 61
1282#define R_SPARC_TLS_LDM_ADD 62
1283#define R_SPARC_TLS_LDM_CALL 63
1284#define R_SPARC_TLS_LDO_HIX22 64
1285#define R_SPARC_TLS_LDO_LOX10 65
1286#define R_SPARC_TLS_LDO_ADD 66
1287#define R_SPARC_TLS_IE_HI22 67
1288#define R_SPARC_TLS_IE_LO10 68
1289#define R_SPARC_TLS_IE_LD 69
1290#define R_SPARC_TLS_IE_LDX 70
1291#define R_SPARC_TLS_IE_ADD 71
1292#define R_SPARC_TLS_LE_HIX22 72
1293#define R_SPARC_TLS_LE_LOX10 73
1294#define R_SPARC_TLS_DTPMOD32 74
1295#define R_SPARC_TLS_DTPMOD64 75
1296#define R_SPARC_TLS_DTPOFF32 76
1297#define R_SPARC_TLS_DTPOFF64 77
1298#define R_SPARC_TLS_TPOFF32 78
1299#define R_SPARC_TLS_TPOFF64 79
1300#define R_SPARC_GOTDATA_HIX22 80
1301#define R_SPARC_GOTDATA_LOX10 81
1302#define R_SPARC_GOTDATA_OP_HIX22 82
1303#define R_SPARC_GOTDATA_OP_LOX10 83
1304#define R_SPARC_GOTDATA_OP 84
1305#define R_SPARC_H34 85
1306#define R_SPARC_SIZE32 86
1307#define R_SPARC_SIZE64 87
1308#define R_SPARC_GNU_VTINHERIT 250
1309#define R_SPARC_GNU_VTENTRY 251
1310#define R_SPARC_REV32 252
1311
1312#define R_SPARC_NUM 253
1313
1314
1315
1316#define DT_SPARC_REGISTER 0x70000001
1317#define DT_SPARC_NUM 2
1318
1319
1320#define EF_MIPS_NOREORDER 1
1321#define EF_MIPS_PIC 2
1322#define EF_MIPS_CPIC 4
1323#define EF_MIPS_XGOT 8
1324#define EF_MIPS_64BIT_WHIRL 16
1325#define EF_MIPS_ABI2 32
1326#define EF_MIPS_ABI_ON32 64
1327#define EF_MIPS_FP64 512
1328#define EF_MIPS_NAN2008 1024
1329#define EF_MIPS_ARCH 0xf0000000
1330
1331
1332
1333#define EF_MIPS_ARCH_1 0x00000000
1334#define EF_MIPS_ARCH_2 0x10000000
1335#define EF_MIPS_ARCH_3 0x20000000
1336#define EF_MIPS_ARCH_4 0x30000000
1337#define EF_MIPS_ARCH_5 0x40000000
1338#define EF_MIPS_ARCH_32 0x50000000
1339#define EF_MIPS_ARCH_64 0x60000000
1340#define EF_MIPS_ARCH_32R2 0x70000000
1341#define EF_MIPS_ARCH_64R2 0x80000000
1342
1343
1344#define E_MIPS_ARCH_1 0x00000000
1345#define E_MIPS_ARCH_2 0x10000000
1346#define E_MIPS_ARCH_3 0x20000000
1347#define E_MIPS_ARCH_4 0x30000000
1348#define E_MIPS_ARCH_5 0x40000000
1349#define E_MIPS_ARCH_32 0x50000000
1350#define E_MIPS_ARCH_64 0x60000000
1351
1352
1353
1354#define SHN_MIPS_ACOMMON 0xff00
1355#define SHN_MIPS_TEXT 0xff01
1356#define SHN_MIPS_DATA 0xff02
1357#define SHN_MIPS_SCOMMON 0xff03
1358#define SHN_MIPS_SUNDEFINED 0xff04
1359
1360
1361
1362#define SHT_MIPS_LIBLIST 0x70000000
1363#define SHT_MIPS_MSYM 0x70000001
1364#define SHT_MIPS_CONFLICT 0x70000002
1365#define SHT_MIPS_GPTAB 0x70000003
1366#define SHT_MIPS_UCODE 0x70000004
1367#define SHT_MIPS_DEBUG 0x70000005
1368#define SHT_MIPS_REGINFO 0x70000006
1369#define SHT_MIPS_PACKAGE 0x70000007
1370#define SHT_MIPS_PACKSYM 0x70000008
1371#define SHT_MIPS_RELD 0x70000009
1372#define SHT_MIPS_IFACE 0x7000000b
1373#define SHT_MIPS_CONTENT 0x7000000c
1374#define SHT_MIPS_OPTIONS 0x7000000d
1375#define SHT_MIPS_SHDR 0x70000010
1376#define SHT_MIPS_FDESC 0x70000011
1377#define SHT_MIPS_EXTSYM 0x70000012
1378#define SHT_MIPS_DENSE 0x70000013
1379#define SHT_MIPS_PDESC 0x70000014
1380#define SHT_MIPS_LOCSYM 0x70000015
1381#define SHT_MIPS_AUXSYM 0x70000016
1382#define SHT_MIPS_OPTSYM 0x70000017
1383#define SHT_MIPS_LOCSTR 0x70000018
1384#define SHT_MIPS_LINE 0x70000019
1385#define SHT_MIPS_RFDESC 0x7000001a
1386#define SHT_MIPS_DELTASYM 0x7000001b
1387#define SHT_MIPS_DELTAINST 0x7000001c
1388#define SHT_MIPS_DELTACLASS 0x7000001d
1389#define SHT_MIPS_DWARF 0x7000001e
1390#define SHT_MIPS_DELTADECL 0x7000001f
1391#define SHT_MIPS_SYMBOL_LIB 0x70000020
1392#define SHT_MIPS_EVENTS 0x70000021
1393#define SHT_MIPS_TRANSLATE 0x70000022
1394#define SHT_MIPS_PIXIE 0x70000023
1395#define SHT_MIPS_XLATE 0x70000024
1396#define SHT_MIPS_XLATE_DEBUG 0x70000025
1397#define SHT_MIPS_WHIRL 0x70000026
1398#define SHT_MIPS_EH_REGION 0x70000027
1399#define SHT_MIPS_XLATE_OLD 0x70000028
1400#define SHT_MIPS_PDR_EXCEPTION 0x70000029
1401
1402
1403
1404#define SHF_MIPS_GPREL 0x10000000
1405#define SHF_MIPS_MERGE 0x20000000
1406#define SHF_MIPS_ADDR 0x40000000
1407#define SHF_MIPS_STRINGS 0x80000000
1408#define SHF_MIPS_NOSTRIP 0x08000000
1409#define SHF_MIPS_LOCAL 0x04000000
1410#define SHF_MIPS_NAMES 0x02000000
1411#define SHF_MIPS_NODUPE 0x01000000
1412
1413
1414
1415
1416
1417#define STO_MIPS_DEFAULT 0x0
1418#define STO_MIPS_INTERNAL 0x1
1419#define STO_MIPS_HIDDEN 0x2
1420#define STO_MIPS_PROTECTED 0x3
1421#define STO_MIPS_PLT 0x8
1422#define STO_MIPS_SC_ALIGN_UNUSED 0xff
1423
1424
1425#define STB_MIPS_SPLIT_COMMON 13
1426
1427
1428
1429typedef union {
1430 struct {
1431 Elf32_Word gt_current_g_value;
1432 Elf32_Word gt_unused;
1433 } gt_header;
1434 struct {
1435 Elf32_Word gt_g_value;
1436 Elf32_Word gt_bytes;
1437 } gt_entry;
1438} Elf32_gptab;
1439
1440
1441
1442typedef struct {
1443 Elf32_Word ri_gprmask;
1444 Elf32_Word ri_cprmask[4];
1445 Elf32_Sword ri_gp_value;
1446} Elf32_RegInfo;
1447
1448
1449
1450typedef struct {
1451 unsigned char kind;
1452
1453 unsigned char size;
1454 Elf32_Section section;
1455
1456 Elf32_Word info;
1457} Elf_Options;
1458
1459
1460
1461#define ODK_NULL 0
1462#define ODK_REGINFO 1
1463#define ODK_EXCEPTIONS 2
1464#define ODK_PAD 3
1465#define ODK_HWPATCH 4
1466#define ODK_FILL 5
1467#define ODK_TAGS 6
1468#define ODK_HWAND 7
1469#define ODK_HWOR 8
1470
1471
1472
1473#define OEX_FPU_MIN 0x1f
1474#define OEX_FPU_MAX 0x1f00
1475#define OEX_PAGE0 0x10000
1476#define OEX_SMM 0x20000
1477#define OEX_FPDBUG 0x40000
1478#define OEX_PRECISEFP OEX_FPDBUG
1479#define OEX_DISMISS 0x80000
1480
1481#define OEX_FPU_INVAL 0x10
1482#define OEX_FPU_DIV0 0x08
1483#define OEX_FPU_OFLO 0x04
1484#define OEX_FPU_UFLO 0x02
1485#define OEX_FPU_INEX 0x01
1486
1487
1488
1489#define OHW_R4KEOP 0x1
1490#define OHW_R8KPFETCH 0x2
1491#define OHW_R5KEOP 0x4
1492#define OHW_R5KCVTL 0x8
1493
1494#define OPAD_PREFIX 0x1
1495#define OPAD_POSTFIX 0x2
1496#define OPAD_SYMBOL 0x4
1497
1498
1499
1500typedef struct {
1501 Elf32_Word hwp_flags1;
1502 Elf32_Word hwp_flags2;
1503} Elf_Options_Hw;
1504
1505
1506
1507#define OHWA0_R4KEOP_CHECKED 0x00000001
1508#define OHWA1_R4KEOP_CLEAN 0x00000002
1509
1510
1511
1512#define R_MIPS_NONE 0
1513#define R_MIPS_16 1
1514#define R_MIPS_32 2
1515#define R_MIPS_REL32 3
1516#define R_MIPS_26 4
1517#define R_MIPS_HI16 5
1518#define R_MIPS_LO16 6
1519#define R_MIPS_GPREL16 7
1520#define R_MIPS_LITERAL 8
1521#define R_MIPS_GOT16 9
1522#define R_MIPS_PC16 10
1523#define R_MIPS_CALL16 11
1524#define R_MIPS_GPREL32 12
1525
1526#define R_MIPS_SHIFT5 16
1527#define R_MIPS_SHIFT6 17
1528#define R_MIPS_64 18
1529#define R_MIPS_GOT_DISP 19
1530#define R_MIPS_GOT_PAGE 20
1531#define R_MIPS_GOT_OFST 21
1532#define R_MIPS_GOT_HI16 22
1533#define R_MIPS_GOT_LO16 23
1534#define R_MIPS_SUB 24
1535#define R_MIPS_INSERT_A 25
1536#define R_MIPS_INSERT_B 26
1537#define R_MIPS_DELETE 27
1538#define R_MIPS_HIGHER 28
1539#define R_MIPS_HIGHEST 29
1540#define R_MIPS_CALL_HI16 30
1541#define R_MIPS_CALL_LO16 31
1542#define R_MIPS_SCN_DISP 32
1543#define R_MIPS_REL16 33
1544#define R_MIPS_ADD_IMMEDIATE 34
1545#define R_MIPS_PJUMP 35
1546#define R_MIPS_RELGOT 36
1547#define R_MIPS_JALR 37
1548#define R_MIPS_TLS_DTPMOD32 38
1549#define R_MIPS_TLS_DTPREL32 39
1550#define R_MIPS_TLS_DTPMOD64 40
1551#define R_MIPS_TLS_DTPREL64 41
1552#define R_MIPS_TLS_GD 42
1553#define R_MIPS_TLS_LDM 43
1554#define R_MIPS_TLS_DTPREL_HI16 44
1555#define R_MIPS_TLS_DTPREL_LO16 45
1556#define R_MIPS_TLS_GOTTPREL 46
1557#define R_MIPS_TLS_TPREL32 47
1558#define R_MIPS_TLS_TPREL64 48
1559#define R_MIPS_TLS_TPREL_HI16 49
1560#define R_MIPS_TLS_TPREL_LO16 50
1561#define R_MIPS_GLOB_DAT 51
1562#define R_MIPS_COPY 126
1563#define R_MIPS_JUMP_SLOT 127
1564
1565#define R_MIPS_NUM 128
1566
1567
1568
1569#define PT_MIPS_REGINFO 0x70000000
1570#define PT_MIPS_RTPROC 0x70000001
1571#define PT_MIPS_OPTIONS 0x70000002
1572#define PT_MIPS_ABIFLAGS 0x70000003
1573
1574
1575
1576#define PF_MIPS_LOCAL 0x10000000
1577
1578
1579
1580#define DT_MIPS_RLD_VERSION 0x70000001
1581#define DT_MIPS_TIME_STAMP 0x70000002
1582#define DT_MIPS_ICHECKSUM 0x70000003
1583#define DT_MIPS_IVERSION 0x70000004
1584#define DT_MIPS_FLAGS 0x70000005
1585#define DT_MIPS_BASE_ADDRESS 0x70000006
1586#define DT_MIPS_MSYM 0x70000007
1587#define DT_MIPS_CONFLICT 0x70000008
1588#define DT_MIPS_LIBLIST 0x70000009
1589#define DT_MIPS_LOCAL_GOTNO 0x7000000a
1590#define DT_MIPS_CONFLICTNO 0x7000000b
1591#define DT_MIPS_LIBLISTNO 0x70000010
1592#define DT_MIPS_SYMTABNO 0x70000011
1593#define DT_MIPS_UNREFEXTNO 0x70000012
1594#define DT_MIPS_GOTSYM 0x70000013
1595#define DT_MIPS_HIPAGENO 0x70000014
1596#define DT_MIPS_RLD_MAP 0x70000016
1597#define DT_MIPS_DELTA_CLASS 0x70000017
1598#define DT_MIPS_DELTA_CLASS_NO 0x70000018
1599
1600#define DT_MIPS_DELTA_INSTANCE 0x70000019
1601#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
1602
1603#define DT_MIPS_DELTA_RELOC 0x7000001b
1604#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
1605
1606#define DT_MIPS_DELTA_SYM 0x7000001d
1607
1608#define DT_MIPS_DELTA_SYM_NO 0x7000001e
1609
1610#define DT_MIPS_DELTA_CLASSSYM 0x70000020
1611
1612#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
1613
1614#define DT_MIPS_CXX_FLAGS 0x70000022
1615#define DT_MIPS_PIXIE_INIT 0x70000023
1616#define DT_MIPS_SYMBOL_LIB 0x70000024
1617#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
1618#define DT_MIPS_LOCAL_GOTIDX 0x70000026
1619#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
1620#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
1621#define DT_MIPS_OPTIONS 0x70000029
1622#define DT_MIPS_INTERFACE 0x7000002a
1623#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
1624#define DT_MIPS_INTERFACE_SIZE 0x7000002c
1625#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
1626
1627#define DT_MIPS_PERF_SUFFIX 0x7000002e
1628
1629#define DT_MIPS_COMPACT_SIZE 0x7000002f
1630#define DT_MIPS_GP_VALUE 0x70000030
1631#define DT_MIPS_AUX_DYNAMIC 0x70000031
1632
1633#define DT_MIPS_PLTGOT 0x70000032
1634
1635#define DT_MIPS_RWPLT 0x70000034
1636#define DT_MIPS_RLD_MAP_REL 0x70000035
1637#define DT_MIPS_NUM 0x36
1638
1639
1640
1641#define RHF_NONE 0
1642#define RHF_QUICKSTART (1 << 0)
1643#define RHF_NOTPOT (1 << 1)
1644#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
1645#define RHF_NO_MOVE (1 << 3)
1646#define RHF_SGI_ONLY (1 << 4)
1647#define RHF_GUARANTEE_INIT (1 << 5)
1648#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
1649#define RHF_GUARANTEE_START_INIT (1 << 7)
1650#define RHF_PIXIE (1 << 8)
1651#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
1652#define RHF_REQUICKSTART (1 << 10)
1653#define RHF_REQUICKSTARTED (1 << 11)
1654#define RHF_CORD (1 << 12)
1655#define RHF_NO_UNRES_UNDEF (1 << 13)
1656#define RHF_RLD_ORDER_SAFE (1 << 14)
1657
1658
1659
1660typedef struct {
1661 Elf32_Word l_name;
1662 Elf32_Word l_time_stamp;
1663 Elf32_Word l_checksum;
1664 Elf32_Word l_version;
1665 Elf32_Word l_flags;
1666} Elf32_Lib;
1667
1668typedef struct {
1669 Elf64_Word l_name;
1670 Elf64_Word l_time_stamp;
1671 Elf64_Word l_checksum;
1672 Elf64_Word l_version;
1673 Elf64_Word l_flags;
1674} Elf64_Lib;
1675
1676
1677
1678
1679#define LL_NONE 0
1680#define LL_EXACT_MATCH (1 << 0)
1681#define LL_IGNORE_INT_VER (1 << 1)
1682#define LL_REQUIRE_MINOR (1 << 2)
1683#define LL_EXPORTS (1 << 3)
1684#define LL_DELAY_LOAD (1 << 4)
1685#define LL_DELTA (1 << 5)
1686
1687
1688
1689typedef Elf32_Addr Elf32_Conflict;
1690
1691typedef struct {
1692 Elf32_Half version;
1693 unsigned char isa_level;
1694 unsigned char isa_rev;
1695 unsigned char gpr_size;
1696 unsigned char cpr1_size;
1697 unsigned char cpr2_size;
1698 unsigned char fp_abi;
1699 Elf32_Word isa_ext;
1700 Elf32_Word ases;
1701 Elf32_Word flags1;
1702 Elf32_Word flags2;
1703} Elf_MIPS_ABIFlags_v0;
1704
1705#define MIPS_AFL_REG_NONE 0x00
1706#define MIPS_AFL_REG_32 0x01
1707#define MIPS_AFL_REG_64 0x02
1708#define MIPS_AFL_REG_128 0x03
1709
1710#define MIPS_AFL_ASE_DSP 0x00000001
1711#define MIPS_AFL_ASE_DSPR2 0x00000002
1712#define MIPS_AFL_ASE_EVA 0x00000004
1713#define MIPS_AFL_ASE_MCU 0x00000008
1714#define MIPS_AFL_ASE_MDMX 0x00000010
1715#define MIPS_AFL_ASE_MIPS3D 0x00000020
1716#define MIPS_AFL_ASE_MT 0x00000040
1717#define MIPS_AFL_ASE_SMARTMIPS 0x00000080
1718#define MIPS_AFL_ASE_VIRT 0x00000100
1719#define MIPS_AFL_ASE_MSA 0x00000200
1720#define MIPS_AFL_ASE_MIPS16 0x00000400
1721#define MIPS_AFL_ASE_MICROMIPS 0x00000800
1722#define MIPS_AFL_ASE_XPA 0x00001000
1723#define MIPS_AFL_ASE_MASK 0x00001fff
1724
1725#define MIPS_AFL_EXT_XLR 1
1726#define MIPS_AFL_EXT_OCTEON2 2
1727#define MIPS_AFL_EXT_OCTEONP 3
1728#define MIPS_AFL_EXT_LOONGSON_3A 4
1729#define MIPS_AFL_EXT_OCTEON 5
1730#define MIPS_AFL_EXT_5900 6
1731#define MIPS_AFL_EXT_4650 7
1732#define MIPS_AFL_EXT_4010 8
1733#define MIPS_AFL_EXT_4100 9
1734#define MIPS_AFL_EXT_3900 10
1735#define MIPS_AFL_EXT_10000 11
1736#define MIPS_AFL_EXT_SB1 12
1737#define MIPS_AFL_EXT_4111 13
1738#define MIPS_AFL_EXT_4120 14
1739#define MIPS_AFL_EXT_5400 15
1740#define MIPS_AFL_EXT_5500 16
1741#define MIPS_AFL_EXT_LOONGSON_2E 17
1742#define MIPS_AFL_EXT_LOONGSON_2F 18
1743
1744#define MIPS_AFL_FLAGS1_ODDSPREG 1
1745
1746enum
1747{
1748 Val_GNU_MIPS_ABI_FP_ANY = 0,
1749 Val_GNU_MIPS_ABI_FP_DOUBLE = 1,
1750 Val_GNU_MIPS_ABI_FP_SINGLE = 2,
1751 Val_GNU_MIPS_ABI_FP_SOFT = 3,
1752 Val_GNU_MIPS_ABI_FP_OLD_64 = 4,
1753 Val_GNU_MIPS_ABI_FP_XX = 5,
1754 Val_GNU_MIPS_ABI_FP_64 = 6,
1755 Val_GNU_MIPS_ABI_FP_64A = 7,
1756 Val_GNU_MIPS_ABI_FP_MAX = 7
1757};
1758
1759
1760
1761
1762#define EF_PARISC_TRAPNIL 0x00010000
1763#define EF_PARISC_EXT 0x00020000
1764#define EF_PARISC_LSB 0x00040000
1765#define EF_PARISC_WIDE 0x00080000
1766#define EF_PARISC_NO_KABP 0x00100000
1767
1768#define EF_PARISC_LAZYSWAP 0x00400000
1769#define EF_PARISC_ARCH 0x0000ffff
1770
1771
1772
1773#define EFA_PARISC_1_0 0x020b
1774#define EFA_PARISC_1_1 0x0210
1775#define EFA_PARISC_2_0 0x0214
1776
1777
1778
1779#define SHN_PARISC_ANSI_COMMON 0xff00
1780
1781#define SHN_PARISC_HUGE_COMMON 0xff01
1782
1783
1784
1785#define SHT_PARISC_EXT 0x70000000
1786#define SHT_PARISC_UNWIND 0x70000001
1787#define SHT_PARISC_DOC 0x70000002
1788
1789
1790
1791#define SHF_PARISC_SHORT 0x20000000
1792#define SHF_PARISC_HUGE 0x40000000
1793#define SHF_PARISC_SBP 0x80000000
1794
1795
1796
1797#define STT_PARISC_MILLICODE 13
1798
1799#define STT_HP_OPAQUE (STT_LOOS + 0x1)
1800#define STT_HP_STUB (STT_LOOS + 0x2)
1801
1802
1803
1804#define R_PARISC_NONE 0
1805#define R_PARISC_DIR32 1
1806#define R_PARISC_DIR21L 2
1807#define R_PARISC_DIR17R 3
1808#define R_PARISC_DIR17F 4
1809#define R_PARISC_DIR14R 6
1810#define R_PARISC_PCREL32 9
1811#define R_PARISC_PCREL21L 10
1812#define R_PARISC_PCREL17R 11
1813#define R_PARISC_PCREL17F 12
1814#define R_PARISC_PCREL14R 14
1815#define R_PARISC_DPREL21L 18
1816#define R_PARISC_DPREL14R 22
1817#define R_PARISC_GPREL21L 26
1818#define R_PARISC_GPREL14R 30
1819#define R_PARISC_LTOFF21L 34
1820#define R_PARISC_LTOFF14R 38
1821#define R_PARISC_SECREL32 41
1822#define R_PARISC_SEGBASE 48
1823#define R_PARISC_SEGREL32 49
1824#define R_PARISC_PLTOFF21L 50
1825#define R_PARISC_PLTOFF14R 54
1826#define R_PARISC_LTOFF_FPTR32 57
1827#define R_PARISC_LTOFF_FPTR21L 58
1828#define R_PARISC_LTOFF_FPTR14R 62
1829#define R_PARISC_FPTR64 64
1830#define R_PARISC_PLABEL32 65
1831#define R_PARISC_PLABEL21L 66
1832#define R_PARISC_PLABEL14R 70
1833#define R_PARISC_PCREL64 72
1834#define R_PARISC_PCREL22F 74
1835#define R_PARISC_PCREL14WR 75
1836#define R_PARISC_PCREL14DR 76
1837#define R_PARISC_PCREL16F 77
1838#define R_PARISC_PCREL16WF 78
1839#define R_PARISC_PCREL16DF 79
1840#define R_PARISC_DIR64 80
1841#define R_PARISC_DIR14WR 83
1842#define R_PARISC_DIR14DR 84
1843#define R_PARISC_DIR16F 85
1844#define R_PARISC_DIR16WF 86
1845#define R_PARISC_DIR16DF 87
1846#define R_PARISC_GPREL64 88
1847#define R_PARISC_GPREL14WR 91
1848#define R_PARISC_GPREL14DR 92
1849#define R_PARISC_GPREL16F 93
1850#define R_PARISC_GPREL16WF 94
1851#define R_PARISC_GPREL16DF 95
1852#define R_PARISC_LTOFF64 96
1853#define R_PARISC_LTOFF14WR 99
1854#define R_PARISC_LTOFF14DR 100
1855#define R_PARISC_LTOFF16F 101
1856#define R_PARISC_LTOFF16WF 102
1857#define R_PARISC_LTOFF16DF 103
1858#define R_PARISC_SECREL64 104
1859#define R_PARISC_SEGREL64 112
1860#define R_PARISC_PLTOFF14WR 115
1861#define R_PARISC_PLTOFF14DR 116
1862#define R_PARISC_PLTOFF16F 117
1863#define R_PARISC_PLTOFF16WF 118
1864#define R_PARISC_PLTOFF16DF 119
1865#define R_PARISC_LTOFF_FPTR64 120
1866#define R_PARISC_LTOFF_FPTR14WR 123
1867#define R_PARISC_LTOFF_FPTR14DR 124
1868#define R_PARISC_LTOFF_FPTR16F 125
1869#define R_PARISC_LTOFF_FPTR16WF 126
1870#define R_PARISC_LTOFF_FPTR16DF 127
1871#define R_PARISC_LORESERVE 128
1872#define R_PARISC_COPY 128
1873#define R_PARISC_IPLT 129
1874#define R_PARISC_EPLT 130
1875#define R_PARISC_TPREL32 153
1876#define R_PARISC_TPREL21L 154
1877#define R_PARISC_TPREL14R 158
1878#define R_PARISC_LTOFF_TP21L 162
1879#define R_PARISC_LTOFF_TP14R 166
1880#define R_PARISC_LTOFF_TP14F 167
1881#define R_PARISC_TPREL64 216
1882#define R_PARISC_TPREL14WR 219
1883#define R_PARISC_TPREL14DR 220
1884#define R_PARISC_TPREL16F 221
1885#define R_PARISC_TPREL16WF 222
1886#define R_PARISC_TPREL16DF 223
1887#define R_PARISC_LTOFF_TP64 224
1888#define R_PARISC_LTOFF_TP14WR 227
1889#define R_PARISC_LTOFF_TP14DR 228
1890#define R_PARISC_LTOFF_TP16F 229
1891#define R_PARISC_LTOFF_TP16WF 230
1892#define R_PARISC_LTOFF_TP16DF 231
1893#define R_PARISC_GNU_VTENTRY 232
1894#define R_PARISC_GNU_VTINHERIT 233
1895#define R_PARISC_TLS_GD21L 234
1896#define R_PARISC_TLS_GD14R 235
1897#define R_PARISC_TLS_GDCALL 236
1898#define R_PARISC_TLS_LDM21L 237
1899#define R_PARISC_TLS_LDM14R 238
1900#define R_PARISC_TLS_LDMCALL 239
1901#define R_PARISC_TLS_LDO21L 240
1902#define R_PARISC_TLS_LDO14R 241
1903#define R_PARISC_TLS_DTPMOD32 242
1904#define R_PARISC_TLS_DTPMOD64 243
1905#define R_PARISC_TLS_DTPOFF32 244
1906#define R_PARISC_TLS_DTPOFF64 245
1907#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
1908#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
1909#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
1910#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
1911#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
1912#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
1913#define R_PARISC_HIRESERVE 255
1914
1915
1916
1917#define PT_HP_TLS (PT_LOOS + 0x0)
1918#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
1919#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
1920#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
1921#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
1922#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
1923#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
1924#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
1925#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
1926#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
1927#define PT_HP_PARALLEL (PT_LOOS + 0x10)
1928#define PT_HP_FASTBIND (PT_LOOS + 0x11)
1929#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
1930#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
1931#define PT_HP_STACK (PT_LOOS + 0x14)
1932
1933#define PT_PARISC_ARCHEXT 0x70000000
1934#define PT_PARISC_UNWIND 0x70000001
1935
1936
1937
1938#define PF_PARISC_SBP 0x08000000
1939
1940#define PF_HP_PAGE_SIZE 0x00100000
1941#define PF_HP_FAR_SHARED 0x00200000
1942#define PF_HP_NEAR_SHARED 0x00400000
1943#define PF_HP_CODE 0x01000000
1944#define PF_HP_MODIFY 0x02000000
1945#define PF_HP_LAZYSWAP 0x04000000
1946#define PF_HP_SBP 0x08000000
1947
1948
1949
1950
1951
1952
1953#define EF_ALPHA_32BIT 1
1954#define EF_ALPHA_CANRELAX 2
1955
1956
1957
1958
1959#define SHT_ALPHA_DEBUG 0x70000001
1960#define SHT_ALPHA_REGINFO 0x70000002
1961
1962
1963
1964#define SHF_ALPHA_GPREL 0x10000000
1965
1966
1967#define STO_ALPHA_NOPV 0x80
1968#define STO_ALPHA_STD_GPLOAD 0x88
1969
1970
1971
1972#define R_ALPHA_NONE 0
1973#define R_ALPHA_REFLONG 1
1974#define R_ALPHA_REFQUAD 2
1975#define R_ALPHA_GPREL32 3
1976#define R_ALPHA_LITERAL 4
1977#define R_ALPHA_LITUSE 5
1978#define R_ALPHA_GPDISP 6
1979#define R_ALPHA_BRADDR 7
1980#define R_ALPHA_HINT 8
1981#define R_ALPHA_SREL16 9
1982#define R_ALPHA_SREL32 10
1983#define R_ALPHA_SREL64 11
1984#define R_ALPHA_GPRELHIGH 17
1985#define R_ALPHA_GPRELLOW 18
1986#define R_ALPHA_GPREL16 19
1987#define R_ALPHA_COPY 24
1988#define R_ALPHA_GLOB_DAT 25
1989#define R_ALPHA_JMP_SLOT 26
1990#define R_ALPHA_RELATIVE 27
1991#define R_ALPHA_TLS_GD_HI 28
1992#define R_ALPHA_TLSGD 29
1993#define R_ALPHA_TLS_LDM 30
1994#define R_ALPHA_DTPMOD64 31
1995#define R_ALPHA_GOTDTPREL 32
1996#define R_ALPHA_DTPREL64 33
1997#define R_ALPHA_DTPRELHI 34
1998#define R_ALPHA_DTPRELLO 35
1999#define R_ALPHA_DTPREL16 36
2000#define R_ALPHA_GOTTPREL 37
2001#define R_ALPHA_TPREL64 38
2002#define R_ALPHA_TPRELHI 39
2003#define R_ALPHA_TPRELLO 40
2004#define R_ALPHA_TPREL16 41
2005
2006#define R_ALPHA_NUM 46
2007
2008
2009#define LITUSE_ALPHA_ADDR 0
2010#define LITUSE_ALPHA_BASE 1
2011#define LITUSE_ALPHA_BYTOFF 2
2012#define LITUSE_ALPHA_JSR 3
2013#define LITUSE_ALPHA_TLS_GD 4
2014#define LITUSE_ALPHA_TLS_LDM 5
2015
2016
2017#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
2018#define DT_ALPHA_NUM 1
2019
2020
2021
2022
2023#define EF_PPC_EMB 0x80000000
2024
2025
2026#define EF_PPC_RELOCATABLE 0x00010000
2027#define EF_PPC_RELOCATABLE_LIB 0x00008000
2028
2029
2030
2031#define R_PPC_NONE 0
2032#define R_PPC_ADDR32 1
2033#define R_PPC_ADDR24 2
2034#define R_PPC_ADDR16 3
2035#define R_PPC_ADDR16_LO 4
2036#define R_PPC_ADDR16_HI 5
2037#define R_PPC_ADDR16_HA 6
2038#define R_PPC_ADDR14 7
2039#define R_PPC_ADDR14_BRTAKEN 8
2040#define R_PPC_ADDR14_BRNTAKEN 9
2041#define R_PPC_REL24 10
2042#define R_PPC_REL14 11
2043#define R_PPC_REL14_BRTAKEN 12
2044#define R_PPC_REL14_BRNTAKEN 13
2045#define R_PPC_GOT16 14
2046#define R_PPC_GOT16_LO 15
2047#define R_PPC_GOT16_HI 16
2048#define R_PPC_GOT16_HA 17
2049#define R_PPC_PLTREL24 18
2050#define R_PPC_COPY 19
2051#define R_PPC_GLOB_DAT 20
2052#define R_PPC_JMP_SLOT 21
2053#define R_PPC_RELATIVE 22
2054#define R_PPC_LOCAL24PC 23
2055#define R_PPC_UADDR32 24
2056#define R_PPC_UADDR16 25
2057#define R_PPC_REL32 26
2058#define R_PPC_PLT32 27
2059#define R_PPC_PLTREL32 28
2060#define R_PPC_PLT16_LO 29
2061#define R_PPC_PLT16_HI 30
2062#define R_PPC_PLT16_HA 31
2063#define R_PPC_SDAREL16 32
2064#define R_PPC_SECTOFF 33
2065#define R_PPC_SECTOFF_LO 34
2066#define R_PPC_SECTOFF_HI 35
2067#define R_PPC_SECTOFF_HA 36
2068
2069
2070#define R_PPC_TLS 67
2071#define R_PPC_DTPMOD32 68
2072#define R_PPC_TPREL16 69
2073#define R_PPC_TPREL16_LO 70
2074#define R_PPC_TPREL16_HI 71
2075#define R_PPC_TPREL16_HA 72
2076#define R_PPC_TPREL32 73
2077#define R_PPC_DTPREL16 74
2078#define R_PPC_DTPREL16_LO 75
2079#define R_PPC_DTPREL16_HI 76
2080#define R_PPC_DTPREL16_HA 77
2081#define R_PPC_DTPREL32 78
2082#define R_PPC_GOT_TLSGD16 79
2083#define R_PPC_GOT_TLSGD16_LO 80
2084#define R_PPC_GOT_TLSGD16_HI 81
2085#define R_PPC_GOT_TLSGD16_HA 82
2086#define R_PPC_GOT_TLSLD16 83
2087#define R_PPC_GOT_TLSLD16_LO 84
2088#define R_PPC_GOT_TLSLD16_HI 85
2089#define R_PPC_GOT_TLSLD16_HA 86
2090#define R_PPC_GOT_TPREL16 87
2091#define R_PPC_GOT_TPREL16_LO 88
2092#define R_PPC_GOT_TPREL16_HI 89
2093#define R_PPC_GOT_TPREL16_HA 90
2094#define R_PPC_GOT_DTPREL16 91
2095#define R_PPC_GOT_DTPREL16_LO 92
2096#define R_PPC_GOT_DTPREL16_HI 93
2097#define R_PPC_GOT_DTPREL16_HA 94
2098#define R_PPC_TLSGD 95
2099#define R_PPC_TLSLD 96
2100
2101
2102#define R_PPC_EMB_NADDR32 101
2103#define R_PPC_EMB_NADDR16 102
2104#define R_PPC_EMB_NADDR16_LO 103
2105#define R_PPC_EMB_NADDR16_HI 104
2106#define R_PPC_EMB_NADDR16_HA 105
2107#define R_PPC_EMB_SDAI16 106
2108#define R_PPC_EMB_SDA2I16 107
2109#define R_PPC_EMB_SDA2REL 108
2110#define R_PPC_EMB_SDA21 109
2111#define R_PPC_EMB_MRKREF 110
2112#define R_PPC_EMB_RELSEC16 111
2113#define R_PPC_EMB_RELST_LO 112
2114#define R_PPC_EMB_RELST_HI 113
2115#define R_PPC_EMB_RELST_HA 114
2116#define R_PPC_EMB_BIT_FLD 115
2117#define R_PPC_EMB_RELSDA 116
2118
2119
2120#define R_PPC_DIAB_SDA21_LO 180
2121#define R_PPC_DIAB_SDA21_HI 181
2122#define R_PPC_DIAB_SDA21_HA 182
2123#define R_PPC_DIAB_RELSDA_LO 183
2124#define R_PPC_DIAB_RELSDA_HI 184
2125#define R_PPC_DIAB_RELSDA_HA 185
2126
2127
2128#define R_PPC_IRELATIVE 248
2129
2130
2131#define R_PPC_REL16 249
2132#define R_PPC_REL16_LO 250
2133#define R_PPC_REL16_HI 251
2134#define R_PPC_REL16_HA 252
2135
2136
2137
2138#define R_PPC_TOC16 255
2139
2140
2141#define DT_PPC_GOT (DT_LOPROC + 0)
2142#define DT_PPC_OPT (DT_LOPROC + 1)
2143#define DT_PPC_NUM 2
2144
2145#define PPC_OPT_TLS 1
2146
2147
2148#define R_PPC64_NONE R_PPC_NONE
2149#define R_PPC64_ADDR32 R_PPC_ADDR32
2150#define R_PPC64_ADDR24 R_PPC_ADDR24
2151#define R_PPC64_ADDR16 R_PPC_ADDR16
2152#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
2153#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
2154#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
2155#define R_PPC64_ADDR14 R_PPC_ADDR14
2156#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
2157#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
2158#define R_PPC64_REL24 R_PPC_REL24
2159#define R_PPC64_REL14 R_PPC_REL14
2160#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
2161#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
2162#define R_PPC64_GOT16 R_PPC_GOT16
2163#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
2164#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
2165#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
2166
2167#define R_PPC64_COPY R_PPC_COPY
2168#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
2169#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
2170#define R_PPC64_RELATIVE R_PPC_RELATIVE
2171
2172#define R_PPC64_UADDR32 R_PPC_UADDR32
2173#define R_PPC64_UADDR16 R_PPC_UADDR16
2174#define R_PPC64_REL32 R_PPC_REL32
2175#define R_PPC64_PLT32 R_PPC_PLT32
2176#define R_PPC64_PLTREL32 R_PPC_PLTREL32
2177#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
2178#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
2179#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
2180
2181#define R_PPC64_SECTOFF R_PPC_SECTOFF
2182#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
2183#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
2184#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
2185#define R_PPC64_ADDR30 37
2186#define R_PPC64_ADDR64 38
2187#define R_PPC64_ADDR16_HIGHER 39
2188#define R_PPC64_ADDR16_HIGHERA 40
2189#define R_PPC64_ADDR16_HIGHEST 41
2190#define R_PPC64_ADDR16_HIGHESTA 42
2191#define R_PPC64_UADDR64 43
2192#define R_PPC64_REL64 44
2193#define R_PPC64_PLT64 45
2194#define R_PPC64_PLTREL64 46
2195#define R_PPC64_TOC16 47
2196#define R_PPC64_TOC16_LO 48
2197#define R_PPC64_TOC16_HI 49
2198#define R_PPC64_TOC16_HA 50
2199#define R_PPC64_TOC 51
2200#define R_PPC64_PLTGOT16 52
2201#define R_PPC64_PLTGOT16_LO 53
2202#define R_PPC64_PLTGOT16_HI 54
2203#define R_PPC64_PLTGOT16_HA 55
2204
2205#define R_PPC64_ADDR16_DS 56
2206#define R_PPC64_ADDR16_LO_DS 57
2207#define R_PPC64_GOT16_DS 58
2208#define R_PPC64_GOT16_LO_DS 59
2209#define R_PPC64_PLT16_LO_DS 60
2210#define R_PPC64_SECTOFF_DS 61
2211#define R_PPC64_SECTOFF_LO_DS 62
2212#define R_PPC64_TOC16_DS 63
2213#define R_PPC64_TOC16_LO_DS 64
2214#define R_PPC64_PLTGOT16_DS 65
2215#define R_PPC64_PLTGOT16_LO_DS 66
2216
2217
2218#define R_PPC64_TLS 67
2219#define R_PPC64_DTPMOD64 68
2220#define R_PPC64_TPREL16 69
2221#define R_PPC64_TPREL16_LO 70
2222#define R_PPC64_TPREL16_HI 71
2223#define R_PPC64_TPREL16_HA 72
2224#define R_PPC64_TPREL64 73
2225#define R_PPC64_DTPREL16 74
2226#define R_PPC64_DTPREL16_LO 75
2227#define R_PPC64_DTPREL16_HI 76
2228#define R_PPC64_DTPREL16_HA 77
2229#define R_PPC64_DTPREL64 78
2230#define R_PPC64_GOT_TLSGD16 79
2231#define R_PPC64_GOT_TLSGD16_LO 80
2232#define R_PPC64_GOT_TLSGD16_HI 81
2233#define R_PPC64_GOT_TLSGD16_HA 82
2234#define R_PPC64_GOT_TLSLD16 83
2235#define R_PPC64_GOT_TLSLD16_LO 84
2236#define R_PPC64_GOT_TLSLD16_HI 85
2237#define R_PPC64_GOT_TLSLD16_HA 86
2238#define R_PPC64_GOT_TPREL16_DS 87
2239#define R_PPC64_GOT_TPREL16_LO_DS 88
2240#define R_PPC64_GOT_TPREL16_HI 89
2241#define R_PPC64_GOT_TPREL16_HA 90
2242#define R_PPC64_GOT_DTPREL16_DS 91
2243#define R_PPC64_GOT_DTPREL16_LO_DS 92
2244#define R_PPC64_GOT_DTPREL16_HI 93
2245#define R_PPC64_GOT_DTPREL16_HA 94
2246#define R_PPC64_TPREL16_DS 95
2247#define R_PPC64_TPREL16_LO_DS 96
2248#define R_PPC64_TPREL16_HIGHER 97
2249#define R_PPC64_TPREL16_HIGHERA 98
2250#define R_PPC64_TPREL16_HIGHEST 99
2251#define R_PPC64_TPREL16_HIGHESTA 100
2252#define R_PPC64_DTPREL16_DS 101
2253#define R_PPC64_DTPREL16_LO_DS 102
2254#define R_PPC64_DTPREL16_HIGHER 103
2255#define R_PPC64_DTPREL16_HIGHERA 104
2256#define R_PPC64_DTPREL16_HIGHEST 105
2257#define R_PPC64_DTPREL16_HIGHESTA 106
2258#define R_PPC64_TLSGD 107
2259#define R_PPC64_TLSLD 108
2260#define R_PPC64_TOCSAVE 109
2261#define R_PPC64_ADDR16_HIGH 110
2262#define R_PPC64_ADDR16_HIGHA 111
2263#define R_PPC64_TPREL16_HIGH 112
2264#define R_PPC64_TPREL16_HIGHA 113
2265#define R_PPC64_DTPREL16_HIGH 114
2266#define R_PPC64_DTPREL16_HIGHA 115
2267
2268
2269#define R_PPC64_JMP_IREL 247
2270#define R_PPC64_IRELATIVE 248
2271#define R_PPC64_REL16 249
2272#define R_PPC64_REL16_LO 250
2273#define R_PPC64_REL16_HI 251
2274#define R_PPC64_REL16_HA 252
2275
2276#define EF_PPC64_ABI 3
2277
2278#define DT_PPC64_GLINK (DT_LOPROC + 0)
2279#define DT_PPC64_OPD (DT_LOPROC + 1)
2280#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
2281#define DT_PPC64_OPT (DT_LOPROC + 3)
2282#define DT_PPC64_NUM 4
2283
2284#define PPC64_OPT_TLS 1
2285#define PPC64_OPT_MULTI_TOC 2
2286#define PPC64_OPT_LOCALENTRY 4
2287
2288#define STO_PPC64_LOCAL_BIT 5
2289#define STO_PPC64_LOCAL_MASK 0xe0
2290#define PPC64_LOCAL_ENTRY_OFFSET(x) (1 << (((x)&0xe0)>>5) & 0xfc)
2291
2292
2293#define EF_ARM_RELEXEC 0x01
2294#define EF_ARM_HASENTRY 0x02
2295#define EF_ARM_INTERWORK 0x04
2296#define EF_ARM_APCS_26 0x08
2297#define EF_ARM_APCS_FLOAT 0x10
2298#define EF_ARM_PIC 0x20
2299#define EF_ARM_ALIGN8 0x40
2300#define EF_ARM_NEW_ABI 0x80
2301#define EF_ARM_OLD_ABI 0x100
2302#define EF_ARM_SOFT_FLOAT 0x200
2303#define EF_ARM_VFP_FLOAT 0x400
2304#define EF_ARM_MAVERICK_FLOAT 0x800
2305
2306#define EF_ARM_ABI_FLOAT_SOFT 0x200
2307#define EF_ARM_ABI_FLOAT_HARD 0x400
2308
2309
2310#define EF_ARM_SYMSARESORTED 0x04
2311#define EF_ARM_DYNSYMSUSESEGIDX 0x08
2312#define EF_ARM_MAPSYMSFIRST 0x10
2313#define EF_ARM_EABIMASK 0XFF000000
2314
2315
2316#define EF_ARM_BE8 0x00800000
2317#define EF_ARM_LE8 0x00400000
2318
2319#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
2320#define EF_ARM_EABI_UNKNOWN 0x00000000
2321#define EF_ARM_EABI_VER1 0x01000000
2322#define EF_ARM_EABI_VER2 0x02000000
2323#define EF_ARM_EABI_VER3 0x03000000
2324#define EF_ARM_EABI_VER4 0x04000000
2325#define EF_ARM_EABI_VER5 0x05000000
2326
2327
2328#define STT_ARM_TFUNC STT_LOPROC
2329#define STT_ARM_16BIT STT_HIPROC
2330
2331
2332#define SHF_ARM_ENTRYSECT 0x10000000
2333#define SHF_ARM_COMDEF 0x80000000
2334
2335
2336
2337#define PF_ARM_SB 0x10000000
2338
2339#define PF_ARM_PI 0x20000000
2340#define PF_ARM_ABS 0x40000000
2341
2342
2343#define PT_ARM_EXIDX (PT_LOPROC + 1)
2344
2345
2346#define SHT_ARM_EXIDX (SHT_LOPROC + 1)
2347#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
2348#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
2349
2350#define R_AARCH64_NONE 0
2351#define R_AARCH64_P32_ABS32 1
2352#define R_AARCH64_P32_COPY 180
2353#define R_AARCH64_P32_GLOB_DAT 181
2354#define R_AARCH64_P32_JUMP_SLOT 182
2355#define R_AARCH64_P32_RELATIVE 183
2356#define R_AARCH64_P32_TLS_DTPMOD 184
2357#define R_AARCH64_P32_TLS_DTPREL 185
2358#define R_AARCH64_P32_TLS_TPREL 186
2359#define R_AARCH64_P32_TLSDESC 187
2360#define R_AARCH64_P32_IRELATIVE 188
2361#define R_AARCH64_ABS64 257
2362#define R_AARCH64_ABS32 258
2363#define R_AARCH64_ABS16 259
2364#define R_AARCH64_PREL64 260
2365#define R_AARCH64_PREL32 261
2366#define R_AARCH64_PREL16 262
2367#define R_AARCH64_MOVW_UABS_G0 263
2368#define R_AARCH64_MOVW_UABS_G0_NC 264
2369#define R_AARCH64_MOVW_UABS_G1 265
2370#define R_AARCH64_MOVW_UABS_G1_NC 266
2371#define R_AARCH64_MOVW_UABS_G2 267
2372#define R_AARCH64_MOVW_UABS_G2_NC 268
2373#define R_AARCH64_MOVW_UABS_G3 269
2374#define R_AARCH64_MOVW_SABS_G0 270
2375#define R_AARCH64_MOVW_SABS_G1 271
2376#define R_AARCH64_MOVW_SABS_G2 272
2377#define R_AARCH64_LD_PREL_LO19 273
2378#define R_AARCH64_ADR_PREL_LO21 274
2379#define R_AARCH64_ADR_PREL_PG_HI21 275
2380#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
2381#define R_AARCH64_ADD_ABS_LO12_NC 277
2382#define R_AARCH64_LDST8_ABS_LO12_NC 278
2383#define R_AARCH64_TSTBR14 279
2384#define R_AARCH64_CONDBR19 280
2385#define R_AARCH64_JUMP26 282
2386#define R_AARCH64_CALL26 283
2387#define R_AARCH64_LDST16_ABS_LO12_NC 284
2388#define R_AARCH64_LDST32_ABS_LO12_NC 285
2389#define R_AARCH64_LDST64_ABS_LO12_NC 286
2390#define R_AARCH64_MOVW_PREL_G0 287
2391#define R_AARCH64_MOVW_PREL_G0_NC 288
2392#define R_AARCH64_MOVW_PREL_G1 289
2393#define R_AARCH64_MOVW_PREL_G1_NC 290
2394#define R_AARCH64_MOVW_PREL_G2 291
2395#define R_AARCH64_MOVW_PREL_G2_NC 292
2396#define R_AARCH64_MOVW_PREL_G3 293
2397#define R_AARCH64_LDST128_ABS_LO12_NC 299
2398#define R_AARCH64_MOVW_GOTOFF_G0 300
2399#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
2400#define R_AARCH64_MOVW_GOTOFF_G1 302
2401#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
2402#define R_AARCH64_MOVW_GOTOFF_G2 304
2403#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
2404#define R_AARCH64_MOVW_GOTOFF_G3 306
2405#define R_AARCH64_GOTREL64 307
2406#define R_AARCH64_GOTREL32 308
2407#define R_AARCH64_GOT_LD_PREL19 309
2408#define R_AARCH64_LD64_GOTOFF_LO15 310
2409#define R_AARCH64_ADR_GOT_PAGE 311
2410#define R_AARCH64_LD64_GOT_LO12_NC 312
2411#define R_AARCH64_LD64_GOTPAGE_LO15 313
2412#define R_AARCH64_TLSGD_ADR_PREL21 512
2413#define R_AARCH64_TLSGD_ADR_PAGE21 513
2414#define R_AARCH64_TLSGD_ADD_LO12_NC 514
2415#define R_AARCH64_TLSGD_MOVW_G1 515
2416#define R_AARCH64_TLSGD_MOVW_G0_NC 516
2417#define R_AARCH64_TLSLD_ADR_PREL21 517
2418#define R_AARCH64_TLSLD_ADR_PAGE21 518
2419#define R_AARCH64_TLSLD_ADD_LO12_NC 519
2420#define R_AARCH64_TLSLD_MOVW_G1 520
2421#define R_AARCH64_TLSLD_MOVW_G0_NC 521
2422#define R_AARCH64_TLSLD_LD_PREL19 522
2423#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
2424#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
2425#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
2426#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
2427#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
2428#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
2429#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
2430#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
2431#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
2432#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
2433#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
2434#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
2435#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
2436#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
2437#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
2438#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
2439#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
2440#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
2441#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
2442#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
2443#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
2444#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
2445#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
2446#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
2447#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
2448#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
2449#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
2450#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
2451#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
2452#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
2453#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
2454#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
2455#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
2456#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
2457#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
2458#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
2459#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
2460#define R_AARCH64_TLSDESC_LD_PREL19 560
2461#define R_AARCH64_TLSDESC_ADR_PREL21 561
2462#define R_AARCH64_TLSDESC_ADR_PAGE21 562
2463#define R_AARCH64_TLSDESC_LD64_LO12 563
2464#define R_AARCH64_TLSDESC_ADD_LO12 564
2465#define R_AARCH64_TLSDESC_OFF_G1 565
2466#define R_AARCH64_TLSDESC_OFF_G0_NC 566
2467#define R_AARCH64_TLSDESC_LDR 567
2468#define R_AARCH64_TLSDESC_ADD 568
2469#define R_AARCH64_TLSDESC_CALL 569
2470#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
2471#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
2472#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
2473#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
2474#define R_AARCH64_COPY 1024
2475#define R_AARCH64_GLOB_DAT 1025
2476#define R_AARCH64_JUMP_SLOT 1026
2477#define R_AARCH64_RELATIVE 1027
2478#define R_AARCH64_TLS_DTPMOD 1028
2479#define R_AARCH64_TLS_DTPMOD64 1028
2480#define R_AARCH64_TLS_DTPREL 1029
2481#define R_AARCH64_TLS_DTPREL64 1029
2482#define R_AARCH64_TLS_TPREL 1030
2483#define R_AARCH64_TLS_TPREL64 1030
2484#define R_AARCH64_TLSDESC 1031
2485
2486
2487#define R_ARM_NONE 0
2488#define R_ARM_PC24 1
2489#define R_ARM_ABS32 2
2490#define R_ARM_REL32 3
2491#define R_ARM_PC13 4
2492#define R_ARM_ABS16 5
2493#define R_ARM_ABS12 6
2494#define R_ARM_THM_ABS5 7
2495#define R_ARM_ABS8 8
2496#define R_ARM_SBREL32 9
2497#define R_ARM_THM_PC22 10
2498#define R_ARM_THM_PC8 11
2499#define R_ARM_AMP_VCALL9 12
2500#define R_ARM_TLS_DESC 13
2501#define R_ARM_THM_SWI8 14
2502#define R_ARM_XPC25 15
2503#define R_ARM_THM_XPC22 16
2504#define R_ARM_TLS_DTPMOD32 17
2505#define R_ARM_TLS_DTPOFF32 18
2506#define R_ARM_TLS_TPOFF32 19
2507#define R_ARM_COPY 20
2508#define R_ARM_GLOB_DAT 21
2509#define R_ARM_JUMP_SLOT 22
2510#define R_ARM_RELATIVE 23
2511#define R_ARM_GOTOFF 24
2512#define R_ARM_GOTPC 25
2513#define R_ARM_GOT32 26
2514#define R_ARM_PLT32 27
2515#define R_ARM_CALL 28
2516#define R_ARM_JUMP24 29
2517#define R_ARM_THM_JUMP24 30
2518#define R_ARM_BASE_ABS 31
2519#define R_ARM_ALU_PCREL_7_0 32
2520#define R_ARM_ALU_PCREL_15_8 33
2521#define R_ARM_ALU_PCREL_23_15 34
2522#define R_ARM_LDR_SBREL_11_0 35
2523#define R_ARM_ALU_SBREL_19_12 36
2524#define R_ARM_ALU_SBREL_27_20 37
2525#define R_ARM_TARGET1 38
2526#define R_ARM_SBREL31 39
2527#define R_ARM_V4BX 40
2528#define R_ARM_TARGET2 41
2529#define R_ARM_PREL31 42
2530#define R_ARM_MOVW_ABS_NC 43
2531#define R_ARM_MOVT_ABS 44
2532#define R_ARM_MOVW_PREL_NC 45
2533#define R_ARM_MOVT_PREL 46
2534#define R_ARM_THM_MOVW_ABS_NC 47
2535#define R_ARM_THM_MOVT_ABS 48
2536#define R_ARM_THM_MOVW_PREL_NC 49
2537#define R_ARM_THM_MOVT_PREL 50
2538#define R_ARM_THM_JUMP19 51
2539#define R_ARM_THM_JUMP6 52
2540#define R_ARM_THM_ALU_PREL_11_0 53
2541#define R_ARM_THM_PC12 54
2542#define R_ARM_ABS32_NOI 55
2543#define R_ARM_REL32_NOI 56
2544#define R_ARM_ALU_PC_G0_NC 57
2545#define R_ARM_ALU_PC_G0 58
2546#define R_ARM_ALU_PC_G1_NC 59
2547#define R_ARM_ALU_PC_G1 60
2548#define R_ARM_ALU_PC_G2 61
2549#define R_ARM_LDR_PC_G1 62
2550#define R_ARM_LDR_PC_G2 63
2551#define R_ARM_LDRS_PC_G0 64
2552#define R_ARM_LDRS_PC_G1 65
2553#define R_ARM_LDRS_PC_G2 66
2554#define R_ARM_LDC_PC_G0 67
2555#define R_ARM_LDC_PC_G1 68
2556#define R_ARM_LDC_PC_G2 69
2557#define R_ARM_ALU_SB_G0_NC 70
2558#define R_ARM_ALU_SB_G0 71
2559#define R_ARM_ALU_SB_G1_NC 72
2560#define R_ARM_ALU_SB_G1 73
2561#define R_ARM_ALU_SB_G2 74
2562#define R_ARM_LDR_SB_G0 75
2563#define R_ARM_LDR_SB_G1 76
2564#define R_ARM_LDR_SB_G2 77
2565#define R_ARM_LDRS_SB_G0 78
2566#define R_ARM_LDRS_SB_G1 79
2567#define R_ARM_LDRS_SB_G2 80
2568#define R_ARM_LDC_SB_G0 81
2569#define R_ARM_LDC_SB_G1 82
2570#define R_ARM_LDC_SB_G2 83
2571#define R_ARM_MOVW_BREL_NC 84
2572#define R_ARM_MOVT_BREL 85
2573#define R_ARM_MOVW_BREL 86
2574#define R_ARM_THM_MOVW_BREL_NC 87
2575#define R_ARM_THM_MOVT_BREL 88
2576#define R_ARM_THM_MOVW_BREL 89
2577#define R_ARM_TLS_GOTDESC 90
2578#define R_ARM_TLS_CALL 91
2579#define R_ARM_TLS_DESCSEQ 92
2580#define R_ARM_THM_TLS_CALL 93
2581#define R_ARM_PLT32_ABS 94
2582#define R_ARM_GOT_ABS 95
2583#define R_ARM_GOT_PREL 96
2584#define R_ARM_GOT_BREL12 97
2585#define R_ARM_GOTOFF12 98
2586#define R_ARM_GOTRELAX 99
2587#define R_ARM_GNU_VTENTRY 100
2588#define R_ARM_GNU_VTINHERIT 101
2589#define R_ARM_THM_PC11 102
2590#define R_ARM_THM_PC9 103
2591#define R_ARM_TLS_GD32 104
2592
2593#define R_ARM_TLS_LDM32 105
2594
2595#define R_ARM_TLS_LDO32 106
2596
2597#define R_ARM_TLS_IE32 107
2598
2599#define R_ARM_TLS_LE32 108
2600#define R_ARM_TLS_LDO12 109
2601#define R_ARM_TLS_LE12 110
2602#define R_ARM_TLS_IE12GP 111
2603#define R_ARM_ME_TOO 128
2604#define R_ARM_THM_TLS_DESCSEQ 129
2605#define R_ARM_THM_TLS_DESCSEQ16 129
2606#define R_ARM_THM_TLS_DESCSEQ32 130
2607#define R_ARM_THM_GOT_BREL12 131
2608#define R_ARM_IRELATIVE 160
2609#define R_ARM_RXPC25 249
2610#define R_ARM_RSBREL32 250
2611#define R_ARM_THM_RPC22 251
2612#define R_ARM_RREL32 252
2613#define R_ARM_RABS22 253
2614#define R_ARM_RPC24 254
2615#define R_ARM_RBASE 255
2616
2617#define R_ARM_NUM 256
2618
2619
2620
2621
2622#define EF_IA_64_MASKOS 0x0000000f
2623#define EF_IA_64_ABI64 0x00000010
2624#define EF_IA_64_ARCH 0xff000000
2625
2626
2627#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
2628#define PT_IA_64_UNWIND (PT_LOPROC + 1)
2629#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
2630#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
2631#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
2632
2633
2634#define PF_IA_64_NORECOV 0x80000000
2635
2636
2637#define SHT_IA_64_EXT (SHT_LOPROC + 0)
2638#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
2639
2640
2641#define SHF_IA_64_SHORT 0x10000000
2642#define SHF_IA_64_NORECOV 0x20000000
2643
2644
2645#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
2646#define DT_IA_64_NUM 1
2647
2648
2649#define R_IA64_NONE 0x00
2650#define R_IA64_IMM14 0x21
2651#define R_IA64_IMM22 0x22
2652#define R_IA64_IMM64 0x23
2653#define R_IA64_DIR32MSB 0x24
2654#define R_IA64_DIR32LSB 0x25
2655#define R_IA64_DIR64MSB 0x26
2656#define R_IA64_DIR64LSB 0x27
2657#define R_IA64_GPREL22 0x2a
2658#define R_IA64_GPREL64I 0x2b
2659#define R_IA64_GPREL32MSB 0x2c
2660#define R_IA64_GPREL32LSB 0x2d
2661#define R_IA64_GPREL64MSB 0x2e
2662#define R_IA64_GPREL64LSB 0x2f
2663#define R_IA64_LTOFF22 0x32
2664#define R_IA64_LTOFF64I 0x33
2665#define R_IA64_PLTOFF22 0x3a
2666#define R_IA64_PLTOFF64I 0x3b
2667#define R_IA64_PLTOFF64MSB 0x3e
2668#define R_IA64_PLTOFF64LSB 0x3f
2669#define R_IA64_FPTR64I 0x43
2670#define R_IA64_FPTR32MSB 0x44
2671#define R_IA64_FPTR32LSB 0x45
2672#define R_IA64_FPTR64MSB 0x46
2673#define R_IA64_FPTR64LSB 0x47
2674#define R_IA64_PCREL60B 0x48
2675#define R_IA64_PCREL21B 0x49
2676#define R_IA64_PCREL21M 0x4a
2677#define R_IA64_PCREL21F 0x4b
2678#define R_IA64_PCREL32MSB 0x4c
2679#define R_IA64_PCREL32LSB 0x4d
2680#define R_IA64_PCREL64MSB 0x4e
2681#define R_IA64_PCREL64LSB 0x4f
2682#define R_IA64_LTOFF_FPTR22 0x52
2683#define R_IA64_LTOFF_FPTR64I 0x53
2684#define R_IA64_LTOFF_FPTR32MSB 0x54
2685#define R_IA64_LTOFF_FPTR32LSB 0x55
2686#define R_IA64_LTOFF_FPTR64MSB 0x56
2687#define R_IA64_LTOFF_FPTR64LSB 0x57
2688#define R_IA64_SEGREL32MSB 0x5c
2689#define R_IA64_SEGREL32LSB 0x5d
2690#define R_IA64_SEGREL64MSB 0x5e
2691#define R_IA64_SEGREL64LSB 0x5f
2692#define R_IA64_SECREL32MSB 0x64
2693#define R_IA64_SECREL32LSB 0x65
2694#define R_IA64_SECREL64MSB 0x66
2695#define R_IA64_SECREL64LSB 0x67
2696#define R_IA64_REL32MSB 0x6c
2697#define R_IA64_REL32LSB 0x6d
2698#define R_IA64_REL64MSB 0x6e
2699#define R_IA64_REL64LSB 0x6f
2700#define R_IA64_LTV32MSB 0x74
2701#define R_IA64_LTV32LSB 0x75
2702#define R_IA64_LTV64MSB 0x76
2703#define R_IA64_LTV64LSB 0x77
2704#define R_IA64_PCREL21BI 0x79
2705#define R_IA64_PCREL22 0x7a
2706#define R_IA64_PCREL64I 0x7b
2707#define R_IA64_IPLTMSB 0x80
2708#define R_IA64_IPLTLSB 0x81
2709#define R_IA64_COPY 0x84
2710#define R_IA64_SUB 0x85
2711#define R_IA64_LTOFF22X 0x86
2712#define R_IA64_LDXMOV 0x87
2713#define R_IA64_TPREL14 0x91
2714#define R_IA64_TPREL22 0x92
2715#define R_IA64_TPREL64I 0x93
2716#define R_IA64_TPREL64MSB 0x96
2717#define R_IA64_TPREL64LSB 0x97
2718#define R_IA64_LTOFF_TPREL22 0x9a
2719#define R_IA64_DTPMOD64MSB 0xa6
2720#define R_IA64_DTPMOD64LSB 0xa7
2721#define R_IA64_LTOFF_DTPMOD22 0xaa
2722#define R_IA64_DTPREL14 0xb1
2723#define R_IA64_DTPREL22 0xb2
2724#define R_IA64_DTPREL64I 0xb3
2725#define R_IA64_DTPREL32MSB 0xb4
2726#define R_IA64_DTPREL32LSB 0xb5
2727#define R_IA64_DTPREL64MSB 0xb6
2728#define R_IA64_DTPREL64LSB 0xb7
2729#define R_IA64_LTOFF_DTPREL22 0xba
2730
2731
2732#define EF_SH_MACH_MASK 0x1f
2733#define EF_SH_UNKNOWN 0x0
2734#define EF_SH1 0x1
2735#define EF_SH2 0x2
2736#define EF_SH3 0x3
2737#define EF_SH_DSP 0x4
2738#define EF_SH3_DSP 0x5
2739#define EF_SH4AL_DSP 0x6
2740#define EF_SH3E 0x8
2741#define EF_SH4 0x9
2742#define EF_SH2E 0xb
2743#define EF_SH4A 0xc
2744#define EF_SH2A 0xd
2745#define EF_SH4_NOFPU 0x10
2746#define EF_SH4A_NOFPU 0x11
2747#define EF_SH4_NOMMU_NOFPU 0x12
2748#define EF_SH2A_NOFPU 0x13
2749#define EF_SH3_NOMMU 0x14
2750#define EF_SH2A_SH4_NOFPU 0x15
2751#define EF_SH2A_SH3_NOFPU 0x16
2752#define EF_SH2A_SH4 0x17
2753#define EF_SH2A_SH3E 0x18
2754
2755#define R_SH_NONE 0
2756#define R_SH_DIR32 1
2757#define R_SH_REL32 2
2758#define R_SH_DIR8WPN 3
2759#define R_SH_IND12W 4
2760#define R_SH_DIR8WPL 5
2761#define R_SH_DIR8WPZ 6
2762#define R_SH_DIR8BP 7
2763#define R_SH_DIR8W 8
2764#define R_SH_DIR8L 9
2765#define R_SH_SWITCH16 25
2766#define R_SH_SWITCH32 26
2767#define R_SH_USES 27
2768#define R_SH_COUNT 28
2769#define R_SH_ALIGN 29
2770#define R_SH_CODE 30
2771#define R_SH_DATA 31
2772#define R_SH_LABEL 32
2773#define R_SH_SWITCH8 33
2774#define R_SH_GNU_VTINHERIT 34
2775#define R_SH_GNU_VTENTRY 35
2776#define R_SH_TLS_GD_32 144
2777#define R_SH_TLS_LD_32 145
2778#define R_SH_TLS_LDO_32 146
2779#define R_SH_TLS_IE_32 147
2780#define R_SH_TLS_LE_32 148
2781#define R_SH_TLS_DTPMOD32 149
2782#define R_SH_TLS_DTPOFF32 150
2783#define R_SH_TLS_TPOFF32 151
2784#define R_SH_GOT32 160
2785#define R_SH_PLT32 161
2786#define R_SH_COPY 162
2787#define R_SH_GLOB_DAT 163
2788#define R_SH_JMP_SLOT 164
2789#define R_SH_RELATIVE 165
2790#define R_SH_GOTOFF 166
2791#define R_SH_GOTPC 167
2792#define R_SH_GOT20 201
2793#define R_SH_GOTOFF20 202
2794#define R_SH_GOTFUNCDESC 203
2795#define R_SH_GOTFUNCDEST20 204
2796#define R_SH_GOTOFFFUNCDESC 205
2797#define R_SH_GOTOFFFUNCDEST20 206
2798#define R_SH_FUNCDESC 207
2799#define R_SH_FUNCDESC_VALUE 208
2800
2801#define R_SH_NUM 256
2802
2803
2804
2805#define R_390_NONE 0
2806#define R_390_8 1
2807#define R_390_12 2
2808#define R_390_16 3
2809#define R_390_32 4
2810#define R_390_PC32 5
2811#define R_390_GOT12 6
2812#define R_390_GOT32 7
2813#define R_390_PLT32 8
2814#define R_390_COPY 9
2815#define R_390_GLOB_DAT 10
2816#define R_390_JMP_SLOT 11
2817#define R_390_RELATIVE 12
2818#define R_390_GOTOFF32 13
2819#define R_390_GOTPC 14
2820#define R_390_GOT16 15
2821#define R_390_PC16 16
2822#define R_390_PC16DBL 17
2823#define R_390_PLT16DBL 18
2824#define R_390_PC32DBL 19
2825#define R_390_PLT32DBL 20
2826#define R_390_GOTPCDBL 21
2827#define R_390_64 22
2828#define R_390_PC64 23
2829#define R_390_GOT64 24
2830#define R_390_PLT64 25
2831#define R_390_GOTENT 26
2832#define R_390_GOTOFF16 27
2833#define R_390_GOTOFF64 28
2834#define R_390_GOTPLT12 29
2835#define R_390_GOTPLT16 30
2836#define R_390_GOTPLT32 31
2837#define R_390_GOTPLT64 32
2838#define R_390_GOTPLTENT 33
2839#define R_390_PLTOFF16 34
2840#define R_390_PLTOFF32 35
2841#define R_390_PLTOFF64 36
2842#define R_390_TLS_LOAD 37
2843#define R_390_TLS_GDCALL 38
2844
2845#define R_390_TLS_LDCALL 39
2846
2847#define R_390_TLS_GD32 40
2848
2849#define R_390_TLS_GD64 41
2850
2851#define R_390_TLS_GOTIE12 42
2852
2853#define R_390_TLS_GOTIE32 43
2854
2855#define R_390_TLS_GOTIE64 44
2856
2857#define R_390_TLS_LDM32 45
2858
2859#define R_390_TLS_LDM64 46
2860
2861#define R_390_TLS_IE32 47
2862
2863#define R_390_TLS_IE64 48
2864
2865#define R_390_TLS_IEENT 49
2866
2867#define R_390_TLS_LE32 50
2868
2869#define R_390_TLS_LE64 51
2870
2871#define R_390_TLS_LDO32 52
2872
2873#define R_390_TLS_LDO64 53
2874
2875#define R_390_TLS_DTPMOD 54
2876#define R_390_TLS_DTPOFF 55
2877#define R_390_TLS_TPOFF 56
2878
2879#define R_390_20 57
2880#define R_390_GOT20 58
2881#define R_390_GOTPLT20 59
2882#define R_390_TLS_GOTIE20 60
2883
2884
2885#define R_390_NUM 61
2886
2887
2888
2889#define R_CRIS_NONE 0
2890#define R_CRIS_8 1
2891#define R_CRIS_16 2
2892#define R_CRIS_32 3
2893#define R_CRIS_8_PCREL 4
2894#define R_CRIS_16_PCREL 5
2895#define R_CRIS_32_PCREL 6
2896#define R_CRIS_GNU_VTINHERIT 7
2897#define R_CRIS_GNU_VTENTRY 8
2898#define R_CRIS_COPY 9
2899#define R_CRIS_GLOB_DAT 10
2900#define R_CRIS_JUMP_SLOT 11
2901#define R_CRIS_RELATIVE 12
2902#define R_CRIS_16_GOT 13
2903#define R_CRIS_32_GOT 14
2904#define R_CRIS_16_GOTPLT 15
2905#define R_CRIS_32_GOTPLT 16
2906#define R_CRIS_32_GOTREL 17
2907#define R_CRIS_32_PLT_GOTREL 18
2908#define R_CRIS_32_PLT_PCREL 19
2909
2910#define R_CRIS_NUM 20
2911
2912
2913
2914#define R_X86_64_NONE 0
2915#define R_X86_64_64 1
2916#define R_X86_64_PC32 2
2917#define R_X86_64_GOT32 3
2918#define R_X86_64_PLT32 4
2919#define R_X86_64_COPY 5
2920#define R_X86_64_GLOB_DAT 6
2921#define R_X86_64_JUMP_SLOT 7
2922#define R_X86_64_RELATIVE 8
2923#define R_X86_64_GOTPCREL 9
2924
2925#define R_X86_64_32 10
2926#define R_X86_64_32S 11
2927#define R_X86_64_16 12
2928#define R_X86_64_PC16 13
2929#define R_X86_64_8 14
2930#define R_X86_64_PC8 15
2931#define R_X86_64_DTPMOD64 16
2932#define R_X86_64_DTPOFF64 17
2933#define R_X86_64_TPOFF64 18
2934#define R_X86_64_TLSGD 19
2935
2936#define R_X86_64_TLSLD 20
2937
2938#define R_X86_64_DTPOFF32 21
2939#define R_X86_64_GOTTPOFF 22
2940
2941#define R_X86_64_TPOFF32 23
2942#define R_X86_64_PC64 24
2943#define R_X86_64_GOTOFF64 25
2944#define R_X86_64_GOTPC32 26
2945#define R_X86_64_GOT64 27
2946#define R_X86_64_GOTPCREL64 28
2947#define R_X86_64_GOTPC64 29
2948#define R_X86_64_GOTPLT64 30
2949#define R_X86_64_PLTOFF64 31
2950#define R_X86_64_SIZE32 32
2951#define R_X86_64_SIZE64 33
2952
2953#define R_X86_64_GOTPC32_TLSDESC 34
2954#define R_X86_64_TLSDESC_CALL 35
2955
2956#define R_X86_64_TLSDESC 36
2957#define R_X86_64_IRELATIVE 37
2958#define R_X86_64_RELATIVE64 38
2959#define R_X86_64_GOTPCRELX 41
2960#define R_X86_64_REX_GOTPCRELX 42
2961#define R_X86_64_NUM 43
2962
2963
2964
2965#define R_MN10300_NONE 0
2966#define R_MN10300_32 1
2967#define R_MN10300_16 2
2968#define R_MN10300_8 3
2969#define R_MN10300_PCREL32 4
2970#define R_MN10300_PCREL16 5
2971#define R_MN10300_PCREL8 6
2972#define R_MN10300_GNU_VTINHERIT 7
2973#define R_MN10300_GNU_VTENTRY 8
2974#define R_MN10300_24 9
2975#define R_MN10300_GOTPC32 10
2976#define R_MN10300_GOTPC16 11
2977#define R_MN10300_GOTOFF32 12
2978#define R_MN10300_GOTOFF24 13
2979#define R_MN10300_GOTOFF16 14
2980#define R_MN10300_PLT32 15
2981#define R_MN10300_PLT16 16
2982#define R_MN10300_GOT32 17
2983#define R_MN10300_GOT24 18
2984#define R_MN10300_GOT16 19
2985#define R_MN10300_COPY 20
2986#define R_MN10300_GLOB_DAT 21
2987#define R_MN10300_JMP_SLOT 22
2988#define R_MN10300_RELATIVE 23
2989
2990#define R_MN10300_NUM 24
2991
2992
2993
2994#define R_M32R_NONE 0
2995#define R_M32R_16 1
2996#define R_M32R_32 2
2997#define R_M32R_24 3
2998#define R_M32R_10_PCREL 4
2999#define R_M32R_18_PCREL 5
3000#define R_M32R_26_PCREL 6
3001#define R_M32R_HI16_ULO 7
3002#define R_M32R_HI16_SLO 8
3003#define R_M32R_LO16 9
3004#define R_M32R_SDA16 10
3005#define R_M32R_GNU_VTINHERIT 11
3006#define R_M32R_GNU_VTENTRY 12
3007
3008#define R_M32R_16_RELA 33
3009#define R_M32R_32_RELA 34
3010#define R_M32R_24_RELA 35
3011#define R_M32R_10_PCREL_RELA 36
3012#define R_M32R_18_PCREL_RELA 37
3013#define R_M32R_26_PCREL_RELA 38
3014#define R_M32R_HI16_ULO_RELA 39
3015#define R_M32R_HI16_SLO_RELA 40
3016#define R_M32R_LO16_RELA 41
3017#define R_M32R_SDA16_RELA 42
3018#define R_M32R_RELA_GNU_VTINHERIT 43
3019#define R_M32R_RELA_GNU_VTENTRY 44
3020#define R_M32R_REL32 45
3021
3022#define R_M32R_GOT24 48
3023#define R_M32R_26_PLTREL 49
3024#define R_M32R_COPY 50
3025#define R_M32R_GLOB_DAT 51
3026#define R_M32R_JMP_SLOT 52
3027#define R_M32R_RELATIVE 53
3028#define R_M32R_GOTOFF 54
3029#define R_M32R_GOTPC24 55
3030#define R_M32R_GOT16_HI_ULO 56
3031
3032#define R_M32R_GOT16_HI_SLO 57
3033
3034#define R_M32R_GOT16_LO 58
3035#define R_M32R_GOTPC_HI_ULO 59
3036
3037#define R_M32R_GOTPC_HI_SLO 60
3038
3039#define R_M32R_GOTPC_LO 61
3040
3041#define R_M32R_GOTOFF_HI_ULO 62
3042
3043#define R_M32R_GOTOFF_HI_SLO 63
3044
3045#define R_M32R_GOTOFF_LO 64
3046#define R_M32R_NUM 256
3047
3048#define R_MICROBLAZE_NONE 0
3049#define R_MICROBLAZE_32 1
3050#define R_MICROBLAZE_32_PCREL 2
3051#define R_MICROBLAZE_64_PCREL 3
3052#define R_MICROBLAZE_32_PCREL_LO 4
3053#define R_MICROBLAZE_64 5
3054#define R_MICROBLAZE_32_LO 6
3055#define R_MICROBLAZE_SRO32 7
3056#define R_MICROBLAZE_SRW32 8
3057#define R_MICROBLAZE_64_NONE 9
3058#define R_MICROBLAZE_32_SYM_OP_SYM 10
3059#define R_MICROBLAZE_GNU_VTINHERIT 11
3060#define R_MICROBLAZE_GNU_VTENTRY 12
3061#define R_MICROBLAZE_GOTPC_64 13
3062#define R_MICROBLAZE_GOT_64 14
3063#define R_MICROBLAZE_PLT_64 15
3064#define R_MICROBLAZE_REL 16
3065#define R_MICROBLAZE_JUMP_SLOT 17
3066#define R_MICROBLAZE_GLOB_DAT 18
3067#define R_MICROBLAZE_GOTOFF_64 19
3068#define R_MICROBLAZE_GOTOFF_32 20
3069#define R_MICROBLAZE_COPY 21
3070#define R_MICROBLAZE_TLS 22
3071#define R_MICROBLAZE_TLSGD 23
3072#define R_MICROBLAZE_TLSLD 24
3073#define R_MICROBLAZE_TLSDTPMOD32 25
3074#define R_MICROBLAZE_TLSDTPREL32 26
3075#define R_MICROBLAZE_TLSDTPREL64 27
3076#define R_MICROBLAZE_TLSGOTTPREL32 28
3077#define R_MICROBLAZE_TLSTPREL32 29
3078
3079#define DT_NIOS2_GP 0x70000002
3080
3081#define R_NIOS2_NONE 0
3082#define R_NIOS2_S16 1
3083#define R_NIOS2_U16 2
3084#define R_NIOS2_PCREL16 3
3085#define R_NIOS2_CALL26 4
3086#define R_NIOS2_IMM5 5
3087#define R_NIOS2_CACHE_OPX 6
3088#define R_NIOS2_IMM6 7
3089#define R_NIOS2_IMM8 8
3090#define R_NIOS2_HI16 9
3091#define R_NIOS2_LO16 10
3092#define R_NIOS2_HIADJ16 11
3093#define R_NIOS2_BFD_RELOC_32 12
3094#define R_NIOS2_BFD_RELOC_16 13
3095#define R_NIOS2_BFD_RELOC_8 14
3096#define R_NIOS2_GPREL 15
3097#define R_NIOS2_GNU_VTINHERIT 16
3098#define R_NIOS2_GNU_VTENTRY 17
3099#define R_NIOS2_UJMP 18
3100#define R_NIOS2_CJMP 19
3101#define R_NIOS2_CALLR 20
3102#define R_NIOS2_ALIGN 21
3103#define R_NIOS2_GOT16 22
3104#define R_NIOS2_CALL16 23
3105#define R_NIOS2_GOTOFF_LO 24
3106#define R_NIOS2_GOTOFF_HA 25
3107#define R_NIOS2_PCREL_LO 26
3108#define R_NIOS2_PCREL_HA 27
3109#define R_NIOS2_TLS_GD16 28
3110#define R_NIOS2_TLS_LDM16 29
3111#define R_NIOS2_TLS_LDO16 30
3112#define R_NIOS2_TLS_IE16 31
3113#define R_NIOS2_TLS_LE16 32
3114#define R_NIOS2_TLS_DTPMOD 33
3115#define R_NIOS2_TLS_DTPREL 34
3116#define R_NIOS2_TLS_TPREL 35
3117#define R_NIOS2_COPY 36
3118#define R_NIOS2_GLOB_DAT 37
3119#define R_NIOS2_JUMP_SLOT 38
3120#define R_NIOS2_RELATIVE 39
3121#define R_NIOS2_GOTOFF 40
3122#define R_NIOS2_CALL26_NOAT 41
3123#define R_NIOS2_GOT_LO 42
3124#define R_NIOS2_GOT_HA 43
3125#define R_NIOS2_CALL_LO 44
3126#define R_NIOS2_CALL_HA 45
3127
3128#define R_OR1K_NONE 0
3129#define R_OR1K_32 1
3130#define R_OR1K_16 2
3131#define R_OR1K_8 3
3132#define R_OR1K_LO_16_IN_INSN 4
3133#define R_OR1K_HI_16_IN_INSN 5
3134#define R_OR1K_INSN_REL_26 6
3135#define R_OR1K_GNU_VTENTRY 7
3136#define R_OR1K_GNU_VTINHERIT 8
3137#define R_OR1K_32_PCREL 9
3138#define R_OR1K_16_PCREL 10
3139#define R_OR1K_8_PCREL 11
3140#define R_OR1K_GOTPC_HI16 12
3141#define R_OR1K_GOTPC_LO16 13
3142#define R_OR1K_GOT16 14
3143#define R_OR1K_PLT26 15
3144#define R_OR1K_GOTOFF_HI16 16
3145#define R_OR1K_GOTOFF_LO16 17
3146#define R_OR1K_COPY 18
3147#define R_OR1K_GLOB_DAT 19
3148#define R_OR1K_JMP_SLOT 20
3149#define R_OR1K_RELATIVE 21
3150#define R_OR1K_TLS_GD_HI16 22
3151#define R_OR1K_TLS_GD_LO16 23
3152#define R_OR1K_TLS_LDM_HI16 24
3153#define R_OR1K_TLS_LDM_LO16 25
3154#define R_OR1K_TLS_LDO_HI16 26
3155#define R_OR1K_TLS_LDO_LO16 27
3156#define R_OR1K_TLS_IE_HI16 28
3157#define R_OR1K_TLS_IE_LO16 29
3158#define R_OR1K_TLS_LE_HI16 30
3159#define R_OR1K_TLS_LE_LO16 31
3160#define R_OR1K_TLS_TPOFF 32
3161#define R_OR1K_TLS_DTPOFF 33
3162#define R_OR1K_TLS_DTPMOD 34
3163
3164#define R_BPF_NONE 0
3165#define R_BPF_MAP_FD 1
3166
3167#define R_RISCV_NONE 0
3168#define R_RISCV_32 1
3169#define R_RISCV_64 2
3170#define R_RISCV_RELATIVE 3
3171#define R_RISCV_COPY 4
3172#define R_RISCV_JUMP_SLOT 5
3173#define R_RISCV_TLS_DTPMOD32 6
3174#define R_RISCV_TLS_DTPMOD64 7
3175#define R_RISCV_TLS_DTPREL32 8
3176#define R_RISCV_TLS_DTPREL64 9
3177#define R_RISCV_TLS_TPREL32 10
3178#define R_RISCV_TLS_TPREL64 11
3179
3180#define R_RISCV_BRANCH 16
3181#define R_RISCV_JAL 17
3182#define R_RISCV_CALL 18
3183#define R_RISCV_CALL_PLT 19
3184#define R_RISCV_GOT_HI20 20
3185#define R_RISCV_TLS_GOT_HI20 21
3186#define R_RISCV_TLS_GD_HI20 22
3187#define R_RISCV_PCREL_HI20 23
3188#define R_RISCV_PCREL_LO12_I 24
3189#define R_RISCV_PCREL_LO12_S 25
3190#define R_RISCV_HI20 26
3191#define R_RISCV_LO12_I 27
3192#define R_RISCV_LO12_S 28
3193#define R_RISCV_TPREL_HI20 29
3194#define R_RISCV_TPREL_LO12_I 30
3195#define R_RISCV_TPREL_LO12_S 31
3196#define R_RISCV_TPREL_ADD 32
3197#define R_RISCV_ADD8 33
3198#define R_RISCV_ADD16 34
3199#define R_RISCV_ADD32 35
3200#define R_RISCV_ADD64 36
3201#define R_RISCV_SUB8 37
3202#define R_RISCV_SUB16 38
3203#define R_RISCV_SUB32 39
3204#define R_RISCV_SUB64 40
3205#define R_RISCV_GNU_VTINHERIT 41
3206#define R_RISCV_GNU_VTENTRY 42
3207#define R_RISCV_ALIGN 43
3208#define R_RISCV_RVC_BRANCH 44
3209#define R_RISCV_RVC_JUMP 45
3210#define R_RISCV_RVC_LUI 46
3211#define R_RISCV_GPREL_I 47
3212#define R_RISCV_GPREL_S 48
3213#define R_RISCV_TPREL_I 49
3214#define R_RISCV_TPREL_S 50
3215#define R_RISCV_RELAX 51
3216#define R_RISCV_SUB6 52
3217#define R_RISCV_SET6 53
3218#define R_RISCV_SET8 54
3219#define R_RISCV_SET16 55
3220#define R_RISCV_SET32 56
3221#define R_RISCV_32_PCREL 57
3222
3223#ifdef __cplusplus
3224}
3225#endif
3226
3227
3228#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/netinet/tcp.h deleted-253
...@@ -1,253 +0,0 @@
1#ifndef _NETINET_TCP_H
2#define _NETINET_TCP_H
3
4#include <features.h>
5
6#define TCP_NODELAY 1
7#define TCP_MAXSEG 2
8#define TCP_CORK 3
9#define TCP_KEEPIDLE 4
10#define TCP_KEEPINTVL 5
11#define TCP_KEEPCNT 6
12#define TCP_SYNCNT 7
13#define TCP_LINGER2 8
14#define TCP_DEFER_ACCEPT 9
15#define TCP_WINDOW_CLAMP 10
16#define TCP_INFO 11
17#define TCP_QUICKACK 12
18#define TCP_CONGESTION 13
19#define TCP_MD5SIG 14
20#define TCP_THIN_LINEAR_TIMEOUTS 16
21#define TCP_THIN_DUPACK 17
22#define TCP_USER_TIMEOUT 18
23#define TCP_REPAIR 19
24#define TCP_REPAIR_QUEUE 20
25#define TCP_QUEUE_SEQ 21
26#define TCP_REPAIR_OPTIONS 22
27#define TCP_FASTOPEN 23
28#define TCP_TIMESTAMP 24
29#define TCP_NOTSENT_LOWAT 25
30#define TCP_CC_INFO 26
31#define TCP_SAVE_SYN 27
32#define TCP_SAVED_SYN 28
33#define TCP_REPAIR_WINDOW 29
34#define TCP_FASTOPEN_CONNECT 30
35#define TCP_ULP 31
36#define TCP_MD5SIG_EXT 32
37#define TCP_FASTOPEN_KEY 33
38#define TCP_FASTOPEN_NO_COOKIE 34
39
40#define TCP_ESTABLISHED 1
41#define TCP_SYN_SENT 2
42#define TCP_SYN_RECV 3
43#define TCP_FIN_WAIT1 4
44#define TCP_FIN_WAIT2 5
45#define TCP_TIME_WAIT 6
46#define TCP_CLOSE 7
47#define TCP_CLOSE_WAIT 8
48#define TCP_LAST_ACK 9
49#define TCP_LISTEN 10
50#define TCP_CLOSING 11
51
52enum {
53 TCP_NLA_PAD,
54 TCP_NLA_BUSY,
55 TCP_NLA_RWND_LIMITED,
56 TCP_NLA_SNDBUF_LIMITED,
57 TCP_NLA_DATA_SEGS_OUT,
58 TCP_NLA_TOTAL_RETRANS,
59 TCP_NLA_PACING_RATE,
60 TCP_NLA_DELIVERY_RATE,
61 TCP_NLA_SND_CWND,
62 TCP_NLA_REORDERING,
63 TCP_NLA_MIN_RTT,
64 TCP_NLA_RECUR_RETRANS,
65 TCP_NLA_DELIVERY_RATE_APP_LMT,
66 TCP_NLA_SNDQ_SIZE,
67 TCP_NLA_CA_STATE,
68 TCP_NLA_SND_SSTHRESH,
69};
70
71#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
72#define TCPOPT_EOL 0
73#define TCPOPT_NOP 1
74#define TCPOPT_MAXSEG 2
75#define TCPOPT_WINDOW 3
76#define TCPOPT_SACK_PERMITTED 4
77#define TCPOPT_SACK 5
78#define TCPOPT_TIMESTAMP 8
79#define TCPOLEN_SACK_PERMITTED 2
80#define TCPOLEN_WINDOW 3
81#define TCPOLEN_MAXSEG 4
82#define TCPOLEN_TIMESTAMP 10
83
84#define SOL_TCP 6
85
86#include <sys/types.h>
87#include <sys/socket.h>
88#include <stdint.h>
89#include <endian.h>
90
91typedef uint32_t tcp_seq;
92
93#define TH_FIN 0x01
94#define TH_SYN 0x02
95#define TH_RST 0x04
96#define TH_PUSH 0x08
97#define TH_ACK 0x10
98#define TH_URG 0x20
99
100struct tcphdr {
101#ifdef _GNU_SOURCE
102#ifdef __GNUC__
103 __extension__
104#endif
105 union { struct {
106
107 uint16_t source;
108 uint16_t dest;
109 uint32_t seq;
110 uint32_t ack_seq;
111#if __BYTE_ORDER == __LITTLE_ENDIAN
112 uint16_t res1:4;
113 uint16_t doff:4;
114 uint16_t fin:1;
115 uint16_t syn:1;
116 uint16_t rst:1;
117 uint16_t psh:1;
118 uint16_t ack:1;
119 uint16_t urg:1;
120 uint16_t res2:2;
121#else
122 uint16_t doff:4;
123 uint16_t res1:4;
124 uint16_t res2:2;
125 uint16_t urg:1;
126 uint16_t ack:1;
127 uint16_t psh:1;
128 uint16_t rst:1;
129 uint16_t syn:1;
130 uint16_t fin:1;
131#endif
132 uint16_t window;
133 uint16_t check;
134 uint16_t urg_ptr;
135
136 }; struct {
137#endif
138
139 uint16_t th_sport;
140 uint16_t th_dport;
141 uint32_t th_seq;
142 uint32_t th_ack;
143#if __BYTE_ORDER == __LITTLE_ENDIAN
144 uint8_t th_x2:4;
145 uint8_t th_off:4;
146#else
147 uint8_t th_off:4;
148 uint8_t th_x2:4;
149#endif
150 uint8_t th_flags;
151 uint16_t th_win;
152 uint16_t th_sum;
153 uint16_t th_urp;
154
155#ifdef _GNU_SOURCE
156 }; };
157#endif
158};
159#endif
160
161#ifdef _GNU_SOURCE
162#define TCPI_OPT_TIMESTAMPS 1
163#define TCPI_OPT_SACK 2
164#define TCPI_OPT_WSCALE 4
165#define TCPI_OPT_ECN 8
166
167#define TCP_CA_Open 0
168#define TCP_CA_Disorder 1
169#define TCP_CA_CWR 2
170#define TCP_CA_Recovery 3
171#define TCP_CA_Loss 4
172
173struct tcp_info {
174 uint8_t tcpi_state;
175 uint8_t tcpi_ca_state;
176 uint8_t tcpi_retransmits;
177 uint8_t tcpi_probes;
178 uint8_t tcpi_backoff;
179 uint8_t tcpi_options;
180 uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
181 uint8_t tcpi_delivery_rate_app_limited : 1;
182 uint32_t tcpi_rto;
183 uint32_t tcpi_ato;
184 uint32_t tcpi_snd_mss;
185 uint32_t tcpi_rcv_mss;
186 uint32_t tcpi_unacked;
187 uint32_t tcpi_sacked;
188 uint32_t tcpi_lost;
189 uint32_t tcpi_retrans;
190 uint32_t tcpi_fackets;
191 uint32_t tcpi_last_data_sent;
192 uint32_t tcpi_last_ack_sent;
193 uint32_t tcpi_last_data_recv;
194 uint32_t tcpi_last_ack_recv;
195 uint32_t tcpi_pmtu;
196 uint32_t tcpi_rcv_ssthresh;
197 uint32_t tcpi_rtt;
198 uint32_t tcpi_rttvar;
199 uint32_t tcpi_snd_ssthresh;
200 uint32_t tcpi_snd_cwnd;
201 uint32_t tcpi_advmss;
202 uint32_t tcpi_reordering;
203 uint32_t tcpi_rcv_rtt;
204 uint32_t tcpi_rcv_space;
205 uint32_t tcpi_total_retrans;
206 uint64_t tcpi_pacing_rate;
207 uint64_t tcpi_max_pacing_rate;
208 uint64_t tcpi_bytes_acked;
209 uint64_t tcpi_bytes_received;
210 uint32_t tcpi_segs_out;
211 uint32_t tcpi_segs_in;
212 uint32_t tcpi_notsent_bytes;
213 uint32_t tcpi_min_rtt;
214 uint32_t tcpi_data_segs_in;
215 uint32_t tcpi_data_segs_out;
216 uint64_t tcpi_delivery_rate;
217 uint64_t tcpi_busy_time;
218 uint64_t tcpi_rwnd_limited;
219 uint64_t tcpi_sndbuf_limited;
220};
221
222#define TCP_MD5SIG_MAXKEYLEN 80
223
224#define TCP_MD5SIG_FLAG_PREFIX 1
225
226struct tcp_md5sig {
227 struct sockaddr_storage tcpm_addr;
228 uint8_t tcpm_flags;
229 uint8_t tcpm_prefixlen;
230 uint16_t tcpm_keylen;
231 uint32_t __tcpm_pad;
232 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
233};
234
235struct tcp_diag_md5sig {
236 uint8_t tcpm_family;
237 uint8_t tcpm_prefixlen;
238 uint16_t tcpm_keylen;
239 uint32_t tcpm_addr[4];
240 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
241};
242
243struct tcp_repair_window {
244 uint32_t snd_wl1;
245 uint32_t snd_wnd;
246 uint32_t max_window;
247 uint32_t rcv_wnd;
248 uint32_t rcv_wup;
249};
250
251#endif
252
253#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/netinet/udp.h deleted-40
...@@ -1,40 +0,0 @@
1#ifndef _NETINET_UDP_H
2#define _NETINET_UDP_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9#include <stdint.h>
10
11#ifdef _GNU_SOURCE
12#define uh_sport source
13#define uh_dport dest
14#define uh_ulen len
15#define uh_sum check
16#endif
17
18struct udphdr {
19 uint16_t uh_sport;
20 uint16_t uh_dport;
21 uint16_t uh_ulen;
22 uint16_t uh_sum;
23};
24
25#define UDP_CORK 1
26#define UDP_ENCAP 100
27
28#define UDP_ENCAP_ESPINUDP_NON_IKE 1
29#define UDP_ENCAP_ESPINUDP 2
30#define UDP_ENCAP_L2TPINUDP 3
31#define UDP_ENCAP_GTP0 4
32#define UDP_ENCAP_GTP1U 5
33
34#define SOL_UDP 17
35
36#ifdef __cplusplus
37}
38#endif
39
40#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/signal.h deleted-277
...@@ -1,277 +0,0 @@
1#ifndef _SIGNAL_H
2#define _SIGNAL_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
10#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
11 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
12 || defined(_BSD_SOURCE)
13
14#ifdef _GNU_SOURCE
15#define __ucontext ucontext
16#endif
17
18#define __NEED_size_t
19#define __NEED_pid_t
20#define __NEED_uid_t
21#define __NEED_struct_timespec
22#define __NEED_pthread_t
23#define __NEED_pthread_attr_t
24#define __NEED_time_t
25#define __NEED_clock_t
26#define __NEED_sigset_t
27
28#include <bits/alltypes.h>
29
30#define SIG_BLOCK 0
31#define SIG_UNBLOCK 1
32#define SIG_SETMASK 2
33
34#define SI_ASYNCNL (-60)
35#define SI_TKILL (-6)
36#define SI_SIGIO (-5)
37#define SI_ASYNCIO (-4)
38#define SI_MESGQ (-3)
39#define SI_TIMER (-2)
40#define SI_QUEUE (-1)
41#define SI_USER 0
42#define SI_KERNEL 128
43
44typedef struct sigaltstack stack_t;
45
46#endif
47
48#include <bits/signal.h>
49
50#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
51 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
52 || defined(_BSD_SOURCE)
53
54#define SIG_HOLD ((void (*)(int)) 2)
55
56#define FPE_INTDIV 1
57#define FPE_INTOVF 2
58#define FPE_FLTDIV 3
59#define FPE_FLTOVF 4
60#define FPE_FLTUND 5
61#define FPE_FLTRES 6
62#define FPE_FLTINV 7
63#define FPE_FLTSUB 8
64
65#define ILL_ILLOPC 1
66#define ILL_ILLOPN 2
67#define ILL_ILLADR 3
68#define ILL_ILLTRP 4
69#define ILL_PRVOPC 5
70#define ILL_PRVREG 6
71#define ILL_COPROC 7
72#define ILL_BADSTK 8
73
74#define SEGV_MAPERR 1
75#define SEGV_ACCERR 2
76#define SEGV_BNDERR 3
77#define SEGV_PKUERR 4
78
79#define BUS_ADRALN 1
80#define BUS_ADRERR 2
81#define BUS_OBJERR 3
82#define BUS_MCEERR_AR 4
83#define BUS_MCEERR_AO 5
84
85#define CLD_EXITED 1
86#define CLD_KILLED 2
87#define CLD_DUMPED 3
88#define CLD_TRAPPED 4
89#define CLD_STOPPED 5
90#define CLD_CONTINUED 6
91
92union sigval {
93 int sival_int;
94 void *sival_ptr;
95};
96
97typedef struct {
98#ifdef __SI_SWAP_ERRNO_CODE
99 int si_signo, si_code, si_errno;
100#else
101 int si_signo, si_errno, si_code;
102#endif
103 union {
104 char __pad[128 - 2*sizeof(int) - sizeof(long)];
105 struct {
106 union {
107 struct {
108 pid_t si_pid;
109 uid_t si_uid;
110 } __piduid;
111 struct {
112 int si_timerid;
113 int si_overrun;
114 } __timer;
115 } __first;
116 union {
117 union sigval si_value;
118 struct {
119 int si_status;
120 clock_t si_utime, si_stime;
121 } __sigchld;
122 } __second;
123 } __si_common;
124 struct {
125 void *si_addr;
126 short si_addr_lsb;
127 union {
128 struct {
129 void *si_lower;
130 void *si_upper;
131 } __addr_bnd;
132 unsigned si_pkey;
133 } __first;
134 } __sigfault;
135 struct {
136 long si_band;
137 int si_fd;
138 } __sigpoll;
139 struct {
140 void *si_call_addr;
141 int si_syscall;
142 unsigned si_arch;
143 } __sigsys;
144 } __si_fields;
145} siginfo_t;
146#define si_pid __si_fields.__si_common.__first.__piduid.si_pid
147#define si_uid __si_fields.__si_common.__first.__piduid.si_uid
148#define si_status __si_fields.__si_common.__second.__sigchld.si_status
149#define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
150#define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
151#define si_value __si_fields.__si_common.__second.si_value
152#define si_addr __si_fields.__sigfault.si_addr
153#define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
154#define si_lower __si_fields.__sigfault.__first.__addr_bnd.si_lower
155#define si_upper __si_fields.__sigfault.__first.__addr_bnd.si_upper
156#define si_pkey __si_fields.__sigfault.__first.si_pkey
157#define si_band __si_fields.__sigpoll.si_band
158#define si_fd __si_fields.__sigpoll.si_fd
159#define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
160#define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
161#define si_ptr si_value.sival_ptr
162#define si_int si_value.sival_int
163#define si_call_addr __si_fields.__sigsys.si_call_addr
164#define si_syscall __si_fields.__sigsys.si_syscall
165#define si_arch __si_fields.__sigsys.si_arch
166
167struct sigaction {
168 union {
169 void (*sa_handler)(int);
170 void (*sa_sigaction)(int, siginfo_t *, void *);
171 } __sa_handler;
172 sigset_t sa_mask;
173 int sa_flags;
174 void (*sa_restorer)(void);
175};
176#define sa_handler __sa_handler.sa_handler
177#define sa_sigaction __sa_handler.sa_sigaction
178
179struct sigevent {
180 union sigval sigev_value;
181 int sigev_signo;
182 int sigev_notify;
183 void (*sigev_notify_function)(union sigval);
184 pthread_attr_t *sigev_notify_attributes;
185 char __pad[56-3*sizeof(long)];
186};
187
188#define SIGEV_SIGNAL 0
189#define SIGEV_NONE 1
190#define SIGEV_THREAD 2
191
192int __libc_current_sigrtmin(void);
193int __libc_current_sigrtmax(void);
194
195#define SIGRTMIN (__libc_current_sigrtmin())
196#define SIGRTMAX (__libc_current_sigrtmax())
197
198int kill(pid_t, int);
199
200int sigemptyset(sigset_t *);
201int sigfillset(sigset_t *);
202int sigaddset(sigset_t *, int);
203int sigdelset(sigset_t *, int);
204int sigismember(const sigset_t *, int);
205
206int sigprocmask(int, const sigset_t *__restrict, sigset_t *__restrict);
207int sigsuspend(const sigset_t *);
208int sigaction(int, const struct sigaction *__restrict, struct sigaction *__restrict);
209int sigpending(sigset_t *);
210int sigwait(const sigset_t *__restrict, int *__restrict);
211int sigwaitinfo(const sigset_t *__restrict, siginfo_t *__restrict);
212int sigtimedwait(const sigset_t *__restrict, siginfo_t *__restrict, const struct timespec *__restrict);
213int sigqueue(pid_t, int, union sigval);
214
215int pthread_sigmask(int, const sigset_t *__restrict, sigset_t *__restrict);
216int pthread_kill(pthread_t, int);
217
218void psiginfo(const siginfo_t *, const char *);
219void psignal(int, const char *);
220
221#endif
222
223#if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
224int killpg(pid_t, int);
225int sigaltstack(const stack_t *__restrict, stack_t *__restrict);
226int sighold(int);
227int sigignore(int);
228int siginterrupt(int, int);
229int sigpause(int);
230int sigrelse(int);
231void (*sigset(int, void (*)(int)))(int);
232#define TRAP_BRKPT 1
233#define TRAP_TRACE 2
234#define TRAP_BRANCH 3
235#define TRAP_HWBKPT 4
236#define POLL_IN 1
237#define POLL_OUT 2
238#define POLL_MSG 3
239#define POLL_ERR 4
240#define POLL_PRI 5
241#define POLL_HUP 6
242#define SS_ONSTACK 1
243#define SS_DISABLE 2
244#define SS_AUTODISARM (1U << 31)
245#define SS_FLAG_BITS SS_AUTODISARM
246#endif
247
248#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
249#define NSIG _NSIG
250typedef void (*sig_t)(int);
251#endif
252
253#ifdef _GNU_SOURCE
254typedef void (*sighandler_t)(int);
255void (*bsd_signal(int, void (*)(int)))(int);
256int sigisemptyset(const sigset_t *);
257int sigorset (sigset_t *, const sigset_t *, const sigset_t *);
258int sigandset(sigset_t *, const sigset_t *, const sigset_t *);
259
260#define SA_NOMASK SA_NODEFER
261#define SA_ONESHOT SA_RESETHAND
262#endif
263
264#define SIG_ERR ((void (*)(int))-1)
265#define SIG_DFL ((void (*)(int)) 0)
266#define SIG_IGN ((void (*)(int)) 1)
267
268typedef int sig_atomic_t;
269
270void (*signal(int, void (*)(int)))(int);
271int raise(int);
272
273#ifdef __cplusplus
274}
275#endif
276
277#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/sys/signalfd.h deleted-45
...@@ -1,45 +0,0 @@
1#ifndef _SYS_SIGNALFD_H
2#define _SYS_SIGNALFD_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include <fcntl.h>
10
11#define __NEED_sigset_t
12
13#include <bits/alltypes.h>
14
15#define SFD_CLOEXEC O_CLOEXEC
16#define SFD_NONBLOCK O_NONBLOCK
17
18int signalfd(int, const sigset_t *, int);
19
20struct signalfd_siginfo {
21 uint32_t ssi_signo;
22 int32_t ssi_errno;
23 int32_t ssi_code;
24 uint32_t ssi_pid;
25 uint32_t ssi_uid;
26 int32_t ssi_fd;
27 uint32_t ssi_tid;
28 uint32_t ssi_band;
29 uint32_t ssi_overrun;
30 uint32_t ssi_trapno;
31 int32_t ssi_status;
32 int32_t ssi_int;
33 uint64_t ssi_ptr;
34 uint64_t ssi_utime;
35 uint64_t ssi_stime;
36 uint64_t ssi_addr;
37 uint16_t ssi_addr_lsb;
38 uint8_t pad[128-12*4-4*8-2];
39};
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/sys/socket.h deleted-350
...@@ -1,350 +0,0 @@
1#ifndef _SYS_SOCKET_H
2#define _SYS_SOCKET_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <features.h>
8
9#define __NEED_socklen_t
10#define __NEED_sa_family_t
11#define __NEED_size_t
12#define __NEED_ssize_t
13#define __NEED_uid_t
14#define __NEED_pid_t
15#define __NEED_gid_t
16#define __NEED_struct_iovec
17
18#include <bits/alltypes.h>
19
20#include <bits/socket.h>
21
22#ifdef _GNU_SOURCE
23struct ucred {
24 pid_t pid;
25 uid_t uid;
26 gid_t gid;
27};
28
29struct mmsghdr {
30 struct msghdr msg_hdr;
31 unsigned int msg_len;
32};
33
34struct timespec;
35
36int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int);
37int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *);
38#endif
39
40struct linger {
41 int l_onoff;
42 int l_linger;
43};
44
45#define SHUT_RD 0
46#define SHUT_WR 1
47#define SHUT_RDWR 2
48
49#ifndef SOCK_STREAM
50#define SOCK_STREAM 1
51#define SOCK_DGRAM 2
52#endif
53
54#define SOCK_RAW 3
55#define SOCK_RDM 4
56#define SOCK_SEQPACKET 5
57#define SOCK_DCCP 6
58#define SOCK_PACKET 10
59
60#ifndef SOCK_CLOEXEC
61#define SOCK_CLOEXEC 02000000
62#define SOCK_NONBLOCK 04000
63#endif
64
65#define PF_UNSPEC 0
66#define PF_LOCAL 1
67#define PF_UNIX PF_LOCAL
68#define PF_FILE PF_LOCAL
69#define PF_INET 2
70#define PF_AX25 3
71#define PF_IPX 4
72#define PF_APPLETALK 5
73#define PF_NETROM 6
74#define PF_BRIDGE 7
75#define PF_ATMPVC 8
76#define PF_X25 9
77#define PF_INET6 10
78#define PF_ROSE 11
79#define PF_DECnet 12
80#define PF_NETBEUI 13
81#define PF_SECURITY 14
82#define PF_KEY 15
83#define PF_NETLINK 16
84#define PF_ROUTE PF_NETLINK
85#define PF_PACKET 17
86#define PF_ASH 18
87#define PF_ECONET 19
88#define PF_ATMSVC 20
89#define PF_RDS 21
90#define PF_SNA 22
91#define PF_IRDA 23
92#define PF_PPPOX 24
93#define PF_WANPIPE 25
94#define PF_LLC 26
95#define PF_IB 27
96#define PF_MPLS 28
97#define PF_CAN 29
98#define PF_TIPC 30
99#define PF_BLUETOOTH 31
100#define PF_IUCV 32
101#define PF_RXRPC 33
102#define PF_ISDN 34
103#define PF_PHONET 35
104#define PF_IEEE802154 36
105#define PF_CAIF 37
106#define PF_ALG 38
107#define PF_NFC 39
108#define PF_VSOCK 40
109#define PF_KCM 41
110#define PF_QIPCRTR 42
111#define PF_SMC 43
112#define PF_MAX 44
113
114#define AF_UNSPEC PF_UNSPEC
115#define AF_LOCAL PF_LOCAL
116#define AF_UNIX AF_LOCAL
117#define AF_FILE AF_LOCAL
118#define AF_INET PF_INET
119#define AF_AX25 PF_AX25
120#define AF_IPX PF_IPX
121#define AF_APPLETALK PF_APPLETALK
122#define AF_NETROM PF_NETROM
123#define AF_BRIDGE PF_BRIDGE
124#define AF_ATMPVC PF_ATMPVC
125#define AF_X25 PF_X25
126#define AF_INET6 PF_INET6
127#define AF_ROSE PF_ROSE
128#define AF_DECnet PF_DECnet
129#define AF_NETBEUI PF_NETBEUI
130#define AF_SECURITY PF_SECURITY
131#define AF_KEY PF_KEY
132#define AF_NETLINK PF_NETLINK
133#define AF_ROUTE PF_ROUTE
134#define AF_PACKET PF_PACKET
135#define AF_ASH PF_ASH
136#define AF_ECONET PF_ECONET
137#define AF_ATMSVC PF_ATMSVC
138#define AF_RDS PF_RDS
139#define AF_SNA PF_SNA
140#define AF_IRDA PF_IRDA
141#define AF_PPPOX PF_PPPOX
142#define AF_WANPIPE PF_WANPIPE
143#define AF_LLC PF_LLC
144#define AF_IB PF_IB
145#define AF_MPLS PF_MPLS
146#define AF_CAN PF_CAN
147#define AF_TIPC PF_TIPC
148#define AF_BLUETOOTH PF_BLUETOOTH
149#define AF_IUCV PF_IUCV
150#define AF_RXRPC PF_RXRPC
151#define AF_ISDN PF_ISDN
152#define AF_PHONET PF_PHONET
153#define AF_IEEE802154 PF_IEEE802154
154#define AF_CAIF PF_CAIF
155#define AF_ALG PF_ALG
156#define AF_NFC PF_NFC
157#define AF_VSOCK PF_VSOCK
158#define AF_KCM PF_KCM
159#define AF_QIPCRTR PF_QIPCRTR
160#define AF_SMC PF_SMC
161#define AF_MAX PF_MAX
162
163#ifndef SO_DEBUG
164#define SO_DEBUG 1
165#define SO_REUSEADDR 2
166#define SO_TYPE 3
167#define SO_ERROR 4
168#define SO_DONTROUTE 5
169#define SO_BROADCAST 6
170#define SO_SNDBUF 7
171#define SO_RCVBUF 8
172#define SO_KEEPALIVE 9
173#define SO_OOBINLINE 10
174#define SO_NO_CHECK 11
175#define SO_PRIORITY 12
176#define SO_LINGER 13
177#define SO_BSDCOMPAT 14
178#define SO_REUSEPORT 15
179#define SO_PASSCRED 16
180#define SO_PEERCRED 17
181#define SO_RCVLOWAT 18
182#define SO_SNDLOWAT 19
183#define SO_RCVTIMEO 20
184#define SO_SNDTIMEO 21
185#define SO_ACCEPTCONN 30
186#define SO_PEERSEC 31
187#define SO_SNDBUFFORCE 32
188#define SO_RCVBUFFORCE 33
189#define SO_PROTOCOL 38
190#define SO_DOMAIN 39
191#endif
192
193#define SO_SECURITY_AUTHENTICATION 22
194#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
195#define SO_SECURITY_ENCRYPTION_NETWORK 24
196
197#define SO_BINDTODEVICE 25
198
199#define SO_ATTACH_FILTER 26
200#define SO_DETACH_FILTER 27
201#define SO_GET_FILTER SO_ATTACH_FILTER
202
203#define SO_PEERNAME 28
204#define SO_TIMESTAMP 29
205#define SCM_TIMESTAMP SO_TIMESTAMP
206
207#define SO_PASSSEC 34
208#define SO_TIMESTAMPNS 35
209#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
210#define SO_MARK 36
211#define SO_TIMESTAMPING 37
212#define SCM_TIMESTAMPING SO_TIMESTAMPING
213#define SO_RXQ_OVFL 40
214#define SO_WIFI_STATUS 41
215#define SCM_WIFI_STATUS SO_WIFI_STATUS
216#define SO_PEEK_OFF 42
217#define SO_NOFCS 43
218#define SO_LOCK_FILTER 44
219#define SO_SELECT_ERR_QUEUE 45
220#define SO_BUSY_POLL 46
221#define SO_MAX_PACING_RATE 47
222#define SO_BPF_EXTENSIONS 48
223#define SO_INCOMING_CPU 49
224#define SO_ATTACH_BPF 50
225#define SO_DETACH_BPF SO_DETACH_FILTER
226#define SO_ATTACH_REUSEPORT_CBPF 51
227#define SO_ATTACH_REUSEPORT_EBPF 52
228#define SO_CNX_ADVICE 53
229#define SCM_TIMESTAMPING_OPT_STATS 54
230#define SO_MEMINFO 55
231#define SO_INCOMING_NAPI_ID 56
232#define SO_COOKIE 57
233#define SCM_TIMESTAMPING_PKTINFO 58
234#define SO_PEERGROUPS 59
235#define SO_ZEROCOPY 60
236
237#ifndef SOL_SOCKET
238#define SOL_SOCKET 1
239#endif
240
241#define SOL_IP 0
242#define SOL_IPV6 41
243#define SOL_ICMPV6 58
244
245#define SOL_RAW 255
246#define SOL_DECNET 261
247#define SOL_X25 262
248#define SOL_PACKET 263
249#define SOL_ATM 264
250#define SOL_AAL 265
251#define SOL_IRDA 266
252#define SOL_NETBEUI 267
253#define SOL_LLC 268
254#define SOL_DCCP 269
255#define SOL_NETLINK 270
256#define SOL_TIPC 271
257#define SOL_RXRPC 272
258#define SOL_PPPOL2TP 273
259#define SOL_BLUETOOTH 274
260#define SOL_PNPIPE 275
261#define SOL_RDS 276
262#define SOL_IUCV 277
263#define SOL_CAIF 278
264#define SOL_ALG 279
265#define SOL_NFC 280
266#define SOL_KCM 281
267#define SOL_TLS 282
268
269#define SOMAXCONN 128
270
271#define MSG_OOB 0x0001
272#define MSG_PEEK 0x0002
273#define MSG_DONTROUTE 0x0004
274#define MSG_CTRUNC 0x0008
275#define MSG_PROXY 0x0010
276#define MSG_TRUNC 0x0020
277#define MSG_DONTWAIT 0x0040
278#define MSG_EOR 0x0080
279#define MSG_WAITALL 0x0100
280#define MSG_FIN 0x0200
281#define MSG_SYN 0x0400
282#define MSG_CONFIRM 0x0800
283#define MSG_RST 0x1000
284#define MSG_ERRQUEUE 0x2000
285#define MSG_NOSIGNAL 0x4000
286#define MSG_MORE 0x8000
287#define MSG_WAITFORONE 0x10000
288#define MSG_BATCH 0x40000
289#define MSG_ZEROCOPY 0x4000000
290#define MSG_FASTOPEN 0x20000000
291#define MSG_CMSG_CLOEXEC 0x40000000
292
293#define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1))
294#define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))
295#define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)
296
297#define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
298#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) || \
299 __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
300 ? 0 : (struct cmsghdr *)__CMSG_NEXT(cmsg))
301#define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
302
303#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
304#define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr)))
305#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
306
307#define SCM_RIGHTS 0x01
308#define SCM_CREDENTIALS 0x02
309
310struct sockaddr {
311 sa_family_t sa_family;
312 char sa_data[14];
313};
314
315struct sockaddr_storage {
316 sa_family_t ss_family;
317 char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)];
318 unsigned long __ss_align;
319};
320
321int socket (int, int, int);
322int socketpair (int, int, int, int [2]);
323
324int shutdown (int, int);
325
326int bind (int, const struct sockaddr *, socklen_t);
327int connect (int, const struct sockaddr *, socklen_t);
328int listen (int, int);
329int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);
330int accept4(int, struct sockaddr *__restrict, socklen_t *__restrict, int);
331
332int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
333int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict);
334
335ssize_t send (int, const void *, size_t, int);
336ssize_t recv (int, void *, size_t, int);
337ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
338ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict);
339ssize_t sendmsg (int, const struct msghdr *, int);
340ssize_t recvmsg (int, struct msghdr *, int);
341
342int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict);
343int setsockopt (int, int, int, const void *, socklen_t);
344
345int sockatmark (int);
346
347#ifdef __cplusplus
348}
349#endif
350#endif
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for s390x-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
22#endif
23
24#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
25typedef double 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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/fcntl.h+4-1
...@@ -37,4 +37,7 @@...@@ -37,4 +37,7 @@
37#define F_SETOWN_EX 1537#define F_SETOWN_EX 15
38#define F_GETOWN_EX 1638#define F_GETOWN_EX 16
3939
40#define F_GETOWNER_UIDS 17
\ No newline at end of file
40#define F_GETOWNER_UIDS 17
41
42#define POSIX_FADV_DONTNEED 6
43#define POSIX_FADV_NOREUSE 7
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/socket.h+1-28
...@@ -14,31 +14,4 @@ struct cmsghdr {...@@ -14,31 +14,4 @@ struct cmsghdr {
14 socklen_t cmsg_len;14 socklen_t cmsg_len;
15 int cmsg_level;15 int cmsg_level;
16 int cmsg_type;16 int cmsg_type;
17};
18
19#define SO_DEBUG 1
20#define SO_REUSEADDR 2
21#define SO_TYPE 3
22#define SO_ERROR 4
23#define SO_DONTROUTE 5
24#define SO_BROADCAST 6
25#define SO_SNDBUF 7
26#define SO_RCVBUF 8
27#define SO_KEEPALIVE 9
28#define SO_OOBINLINE 10
29#define SO_NO_CHECK 11
30#define SO_PRIORITY 12
31#define SO_LINGER 13
32#define SO_BSDCOMPAT 14
33#define SO_REUSEPORT 15
34#define SO_PASSCRED 16
35#define SO_PEERCRED 17
36#define SO_RCVLOWAT 18
37#define SO_SNDLOWAT 19
38#define SO_RCVTIMEO 20
39#define SO_SNDTIMEO 21
40#define SO_ACCEPTCONN 30
41#define SO_SNDBUFFORCE 32
42#define SO_RCVBUFFORCE 33
43#define SO_PROTOCOL 38
44#define SO_DOMAIN 39
\ No newline at end of file
17};
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/syscall.h deleted-657
...@@ -1,657 +0,0 @@
1#define __NR_exit 1
2#define __NR_fork 2
3#define __NR_read 3
4#define __NR_write 4
5#define __NR_open 5
6#define __NR_close 6
7#define __NR_restart_syscall 7
8#define __NR_creat 8
9#define __NR_link 9
10#define __NR_unlink 10
11#define __NR_execve 11
12#define __NR_chdir 12
13#define __NR_mknod 14
14#define __NR_chmod 15
15#define __NR_lseek 19
16#define __NR_getpid 20
17#define __NR_mount 21
18#define __NR_umount 22
19#define __NR_ptrace 26
20#define __NR_alarm 27
21#define __NR_pause 29
22#define __NR_utime 30
23#define __NR_access 33
24#define __NR_nice 34
25#define __NR_sync 36
26#define __NR_kill 37
27#define __NR_rename 38
28#define __NR_mkdir 39
29#define __NR_rmdir 40
30#define __NR_dup 41
31#define __NR_pipe 42
32#define __NR_times 43
33#define __NR_brk 45
34#define __NR_signal 48
35#define __NR_acct 51
36#define __NR_umount2 52
37#define __NR_ioctl 54
38#define __NR_fcntl 55
39#define __NR_setpgid 57
40#define __NR_umask 60
41#define __NR_chroot 61
42#define __NR_ustat 62
43#define __NR_dup2 63
44#define __NR_getppid 64
45#define __NR_getpgrp 65
46#define __NR_setsid 66
47#define __NR_sigaction 67
48#define __NR_sigsuspend 72
49#define __NR_sigpending 73
50#define __NR_sethostname 74
51#define __NR_setrlimit 75
52#define __NR_getrusage 77
53#define __NR_gettimeofday 78
54#define __NR_settimeofday 79
55#define __NR_symlink 83
56#define __NR_readlink 85
57#define __NR_uselib 86
58#define __NR_swapon 87
59#define __NR_reboot 88
60#define __NR_readdir 89
61#define __NR_mmap 90
62#define __NR_munmap 91
63#define __NR_truncate 92
64#define __NR_ftruncate 93
65#define __NR_fchmod 94
66#define __NR_getpriority 96
67#define __NR_setpriority 97
68#define __NR_statfs 99
69#define __NR_fstatfs 100
70#define __NR_socketcall 102
71#define __NR_syslog 103
72#define __NR_setitimer 104
73#define __NR_getitimer 105
74#define __NR_stat 106
75#define __NR_lstat 107
76#define __NR_fstat 108
77#define __NR_lookup_dcookie 110
78#define __NR_vhangup 111
79#define __NR_idle 112
80#define __NR_wait4 114
81#define __NR_swapoff 115
82#define __NR_sysinfo 116
83#define __NR_ipc 117
84#define __NR_fsync 118
85#define __NR_sigreturn 119
86#define __NR_clone 120
87#define __NR_setdomainname 121
88#define __NR_uname 122
89#define __NR_adjtimex 124
90#define __NR_mprotect 125
91#define __NR_sigprocmask 126
92#define __NR_create_module 127
93#define __NR_init_module 128
94#define __NR_delete_module 129
95#define __NR_get_kernel_syms 130
96#define __NR_quotactl 131
97#define __NR_getpgid 132
98#define __NR_fchdir 133
99#define __NR_bdflush 134
100#define __NR_sysfs 135
101#define __NR_personality 136
102#define __NR_afs_syscall 137
103#define __NR_getdents 141
104#define __NR_select 142
105#define __NR_flock 143
106#define __NR_msync 144
107#define __NR_readv 145
108#define __NR_writev 146
109#define __NR_getsid 147
110#define __NR_fdatasync 148
111#define __NR__sysctl 149
112#define __NR_mlock 150
113#define __NR_munlock 151
114#define __NR_mlockall 152
115#define __NR_munlockall 153
116#define __NR_sched_setparam 154
117#define __NR_sched_getparam 155
118#define __NR_sched_setscheduler 156
119#define __NR_sched_getscheduler 157
120#define __NR_sched_yield 158
121#define __NR_sched_get_priority_max 159
122#define __NR_sched_get_priority_min 160
123#define __NR_sched_rr_get_interval 161
124#define __NR_nanosleep 162
125#define __NR_mremap 163
126#define __NR_query_module 167
127#define __NR_poll 168
128#define __NR_nfsservctl 169
129#define __NR_prctl 172
130#define __NR_rt_sigreturn 173
131#define __NR_rt_sigaction 174
132#define __NR_rt_sigprocmask 175
133#define __NR_rt_sigpending 176
134#define __NR_rt_sigtimedwait 177
135#define __NR_rt_sigqueueinfo 178
136#define __NR_rt_sigsuspend 179
137#define __NR_pread64 180
138#define __NR_pwrite64 181
139#define __NR_getcwd 183
140#define __NR_capget 184
141#define __NR_capset 185
142#define __NR_sigaltstack 186
143#define __NR_sendfile 187
144#define __NR_getpmsg 188
145#define __NR_putpmsg 189
146#define __NR_vfork 190
147#define __NR_getrlimit 191
148#define __NR_lchown 198
149#define __NR_getuid 199
150#define __NR_getgid 200
151#define __NR_geteuid 201
152#define __NR_getegid 202
153#define __NR_setreuid 203
154#define __NR_setregid 204
155#define __NR_getgroups 205
156#define __NR_setgroups 206
157#define __NR_fchown 207
158#define __NR_setresuid 208
159#define __NR_getresuid 209
160#define __NR_setresgid 210
161#define __NR_getresgid 211
162#define __NR_chown 212
163#define __NR_setuid 213
164#define __NR_setgid 214
165#define __NR_setfsuid 215
166#define __NR_setfsgid 216
167#define __NR_pivot_root 217
168#define __NR_mincore 218
169#define __NR_madvise 219
170#define __NR_getdents64 220
171#define __NR_readahead 222
172#define __NR_setxattr 224
173#define __NR_lsetxattr 225
174#define __NR_fsetxattr 226
175#define __NR_getxattr 227
176#define __NR_lgetxattr 228
177#define __NR_fgetxattr 229
178#define __NR_listxattr 230
179#define __NR_llistxattr 231
180#define __NR_flistxattr 232
181#define __NR_removexattr 233
182#define __NR_lremovexattr 234
183#define __NR_fremovexattr 235
184#define __NR_gettid 236
185#define __NR_tkill 237
186#define __NR_futex 238
187#define __NR_sched_setaffinity 239
188#define __NR_sched_getaffinity 240
189#define __NR_tgkill 241
190#define __NR_io_setup 243
191#define __NR_io_destroy 244
192#define __NR_io_getevents 245
193#define __NR_io_submit 246
194#define __NR_io_cancel 247
195#define __NR_exit_group 248
196#define __NR_epoll_create 249
197#define __NR_epoll_ctl 250
198#define __NR_epoll_wait 251
199#define __NR_set_tid_address 252
200#define __NR_fadvise64 253
201#define __NR_timer_create 254
202#define __NR_timer_settime 255
203#define __NR_timer_gettime 256
204#define __NR_timer_getoverrun 257
205#define __NR_timer_delete 258
206#define __NR_clock_settime 259
207#define __NR_clock_gettime 260
208#define __NR_clock_getres 261
209#define __NR_clock_nanosleep 262
210#define __NR_statfs64 265
211#define __NR_fstatfs64 266
212#define __NR_remap_file_pages 267
213#define __NR_mbind 268
214#define __NR_get_mempolicy 269
215#define __NR_set_mempolicy 270
216#define __NR_mq_open 271
217#define __NR_mq_unlink 272
218#define __NR_mq_timedsend 273
219#define __NR_mq_timedreceive 274
220#define __NR_mq_notify 275
221#define __NR_mq_getsetattr 276
222#define __NR_kexec_load 277
223#define __NR_add_key 278
224#define __NR_request_key 279
225#define __NR_keyctl 280
226#define __NR_waitid 281
227#define __NR_ioprio_set 282
228#define __NR_ioprio_get 283
229#define __NR_inotify_init 284
230#define __NR_inotify_add_watch 285
231#define __NR_inotify_rm_watch 286
232#define __NR_migrate_pages 287
233#define __NR_openat 288
234#define __NR_mkdirat 289
235#define __NR_mknodat 290
236#define __NR_fchownat 291
237#define __NR_futimesat 292
238#define __NR_newfstatat 293
239#define __NR_unlinkat 294
240#define __NR_renameat 295
241#define __NR_linkat 296
242#define __NR_symlinkat 297
243#define __NR_readlinkat 298
244#define __NR_fchmodat 299
245#define __NR_faccessat 300
246#define __NR_pselect6 301
247#define __NR_ppoll 302
248#define __NR_unshare 303
249#define __NR_set_robust_list 304
250#define __NR_get_robust_list 305
251#define __NR_splice 306
252#define __NR_sync_file_range 307
253#define __NR_tee 308
254#define __NR_vmsplice 309
255#define __NR_move_pages 310
256#define __NR_getcpu 311
257#define __NR_epoll_pwait 312
258#define __NR_utimes 313
259#define __NR_fallocate 314
260#define __NR_utimensat 315
261#define __NR_signalfd 316
262#define __NR_timerfd 317
263#define __NR_eventfd 318
264#define __NR_timerfd_create 319
265#define __NR_timerfd_settime 320
266#define __NR_timerfd_gettime 321
267#define __NR_signalfd4 322
268#define __NR_eventfd2 323
269#define __NR_inotify_init1 324
270#define __NR_pipe2 325
271#define __NR_dup3 326
272#define __NR_epoll_create1 327
273#define __NR_preadv 328
274#define __NR_pwritev 329
275#define __NR_rt_tgsigqueueinfo 330
276#define __NR_perf_event_open 331
277#define __NR_fanotify_init 332
278#define __NR_fanotify_mark 333
279#define __NR_prlimit64 334
280#define __NR_name_to_handle_at 335
281#define __NR_open_by_handle_at 336
282#define __NR_clock_adjtime 337
283#define __NR_syncfs 338
284#define __NR_setns 339
285#define __NR_process_vm_readv 340
286#define __NR_process_vm_writev 341
287#define __NR_s390_runtime_instr 342
288#define __NR_kcmp 343
289#define __NR_finit_module 344
290#define __NR_sched_setattr 345
291#define __NR_sched_getattr 346
292#define __NR_renameat2 347
293#define __NR_seccomp 348
294#define __NR_getrandom 349
295#define __NR_memfd_create 350
296#define __NR_bpf 351
297#define __NR_s390_pci_mmio_write 352
298#define __NR_s390_pci_mmio_read 353
299#define __NR_execveat 354
300#define __NR_userfaultfd 355
301#define __NR_membarrier 356
302#define __NR_recvmmsg 357
303#define __NR_sendmmsg 358
304#define __NR_socket 359
305#define __NR_socketpair 360
306#define __NR_bind 361
307#define __NR_connect 362
308#define __NR_listen 363
309#define __NR_accept4 364
310#define __NR_getsockopt 365
311#define __NR_setsockopt 366
312#define __NR_getsockname 367
313#define __NR_getpeername 368
314#define __NR_sendto 369
315#define __NR_sendmsg 370
316#define __NR_recvfrom 371
317#define __NR_recvmsg 372
318#define __NR_shutdown 373
319#define __NR_mlock2 374
320#define __NR_copy_file_range 375
321#define __NR_preadv2 376
322#define __NR_pwritev2 377
323#define __NR_s390_guarded_storage 378
324#define __NR_statx 379
325#define __NR_s390_sthyi 380
326#define __NR_kexec_file_load 381
327#define __NR_io_pgetevents 382
328#define __NR_rseq 383
329
330#define SYS_exit 1
331#define SYS_fork 2
332#define SYS_read 3
333#define SYS_write 4
334#define SYS_open 5
335#define SYS_close 6
336#define SYS_restart_syscall 7
337#define SYS_creat 8
338#define SYS_link 9
339#define SYS_unlink 10
340#define SYS_execve 11
341#define SYS_chdir 12
342#define SYS_mknod 14
343#define SYS_chmod 15
344#define SYS_lseek 19
345#define SYS_getpid 20
346#define SYS_mount 21
347#define SYS_umount 22
348#define SYS_ptrace 26
349#define SYS_alarm 27
350#define SYS_pause 29
351#define SYS_utime 30
352#define SYS_access 33
353#define SYS_nice 34
354#define SYS_sync 36
355#define SYS_kill 37
356#define SYS_rename 38
357#define SYS_mkdir 39
358#define SYS_rmdir 40
359#define SYS_dup 41
360#define SYS_pipe 42
361#define SYS_times 43
362#define SYS_brk 45
363#define SYS_signal 48
364#define SYS_acct 51
365#define SYS_umount2 52
366#define SYS_ioctl 54
367#define SYS_fcntl 55
368#define SYS_setpgid 57
369#define SYS_umask 60
370#define SYS_chroot 61
371#define SYS_ustat 62
372#define SYS_dup2 63
373#define SYS_getppid 64
374#define SYS_getpgrp 65
375#define SYS_setsid 66
376#define SYS_sigaction 67
377#define SYS_sigsuspend 72
378#define SYS_sigpending 73
379#define SYS_sethostname 74
380#define SYS_setrlimit 75
381#define SYS_getrusage 77
382#define SYS_gettimeofday 78
383#define SYS_settimeofday 79
384#define SYS_symlink 83
385#define SYS_readlink 85
386#define SYS_uselib 86
387#define SYS_swapon 87
388#define SYS_reboot 88
389#define SYS_readdir 89
390#define SYS_mmap 90
391#define SYS_munmap 91
392#define SYS_truncate 92
393#define SYS_ftruncate 93
394#define SYS_fchmod 94
395#define SYS_getpriority 96
396#define SYS_setpriority 97
397#define SYS_statfs 99
398#define SYS_fstatfs 100
399#define SYS_socketcall 102
400#define SYS_syslog 103
401#define SYS_setitimer 104
402#define SYS_getitimer 105
403#define SYS_stat 106
404#define SYS_lstat 107
405#define SYS_fstat 108
406#define SYS_lookup_dcookie 110
407#define SYS_vhangup 111
408#define SYS_idle 112
409#define SYS_wait4 114
410#define SYS_swapoff 115
411#define SYS_sysinfo 116
412#define SYS_ipc 117
413#define SYS_fsync 118
414#define SYS_sigreturn 119
415#define SYS_clone 120
416#define SYS_setdomainname 121
417#define SYS_uname 122
418#define SYS_adjtimex 124
419#define SYS_mprotect 125
420#define SYS_sigprocmask 126
421#define SYS_create_module 127
422#define SYS_init_module 128
423#define SYS_delete_module 129
424#define SYS_get_kernel_syms 130
425#define SYS_quotactl 131
426#define SYS_getpgid 132
427#define SYS_fchdir 133
428#define SYS_bdflush 134
429#define SYS_sysfs 135
430#define SYS_personality 136
431#define SYS_afs_syscall 137
432#define SYS_getdents 141
433#define SYS_select 142
434#define SYS_flock 143
435#define SYS_msync 144
436#define SYS_readv 145
437#define SYS_writev 146
438#define SYS_getsid 147
439#define SYS_fdatasync 148
440#define SYS__sysctl 149
441#define SYS_mlock 150
442#define SYS_munlock 151
443#define SYS_mlockall 152
444#define SYS_munlockall 153
445#define SYS_sched_setparam 154
446#define SYS_sched_getparam 155
447#define SYS_sched_setscheduler 156
448#define SYS_sched_getscheduler 157
449#define SYS_sched_yield 158
450#define SYS_sched_get_priority_max 159
451#define SYS_sched_get_priority_min 160
452#define SYS_sched_rr_get_interval 161
453#define SYS_nanosleep 162
454#define SYS_mremap 163
455#define SYS_query_module 167
456#define SYS_poll 168
457#define SYS_nfsservctl 169
458#define SYS_prctl 172
459#define SYS_rt_sigreturn 173
460#define SYS_rt_sigaction 174
461#define SYS_rt_sigprocmask 175
462#define SYS_rt_sigpending 176
463#define SYS_rt_sigtimedwait 177
464#define SYS_rt_sigqueueinfo 178
465#define SYS_rt_sigsuspend 179
466#define SYS_pread64 180
467#define SYS_pwrite64 181
468#define SYS_getcwd 183
469#define SYS_capget 184
470#define SYS_capset 185
471#define SYS_sigaltstack 186
472#define SYS_sendfile 187
473#define SYS_getpmsg 188
474#define SYS_putpmsg 189
475#define SYS_vfork 190
476#define SYS_getrlimit 191
477#define SYS_lchown 198
478#define SYS_getuid 199
479#define SYS_getgid 200
480#define SYS_geteuid 201
481#define SYS_getegid 202
482#define SYS_setreuid 203
483#define SYS_setregid 204
484#define SYS_getgroups 205
485#define SYS_setgroups 206
486#define SYS_fchown 207
487#define SYS_setresuid 208
488#define SYS_getresuid 209
489#define SYS_setresgid 210
490#define SYS_getresgid 211
491#define SYS_chown 212
492#define SYS_setuid 213
493#define SYS_setgid 214
494#define SYS_setfsuid 215
495#define SYS_setfsgid 216
496#define SYS_pivot_root 217
497#define SYS_mincore 218
498#define SYS_madvise 219
499#define SYS_getdents64 220
500#define SYS_readahead 222
501#define SYS_setxattr 224
502#define SYS_lsetxattr 225
503#define SYS_fsetxattr 226
504#define SYS_getxattr 227
505#define SYS_lgetxattr 228
506#define SYS_fgetxattr 229
507#define SYS_listxattr 230
508#define SYS_llistxattr 231
509#define SYS_flistxattr 232
510#define SYS_removexattr 233
511#define SYS_lremovexattr 234
512#define SYS_fremovexattr 235
513#define SYS_gettid 236
514#define SYS_tkill 237
515#define SYS_futex 238
516#define SYS_sched_setaffinity 239
517#define SYS_sched_getaffinity 240
518#define SYS_tgkill 241
519#define SYS_io_setup 243
520#define SYS_io_destroy 244
521#define SYS_io_getevents 245
522#define SYS_io_submit 246
523#define SYS_io_cancel 247
524#define SYS_exit_group 248
525#define SYS_epoll_create 249
526#define SYS_epoll_ctl 250
527#define SYS_epoll_wait 251
528#define SYS_set_tid_address 252
529#define SYS_fadvise64 253
530#define SYS_timer_create 254
531#define SYS_timer_settime 255
532#define SYS_timer_gettime 256
533#define SYS_timer_getoverrun 257
534#define SYS_timer_delete 258
535#define SYS_clock_settime 259
536#define SYS_clock_gettime 260
537#define SYS_clock_getres 261
538#define SYS_clock_nanosleep 262
539#define SYS_statfs64 265
540#define SYS_fstatfs64 266
541#define SYS_remap_file_pages 267
542#define SYS_mbind 268
543#define SYS_get_mempolicy 269
544#define SYS_set_mempolicy 270
545#define SYS_mq_open 271
546#define SYS_mq_unlink 272
547#define SYS_mq_timedsend 273
548#define SYS_mq_timedreceive 274
549#define SYS_mq_notify 275
550#define SYS_mq_getsetattr 276
551#define SYS_kexec_load 277
552#define SYS_add_key 278
553#define SYS_request_key 279
554#define SYS_keyctl 280
555#define SYS_waitid 281
556#define SYS_ioprio_set 282
557#define SYS_ioprio_get 283
558#define SYS_inotify_init 284
559#define SYS_inotify_add_watch 285
560#define SYS_inotify_rm_watch 286
561#define SYS_migrate_pages 287
562#define SYS_openat 288
563#define SYS_mkdirat 289
564#define SYS_mknodat 290
565#define SYS_fchownat 291
566#define SYS_futimesat 292
567#define SYS_newfstatat 293
568#define SYS_unlinkat 294
569#define SYS_renameat 295
570#define SYS_linkat 296
571#define SYS_symlinkat 297
572#define SYS_readlinkat 298
573#define SYS_fchmodat 299
574#define SYS_faccessat 300
575#define SYS_pselect6 301
576#define SYS_ppoll 302
577#define SYS_unshare 303
578#define SYS_set_robust_list 304
579#define SYS_get_robust_list 305
580#define SYS_splice 306
581#define SYS_sync_file_range 307
582#define SYS_tee 308
583#define SYS_vmsplice 309
584#define SYS_move_pages 310
585#define SYS_getcpu 311
586#define SYS_epoll_pwait 312
587#define SYS_utimes 313
588#define SYS_fallocate 314
589#define SYS_utimensat 315
590#define SYS_signalfd 316
591#define SYS_timerfd 317
592#define SYS_eventfd 318
593#define SYS_timerfd_create 319
594#define SYS_timerfd_settime 320
595#define SYS_timerfd_gettime 321
596#define SYS_signalfd4 322
597#define SYS_eventfd2 323
598#define SYS_inotify_init1 324
599#define SYS_pipe2 325
600#define SYS_dup3 326
601#define SYS_epoll_create1 327
602#define SYS_preadv 328
603#define SYS_pwritev 329
604#define SYS_rt_tgsigqueueinfo 330
605#define SYS_perf_event_open 331
606#define SYS_fanotify_init 332
607#define SYS_fanotify_mark 333
608#define SYS_prlimit64 334
609#define SYS_name_to_handle_at 335
610#define SYS_open_by_handle_at 336
611#define SYS_clock_adjtime 337
612#define SYS_syncfs 338
613#define SYS_setns 339
614#define SYS_process_vm_readv 340
615#define SYS_process_vm_writev 341
616#define SYS_s390_runtime_instr 342
617#define SYS_kcmp 343
618#define SYS_finit_module 344
619#define SYS_sched_setattr 345
620#define SYS_sched_getattr 346
621#define SYS_renameat2 347
622#define SYS_seccomp 348
623#define SYS_getrandom 349
624#define SYS_memfd_create 350
625#define SYS_bpf 351
626#define SYS_s390_pci_mmio_write 352
627#define SYS_s390_pci_mmio_read 353
628#define SYS_execveat 354
629#define SYS_userfaultfd 355
630#define SYS_membarrier 356
631#define SYS_recvmmsg 357
632#define SYS_sendmmsg 358
633#define SYS_socket 359
634#define SYS_socketpair 360
635#define SYS_bind 361
636#define SYS_connect 362
637#define SYS_listen 363
638#define SYS_accept4 364
639#define SYS_getsockopt 365
640#define SYS_setsockopt 366
641#define SYS_getsockname 367
642#define SYS_getpeername 368
643#define SYS_sendto 369
644#define SYS_sendmsg 370
645#define SYS_recvfrom 371
646#define SYS_recvmsg 372
647#define SYS_shutdown 373
648#define SYS_mlock2 374
649#define SYS_copy_file_range 375
650#define SYS_preadv2 376
651#define SYS_pwritev2 377
652#define SYS_s390_guarded_storage 378
653#define SYS_statx 379
654#define SYS_s390_sthyi 380
655#define SYS_kexec_file_load 381
656#define SYS_io_pgetevents 382
657#define SYS_rseq 383
\ No newline at end of file
lib/libc/include/wasm32-freestanding-musl/bits/alltypes.h deleted-385
...@@ -1,385 +0,0 @@
1#define _Addr long
2#define _Int64 long long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
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
35#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
36typedef struct { long long __ll; long double __ld; } max_align_t;
37#define __DEFINED_max_align_t
38#endif
39
40
41#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
42typedef long time_t;
43#define __DEFINED_time_t
44#endif
45
46#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
47typedef long suseconds_t;
48#define __DEFINED_suseconds_t
49#endif
50
51
52#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
53typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
54#define __DEFINED_pthread_attr_t
55#endif
56
57#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
58typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
59#define __DEFINED_pthread_mutex_t
60#endif
61
62#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
63typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
64#define __DEFINED_mtx_t
65#endif
66
67#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
68typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
69#define __DEFINED_pthread_cond_t
70#endif
71
72#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
73typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
74#define __DEFINED_cnd_t
75#endif
76
77#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
78typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
79#define __DEFINED_pthread_rwlock_t
80#endif
81
82#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
83typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
84#define __DEFINED_pthread_barrier_t
85#endif
86
87#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
88typedef unsigned _Addr size_t;
89#define __DEFINED_size_t
90#endif
91
92#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
93typedef unsigned _Addr uintptr_t;
94#define __DEFINED_uintptr_t
95#endif
96
97#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
98typedef _Addr ptrdiff_t;
99#define __DEFINED_ptrdiff_t
100#endif
101
102#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
103typedef _Addr ssize_t;
104#define __DEFINED_ssize_t
105#endif
106
107#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
108typedef _Addr intptr_t;
109#define __DEFINED_intptr_t
110#endif
111
112#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
113typedef _Addr regoff_t;
114#define __DEFINED_regoff_t
115#endif
116
117#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
118typedef _Reg register_t;
119#define __DEFINED_register_t
120#endif
121
122
123#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
124typedef signed char int8_t;
125#define __DEFINED_int8_t
126#endif
127
128#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
129typedef signed short int16_t;
130#define __DEFINED_int16_t
131#endif
132
133#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
134typedef signed int int32_t;
135#define __DEFINED_int32_t
136#endif
137
138#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
139typedef signed _Int64 int64_t;
140#define __DEFINED_int64_t
141#endif
142
143#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
144typedef signed _Int64 intmax_t;
145#define __DEFINED_intmax_t
146#endif
147
148#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
149typedef unsigned char uint8_t;
150#define __DEFINED_uint8_t
151#endif
152
153#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
154typedef unsigned short uint16_t;
155#define __DEFINED_uint16_t
156#endif
157
158#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
159typedef unsigned int uint32_t;
160#define __DEFINED_uint32_t
161#endif
162
163#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
164typedef unsigned _Int64 uint64_t;
165#define __DEFINED_uint64_t
166#endif
167
168#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
169typedef unsigned _Int64 u_int64_t;
170#define __DEFINED_u_int64_t
171#endif
172
173#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
174typedef unsigned _Int64 uintmax_t;
175#define __DEFINED_uintmax_t
176#endif
177
178
179#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
180typedef unsigned mode_t;
181#define __DEFINED_mode_t
182#endif
183
184#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
185typedef unsigned _Reg nlink_t;
186#define __DEFINED_nlink_t
187#endif
188
189#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
190typedef _Int64 off_t;
191#define __DEFINED_off_t
192#endif
193
194#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
195typedef unsigned _Int64 ino_t;
196#define __DEFINED_ino_t
197#endif
198
199#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
200typedef unsigned _Int64 dev_t;
201#define __DEFINED_dev_t
202#endif
203
204#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
205typedef long blksize_t;
206#define __DEFINED_blksize_t
207#endif
208
209#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
210typedef _Int64 blkcnt_t;
211#define __DEFINED_blkcnt_t
212#endif
213
214#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
215typedef unsigned _Int64 fsblkcnt_t;
216#define __DEFINED_fsblkcnt_t
217#endif
218
219#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
220typedef unsigned _Int64 fsfilcnt_t;
221#define __DEFINED_fsfilcnt_t
222#endif
223
224
225#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
226typedef unsigned wint_t;
227#define __DEFINED_wint_t
228#endif
229
230#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
231typedef unsigned long wctype_t;
232#define __DEFINED_wctype_t
233#endif
234
235
236#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
237typedef void * timer_t;
238#define __DEFINED_timer_t
239#endif
240
241#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
242typedef int clockid_t;
243#define __DEFINED_clockid_t
244#endif
245
246#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
247typedef long clock_t;
248#define __DEFINED_clock_t
249#endif
250
251#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
252struct timeval { time_t tv_sec; suseconds_t tv_usec; };
253#define __DEFINED_struct_timeval
254#endif
255
256#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
257struct timespec { time_t tv_sec; long tv_nsec; };
258#define __DEFINED_struct_timespec
259#endif
260
261
262#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
263typedef int pid_t;
264#define __DEFINED_pid_t
265#endif
266
267#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
268typedef unsigned id_t;
269#define __DEFINED_id_t
270#endif
271
272#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
273typedef unsigned uid_t;
274#define __DEFINED_uid_t
275#endif
276
277#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
278typedef unsigned gid_t;
279#define __DEFINED_gid_t
280#endif
281
282#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
283typedef int key_t;
284#define __DEFINED_key_t
285#endif
286
287#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
288typedef unsigned useconds_t;
289#define __DEFINED_useconds_t
290#endif
291
292
293#ifdef __cplusplus
294#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
295typedef unsigned long pthread_t;
296#define __DEFINED_pthread_t
297#endif
298
299#else
300#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
301typedef struct __pthread * pthread_t;
302#define __DEFINED_pthread_t
303#endif
304
305#endif
306#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
307typedef int pthread_once_t;
308#define __DEFINED_pthread_once_t
309#endif
310
311#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
312typedef unsigned pthread_key_t;
313#define __DEFINED_pthread_key_t
314#endif
315
316#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
317typedef int pthread_spinlock_t;
318#define __DEFINED_pthread_spinlock_t
319#endif
320
321#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
322typedef struct { unsigned __attr; } pthread_mutexattr_t;
323#define __DEFINED_pthread_mutexattr_t
324#endif
325
326#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
327typedef struct { unsigned __attr; } pthread_condattr_t;
328#define __DEFINED_pthread_condattr_t
329#endif
330
331#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
332typedef struct { unsigned __attr; } pthread_barrierattr_t;
333#define __DEFINED_pthread_barrierattr_t
334#endif
335
336#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
337typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
338#define __DEFINED_pthread_rwlockattr_t
339#endif
340
341
342#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
343typedef struct _IO_FILE FILE;
344#define __DEFINED_FILE
345#endif
346
347
348#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
349typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
350#define __DEFINED_mbstate_t
351#endif
352
353
354#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
355typedef struct __locale_struct * locale_t;
356#define __DEFINED_locale_t
357#endif
358
359
360#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
361typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
362#define __DEFINED_sigset_t
363#endif
364
365
366#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
367struct iovec { void *iov_base; size_t iov_len; };
368#define __DEFINED_struct_iovec
369#endif
370
371
372#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
373typedef unsigned socklen_t;
374#define __DEFINED_socklen_t
375#endif
376
377#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
378typedef unsigned short sa_family_t;
379#define __DEFINED_sa_family_t
380#endif
381
382
383#undef _Addr
384#undef _Int64
385#undef _Reg
lib/libc/include/wasm32-freestanding-musl/errno.h deleted-24
...@@ -1,24 +0,0 @@
1#ifndef _ERRNO_H
2#define _ERRNO_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#ifdef WASM_THREAD_MODEL_SINGLE
9extern int errno;
10#else
11#ifdef __cplusplus
12extern thread_local int errno;
13#else
14extern _Thread_local int errno;
15#endif
16#endif
17
18#define errno errno
19
20#ifdef __cplusplus
21}
22#endif
23
24#endif
lib/libc/include/x86_64-linux-musl/bfd_stdint.h deleted-47
...@@ -1,47 +0,0 @@
1/* generated for x86_64-linux-musl-gcc (GCC) 8.3.0 */
2
3#ifndef GCC_GENERATED_STDINT_H
4#define GCC_GENERATED_STDINT_H 1
5
6#include <sys/types.h>
7#include <stdint.h>
8/* glibc uses these symbols as guards to prevent redefinitions. */
9#ifdef __int8_t_defined
10#define _INT8_T
11#define _INT16_T
12#define _INT32_T
13#endif
14#ifdef __uint32_t_defined
15#define _UINT32_T
16#endif
17
18
19/* Some systems have guard macros to prevent redefinitions, define them. */
20#ifndef _INT8_T
21#define _INT8_T
22#endif
23#ifndef _INT16_T
24#define _INT16_T
25#endif
26#ifndef _INT32_T
27#define _INT32_T
28#endif
29#ifndef _UINT8_T
30#define _UINT8_T
31#endif
32#ifndef _UINT16_T
33#define _UINT16_T
34#endif
35#ifndef _UINT32_T
36#define _UINT32_T
37#endif
38
39/* system headers have good uint64_t and int64_t */
40#ifndef _INT64_T
41#define _INT64_T
42#endif
43#ifndef _UINT64_T
44#define _UINT64_T
45#endif
46
47#endif /* GCC_GENERATED_STDINT_H */
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/alltypes.h deleted-398
...@@ -1,398 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
6typedef __builtin_va_list va_list;
7#define __DEFINED_va_list
8#endif
9
10#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
11typedef __builtin_va_list __isoc_va_list;
12#define __DEFINED___isoc_va_list
13#endif
14
15
16#ifndef __cplusplus
17#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
18typedef int wchar_t;
19#define __DEFINED_wchar_t
20#endif
21
22#endif
23
24#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
25#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
26typedef long double float_t;
27#define __DEFINED_float_t
28#endif
29
30#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
31typedef long double double_t;
32#define __DEFINED_double_t
33#endif
34
35#else
36#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
37typedef float float_t;
38#define __DEFINED_float_t
39#endif
40
41#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
42typedef double double_t;
43#define __DEFINED_double_t
44#endif
45
46#endif
47
48#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
49typedef struct { long long __ll; long double __ld; } max_align_t;
50#define __DEFINED_max_align_t
51#endif
52
53
54#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
55typedef long time_t;
56#define __DEFINED_time_t
57#endif
58
59#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
60typedef long suseconds_t;
61#define __DEFINED_suseconds_t
62#endif
63
64
65#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
66typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
67#define __DEFINED_pthread_attr_t
68#endif
69
70#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
71typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
72#define __DEFINED_pthread_mutex_t
73#endif
74
75#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
76typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
77#define __DEFINED_mtx_t
78#endif
79
80#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
81typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
82#define __DEFINED_pthread_cond_t
83#endif
84
85#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
86typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
87#define __DEFINED_cnd_t
88#endif
89
90#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
91typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
92#define __DEFINED_pthread_rwlock_t
93#endif
94
95#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
96typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
97#define __DEFINED_pthread_barrier_t
98#endif
99
100#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
101typedef unsigned _Addr size_t;
102#define __DEFINED_size_t
103#endif
104
105#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
106typedef unsigned _Addr uintptr_t;
107#define __DEFINED_uintptr_t
108#endif
109
110#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
111typedef _Addr ptrdiff_t;
112#define __DEFINED_ptrdiff_t
113#endif
114
115#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
116typedef _Addr ssize_t;
117#define __DEFINED_ssize_t
118#endif
119
120#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
121typedef _Addr intptr_t;
122#define __DEFINED_intptr_t
123#endif
124
125#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
126typedef _Addr regoff_t;
127#define __DEFINED_regoff_t
128#endif
129
130#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
131typedef _Reg register_t;
132#define __DEFINED_register_t
133#endif
134
135
136#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
137typedef signed char int8_t;
138#define __DEFINED_int8_t
139#endif
140
141#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
142typedef signed short int16_t;
143#define __DEFINED_int16_t
144#endif
145
146#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
147typedef signed int int32_t;
148#define __DEFINED_int32_t
149#endif
150
151#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
152typedef signed _Int64 int64_t;
153#define __DEFINED_int64_t
154#endif
155
156#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
157typedef signed _Int64 intmax_t;
158#define __DEFINED_intmax_t
159#endif
160
161#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
162typedef unsigned char uint8_t;
163#define __DEFINED_uint8_t
164#endif
165
166#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
167typedef unsigned short uint16_t;
168#define __DEFINED_uint16_t
169#endif
170
171#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
172typedef unsigned int uint32_t;
173#define __DEFINED_uint32_t
174#endif
175
176#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
177typedef unsigned _Int64 uint64_t;
178#define __DEFINED_uint64_t
179#endif
180
181#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
182typedef unsigned _Int64 u_int64_t;
183#define __DEFINED_u_int64_t
184#endif
185
186#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
187typedef unsigned _Int64 uintmax_t;
188#define __DEFINED_uintmax_t
189#endif
190
191
192#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
193typedef unsigned mode_t;
194#define __DEFINED_mode_t
195#endif
196
197#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
198typedef unsigned _Reg nlink_t;
199#define __DEFINED_nlink_t
200#endif
201
202#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
203typedef _Int64 off_t;
204#define __DEFINED_off_t
205#endif
206
207#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
208typedef unsigned _Int64 ino_t;
209#define __DEFINED_ino_t
210#endif
211
212#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
213typedef unsigned _Int64 dev_t;
214#define __DEFINED_dev_t
215#endif
216
217#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
218typedef long blksize_t;
219#define __DEFINED_blksize_t
220#endif
221
222#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
223typedef _Int64 blkcnt_t;
224#define __DEFINED_blkcnt_t
225#endif
226
227#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
228typedef unsigned _Int64 fsblkcnt_t;
229#define __DEFINED_fsblkcnt_t
230#endif
231
232#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
233typedef unsigned _Int64 fsfilcnt_t;
234#define __DEFINED_fsfilcnt_t
235#endif
236
237
238#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
239typedef unsigned wint_t;
240#define __DEFINED_wint_t
241#endif
242
243#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
244typedef unsigned long wctype_t;
245#define __DEFINED_wctype_t
246#endif
247
248
249#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
250typedef void * timer_t;
251#define __DEFINED_timer_t
252#endif
253
254#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
255typedef int clockid_t;
256#define __DEFINED_clockid_t
257#endif
258
259#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
260typedef long clock_t;
261#define __DEFINED_clock_t
262#endif
263
264#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
265struct timeval { time_t tv_sec; suseconds_t tv_usec; };
266#define __DEFINED_struct_timeval
267#endif
268
269#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
270struct timespec { time_t tv_sec; long tv_nsec; };
271#define __DEFINED_struct_timespec
272#endif
273
274
275#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
276typedef int pid_t;
277#define __DEFINED_pid_t
278#endif
279
280#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
281typedef unsigned id_t;
282#define __DEFINED_id_t
283#endif
284
285#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
286typedef unsigned uid_t;
287#define __DEFINED_uid_t
288#endif
289
290#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
291typedef unsigned gid_t;
292#define __DEFINED_gid_t
293#endif
294
295#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
296typedef int key_t;
297#define __DEFINED_key_t
298#endif
299
300#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
301typedef unsigned useconds_t;
302#define __DEFINED_useconds_t
303#endif
304
305
306#ifdef __cplusplus
307#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
308typedef unsigned long pthread_t;
309#define __DEFINED_pthread_t
310#endif
311
312#else
313#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
314typedef struct __pthread * pthread_t;
315#define __DEFINED_pthread_t
316#endif
317
318#endif
319#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
320typedef int pthread_once_t;
321#define __DEFINED_pthread_once_t
322#endif
323
324#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
325typedef unsigned pthread_key_t;
326#define __DEFINED_pthread_key_t
327#endif
328
329#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
330typedef int pthread_spinlock_t;
331#define __DEFINED_pthread_spinlock_t
332#endif
333
334#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
335typedef struct { unsigned __attr; } pthread_mutexattr_t;
336#define __DEFINED_pthread_mutexattr_t
337#endif
338
339#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
340typedef struct { unsigned __attr; } pthread_condattr_t;
341#define __DEFINED_pthread_condattr_t
342#endif
343
344#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
345typedef struct { unsigned __attr; } pthread_barrierattr_t;
346#define __DEFINED_pthread_barrierattr_t
347#endif
348
349#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
350typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
351#define __DEFINED_pthread_rwlockattr_t
352#endif
353
354
355#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
356typedef struct _IO_FILE FILE;
357#define __DEFINED_FILE
358#endif
359
360
361#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
362typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
363#define __DEFINED_mbstate_t
364#endif
365
366
367#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
368typedef struct __locale_struct * locale_t;
369#define __DEFINED_locale_t
370#endif
371
372
373#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
374typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
375#define __DEFINED_sigset_t
376#endif
377
378
379#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
380struct iovec { void *iov_base; size_t iov_len; };
381#define __DEFINED_struct_iovec
382#endif
383
384
385#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
386typedef unsigned socklen_t;
387#define __DEFINED_socklen_t
388#endif
389
390#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
391typedef unsigned short sa_family_t;
392#define __DEFINED_sa_family_t
393#endif
394
395
396#undef _Addr
397#undef _Int64
398#undef _Reg
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/endian.h deleted-1
...@@ -1 +0,0 @@
1#define __BYTE_ORDER __LITTLE_ENDIAN
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/syscall.h deleted-671
...@@ -1,671 +0,0 @@
1#define __NR_read 0
2#define __NR_write 1
3#define __NR_open 2
4#define __NR_close 3
5#define __NR_stat 4
6#define __NR_fstat 5
7#define __NR_lstat 6
8#define __NR_poll 7
9#define __NR_lseek 8
10#define __NR_mmap 9
11#define __NR_mprotect 10
12#define __NR_munmap 11
13#define __NR_brk 12
14#define __NR_rt_sigaction 13
15#define __NR_rt_sigprocmask 14
16#define __NR_rt_sigreturn 15
17#define __NR_ioctl 16
18#define __NR_pread64 17
19#define __NR_pwrite64 18
20#define __NR_readv 19
21#define __NR_writev 20
22#define __NR_access 21
23#define __NR_pipe 22
24#define __NR_select 23
25#define __NR_sched_yield 24
26#define __NR_mremap 25
27#define __NR_msync 26
28#define __NR_mincore 27
29#define __NR_madvise 28
30#define __NR_shmget 29
31#define __NR_shmat 30
32#define __NR_shmctl 31
33#define __NR_dup 32
34#define __NR_dup2 33
35#define __NR_pause 34
36#define __NR_nanosleep 35
37#define __NR_getitimer 36
38#define __NR_alarm 37
39#define __NR_setitimer 38
40#define __NR_getpid 39
41#define __NR_sendfile 40
42#define __NR_socket 41
43#define __NR_connect 42
44#define __NR_accept 43
45#define __NR_sendto 44
46#define __NR_recvfrom 45
47#define __NR_sendmsg 46
48#define __NR_recvmsg 47
49#define __NR_shutdown 48
50#define __NR_bind 49
51#define __NR_listen 50
52#define __NR_getsockname 51
53#define __NR_getpeername 52
54#define __NR_socketpair 53
55#define __NR_setsockopt 54
56#define __NR_getsockopt 55
57#define __NR_clone 56
58#define __NR_fork 57
59#define __NR_vfork 58
60#define __NR_execve 59
61#define __NR_exit 60
62#define __NR_wait4 61
63#define __NR_kill 62
64#define __NR_uname 63
65#define __NR_semget 64
66#define __NR_semop 65
67#define __NR_semctl 66
68#define __NR_shmdt 67
69#define __NR_msgget 68
70#define __NR_msgsnd 69
71#define __NR_msgrcv 70
72#define __NR_msgctl 71
73#define __NR_fcntl 72
74#define __NR_flock 73
75#define __NR_fsync 74
76#define __NR_fdatasync 75
77#define __NR_truncate 76
78#define __NR_ftruncate 77
79#define __NR_getdents 78
80#define __NR_getcwd 79
81#define __NR_chdir 80
82#define __NR_fchdir 81
83#define __NR_rename 82
84#define __NR_mkdir 83
85#define __NR_rmdir 84
86#define __NR_creat 85
87#define __NR_link 86
88#define __NR_unlink 87
89#define __NR_symlink 88
90#define __NR_readlink 89
91#define __NR_chmod 90
92#define __NR_fchmod 91
93#define __NR_chown 92
94#define __NR_fchown 93
95#define __NR_lchown 94
96#define __NR_umask 95
97#define __NR_gettimeofday 96
98#define __NR_getrlimit 97
99#define __NR_getrusage 98
100#define __NR_sysinfo 99
101#define __NR_times 100
102#define __NR_ptrace 101
103#define __NR_getuid 102
104#define __NR_syslog 103
105#define __NR_getgid 104
106#define __NR_setuid 105
107#define __NR_setgid 106
108#define __NR_geteuid 107
109#define __NR_getegid 108
110#define __NR_setpgid 109
111#define __NR_getppid 110
112#define __NR_getpgrp 111
113#define __NR_setsid 112
114#define __NR_setreuid 113
115#define __NR_setregid 114
116#define __NR_getgroups 115
117#define __NR_setgroups 116
118#define __NR_setresuid 117
119#define __NR_getresuid 118
120#define __NR_setresgid 119
121#define __NR_getresgid 120
122#define __NR_getpgid 121
123#define __NR_setfsuid 122
124#define __NR_setfsgid 123
125#define __NR_getsid 124
126#define __NR_capget 125
127#define __NR_capset 126
128#define __NR_rt_sigpending 127
129#define __NR_rt_sigtimedwait 128
130#define __NR_rt_sigqueueinfo 129
131#define __NR_rt_sigsuspend 130
132#define __NR_sigaltstack 131
133#define __NR_utime 132
134#define __NR_mknod 133
135#define __NR_uselib 134
136#define __NR_personality 135
137#define __NR_ustat 136
138#define __NR_statfs 137
139#define __NR_fstatfs 138
140#define __NR_sysfs 139
141#define __NR_getpriority 140
142#define __NR_setpriority 141
143#define __NR_sched_setparam 142
144#define __NR_sched_getparam 143
145#define __NR_sched_setscheduler 144
146#define __NR_sched_getscheduler 145
147#define __NR_sched_get_priority_max 146
148#define __NR_sched_get_priority_min 147
149#define __NR_sched_rr_get_interval 148
150#define __NR_mlock 149
151#define __NR_munlock 150
152#define __NR_mlockall 151
153#define __NR_munlockall 152
154#define __NR_vhangup 153
155#define __NR_modify_ldt 154
156#define __NR_pivot_root 155
157#define __NR__sysctl 156
158#define __NR_prctl 157
159#define __NR_arch_prctl 158
160#define __NR_adjtimex 159
161#define __NR_setrlimit 160
162#define __NR_chroot 161
163#define __NR_sync 162
164#define __NR_acct 163
165#define __NR_settimeofday 164
166#define __NR_mount 165
167#define __NR_umount2 166
168#define __NR_swapon 167
169#define __NR_swapoff 168
170#define __NR_reboot 169
171#define __NR_sethostname 170
172#define __NR_setdomainname 171
173#define __NR_iopl 172
174#define __NR_ioperm 173
175#define __NR_create_module 174
176#define __NR_init_module 175
177#define __NR_delete_module 176
178#define __NR_get_kernel_syms 177
179#define __NR_query_module 178
180#define __NR_quotactl 179
181#define __NR_nfsservctl 180
182#define __NR_getpmsg 181
183#define __NR_putpmsg 182
184#define __NR_afs_syscall 183
185#define __NR_tuxcall 184
186#define __NR_security 185
187#define __NR_gettid 186
188#define __NR_readahead 187
189#define __NR_setxattr 188
190#define __NR_lsetxattr 189
191#define __NR_fsetxattr 190
192#define __NR_getxattr 191
193#define __NR_lgetxattr 192
194#define __NR_fgetxattr 193
195#define __NR_listxattr 194
196#define __NR_llistxattr 195
197#define __NR_flistxattr 196
198#define __NR_removexattr 197
199#define __NR_lremovexattr 198
200#define __NR_fremovexattr 199
201#define __NR_tkill 200
202#define __NR_time 201
203#define __NR_futex 202
204#define __NR_sched_setaffinity 203
205#define __NR_sched_getaffinity 204
206#define __NR_set_thread_area 205
207#define __NR_io_setup 206
208#define __NR_io_destroy 207
209#define __NR_io_getevents 208
210#define __NR_io_submit 209
211#define __NR_io_cancel 210
212#define __NR_get_thread_area 211
213#define __NR_lookup_dcookie 212
214#define __NR_epoll_create 213
215#define __NR_epoll_ctl_old 214
216#define __NR_epoll_wait_old 215
217#define __NR_remap_file_pages 216
218#define __NR_getdents64 217
219#define __NR_set_tid_address 218
220#define __NR_restart_syscall 219
221#define __NR_semtimedop 220
222#define __NR_fadvise64 221
223#define __NR_timer_create 222
224#define __NR_timer_settime 223
225#define __NR_timer_gettime 224
226#define __NR_timer_getoverrun 225
227#define __NR_timer_delete 226
228#define __NR_clock_settime 227
229#define __NR_clock_gettime 228
230#define __NR_clock_getres 229
231#define __NR_clock_nanosleep 230
232#define __NR_exit_group 231
233#define __NR_epoll_wait 232
234#define __NR_epoll_ctl 233
235#define __NR_tgkill 234
236#define __NR_utimes 235
237#define __NR_vserver 236
238#define __NR_mbind 237
239#define __NR_set_mempolicy 238
240#define __NR_get_mempolicy 239
241#define __NR_mq_open 240
242#define __NR_mq_unlink 241
243#define __NR_mq_timedsend 242
244#define __NR_mq_timedreceive 243
245#define __NR_mq_notify 244
246#define __NR_mq_getsetattr 245
247#define __NR_kexec_load 246
248#define __NR_waitid 247
249#define __NR_add_key 248
250#define __NR_request_key 249
251#define __NR_keyctl 250
252#define __NR_ioprio_set 251
253#define __NR_ioprio_get 252
254#define __NR_inotify_init 253
255#define __NR_inotify_add_watch 254
256#define __NR_inotify_rm_watch 255
257#define __NR_migrate_pages 256
258#define __NR_openat 257
259#define __NR_mkdirat 258
260#define __NR_mknodat 259
261#define __NR_fchownat 260
262#define __NR_futimesat 261
263#define __NR_newfstatat 262
264#define __NR_unlinkat 263
265#define __NR_renameat 264
266#define __NR_linkat 265
267#define __NR_symlinkat 266
268#define __NR_readlinkat 267
269#define __NR_fchmodat 268
270#define __NR_faccessat 269
271#define __NR_pselect6 270
272#define __NR_ppoll 271
273#define __NR_unshare 272
274#define __NR_set_robust_list 273
275#define __NR_get_robust_list 274
276#define __NR_splice 275
277#define __NR_tee 276
278#define __NR_sync_file_range 277
279#define __NR_vmsplice 278
280#define __NR_move_pages 279
281#define __NR_utimensat 280
282#define __NR_epoll_pwait 281
283#define __NR_signalfd 282
284#define __NR_timerfd_create 283
285#define __NR_eventfd 284
286#define __NR_fallocate 285
287#define __NR_timerfd_settime 286
288#define __NR_timerfd_gettime 287
289#define __NR_accept4 288
290#define __NR_signalfd4 289
291#define __NR_eventfd2 290
292#define __NR_epoll_create1 291
293#define __NR_dup3 292
294#define __NR_pipe2 293
295#define __NR_inotify_init1 294
296#define __NR_preadv 295
297#define __NR_pwritev 296
298#define __NR_rt_tgsigqueueinfo 297
299#define __NR_perf_event_open 298
300#define __NR_recvmmsg 299
301#define __NR_fanotify_init 300
302#define __NR_fanotify_mark 301
303#define __NR_prlimit64 302
304#define __NR_name_to_handle_at 303
305#define __NR_open_by_handle_at 304
306#define __NR_clock_adjtime 305
307#define __NR_syncfs 306
308#define __NR_sendmmsg 307
309#define __NR_setns 308
310#define __NR_getcpu 309
311#define __NR_process_vm_readv 310
312#define __NR_process_vm_writev 311
313#define __NR_kcmp 312
314#define __NR_finit_module 313
315#define __NR_sched_setattr 314
316#define __NR_sched_getattr 315
317#define __NR_renameat2 316
318#define __NR_seccomp 317
319#define __NR_getrandom 318
320#define __NR_memfd_create 319
321#define __NR_kexec_file_load 320
322#define __NR_bpf 321
323#define __NR_execveat 322
324#define __NR_userfaultfd 323
325#define __NR_membarrier 324
326#define __NR_mlock2 325
327#define __NR_copy_file_range 326
328#define __NR_preadv2 327
329#define __NR_pwritev2 328
330#define __NR_pkey_mprotect 329
331#define __NR_pkey_alloc 330
332#define __NR_pkey_free 331
333#define __NR_statx 332
334#define __NR_io_pgetevents 333
335#define __NR_rseq 334
336
337#define SYS_read 0
338#define SYS_write 1
339#define SYS_open 2
340#define SYS_close 3
341#define SYS_stat 4
342#define SYS_fstat 5
343#define SYS_lstat 6
344#define SYS_poll 7
345#define SYS_lseek 8
346#define SYS_mmap 9
347#define SYS_mprotect 10
348#define SYS_munmap 11
349#define SYS_brk 12
350#define SYS_rt_sigaction 13
351#define SYS_rt_sigprocmask 14
352#define SYS_rt_sigreturn 15
353#define SYS_ioctl 16
354#define SYS_pread64 17
355#define SYS_pwrite64 18
356#define SYS_readv 19
357#define SYS_writev 20
358#define SYS_access 21
359#define SYS_pipe 22
360#define SYS_select 23
361#define SYS_sched_yield 24
362#define SYS_mremap 25
363#define SYS_msync 26
364#define SYS_mincore 27
365#define SYS_madvise 28
366#define SYS_shmget 29
367#define SYS_shmat 30
368#define SYS_shmctl 31
369#define SYS_dup 32
370#define SYS_dup2 33
371#define SYS_pause 34
372#define SYS_nanosleep 35
373#define SYS_getitimer 36
374#define SYS_alarm 37
375#define SYS_setitimer 38
376#define SYS_getpid 39
377#define SYS_sendfile 40
378#define SYS_socket 41
379#define SYS_connect 42
380#define SYS_accept 43
381#define SYS_sendto 44
382#define SYS_recvfrom 45
383#define SYS_sendmsg 46
384#define SYS_recvmsg 47
385#define SYS_shutdown 48
386#define SYS_bind 49
387#define SYS_listen 50
388#define SYS_getsockname 51
389#define SYS_getpeername 52
390#define SYS_socketpair 53
391#define SYS_setsockopt 54
392#define SYS_getsockopt 55
393#define SYS_clone 56
394#define SYS_fork 57
395#define SYS_vfork 58
396#define SYS_execve 59
397#define SYS_exit 60
398#define SYS_wait4 61
399#define SYS_kill 62
400#define SYS_uname 63
401#define SYS_semget 64
402#define SYS_semop 65
403#define SYS_semctl 66
404#define SYS_shmdt 67
405#define SYS_msgget 68
406#define SYS_msgsnd 69
407#define SYS_msgrcv 70
408#define SYS_msgctl 71
409#define SYS_fcntl 72
410#define SYS_flock 73
411#define SYS_fsync 74
412#define SYS_fdatasync 75
413#define SYS_truncate 76
414#define SYS_ftruncate 77
415#define SYS_getdents 78
416#define SYS_getcwd 79
417#define SYS_chdir 80
418#define SYS_fchdir 81
419#define SYS_rename 82
420#define SYS_mkdir 83
421#define SYS_rmdir 84
422#define SYS_creat 85
423#define SYS_link 86
424#define SYS_unlink 87
425#define SYS_symlink 88
426#define SYS_readlink 89
427#define SYS_chmod 90
428#define SYS_fchmod 91
429#define SYS_chown 92
430#define SYS_fchown 93
431#define SYS_lchown 94
432#define SYS_umask 95
433#define SYS_gettimeofday 96
434#define SYS_getrlimit 97
435#define SYS_getrusage 98
436#define SYS_sysinfo 99
437#define SYS_times 100
438#define SYS_ptrace 101
439#define SYS_getuid 102
440#define SYS_syslog 103
441#define SYS_getgid 104
442#define SYS_setuid 105
443#define SYS_setgid 106
444#define SYS_geteuid 107
445#define SYS_getegid 108
446#define SYS_setpgid 109
447#define SYS_getppid 110
448#define SYS_getpgrp 111
449#define SYS_setsid 112
450#define SYS_setreuid 113
451#define SYS_setregid 114
452#define SYS_getgroups 115
453#define SYS_setgroups 116
454#define SYS_setresuid 117
455#define SYS_getresuid 118
456#define SYS_setresgid 119
457#define SYS_getresgid 120
458#define SYS_getpgid 121
459#define SYS_setfsuid 122
460#define SYS_setfsgid 123
461#define SYS_getsid 124
462#define SYS_capget 125
463#define SYS_capset 126
464#define SYS_rt_sigpending 127
465#define SYS_rt_sigtimedwait 128
466#define SYS_rt_sigqueueinfo 129
467#define SYS_rt_sigsuspend 130
468#define SYS_sigaltstack 131
469#define SYS_utime 132
470#define SYS_mknod 133
471#define SYS_uselib 134
472#define SYS_personality 135
473#define SYS_ustat 136
474#define SYS_statfs 137
475#define SYS_fstatfs 138
476#define SYS_sysfs 139
477#define SYS_getpriority 140
478#define SYS_setpriority 141
479#define SYS_sched_setparam 142
480#define SYS_sched_getparam 143
481#define SYS_sched_setscheduler 144
482#define SYS_sched_getscheduler 145
483#define SYS_sched_get_priority_max 146
484#define SYS_sched_get_priority_min 147
485#define SYS_sched_rr_get_interval 148
486#define SYS_mlock 149
487#define SYS_munlock 150
488#define SYS_mlockall 151
489#define SYS_munlockall 152
490#define SYS_vhangup 153
491#define SYS_modify_ldt 154
492#define SYS_pivot_root 155
493#define SYS__sysctl 156
494#define SYS_prctl 157
495#define SYS_arch_prctl 158
496#define SYS_adjtimex 159
497#define SYS_setrlimit 160
498#define SYS_chroot 161
499#define SYS_sync 162
500#define SYS_acct 163
501#define SYS_settimeofday 164
502#define SYS_mount 165
503#define SYS_umount2 166
504#define SYS_swapon 167
505#define SYS_swapoff 168
506#define SYS_reboot 169
507#define SYS_sethostname 170
508#define SYS_setdomainname 171
509#define SYS_iopl 172
510#define SYS_ioperm 173
511#define SYS_create_module 174
512#define SYS_init_module 175
513#define SYS_delete_module 176
514#define SYS_get_kernel_syms 177
515#define SYS_query_module 178
516#define SYS_quotactl 179
517#define SYS_nfsservctl 180
518#define SYS_getpmsg 181
519#define SYS_putpmsg 182
520#define SYS_afs_syscall 183
521#define SYS_tuxcall 184
522#define SYS_security 185
523#define SYS_gettid 186
524#define SYS_readahead 187
525#define SYS_setxattr 188
526#define SYS_lsetxattr 189
527#define SYS_fsetxattr 190
528#define SYS_getxattr 191
529#define SYS_lgetxattr 192
530#define SYS_fgetxattr 193
531#define SYS_listxattr 194
532#define SYS_llistxattr 195
533#define SYS_flistxattr 196
534#define SYS_removexattr 197
535#define SYS_lremovexattr 198
536#define SYS_fremovexattr 199
537#define SYS_tkill 200
538#define SYS_time 201
539#define SYS_futex 202
540#define SYS_sched_setaffinity 203
541#define SYS_sched_getaffinity 204
542#define SYS_set_thread_area 205
543#define SYS_io_setup 206
544#define SYS_io_destroy 207
545#define SYS_io_getevents 208
546#define SYS_io_submit 209
547#define SYS_io_cancel 210
548#define SYS_get_thread_area 211
549#define SYS_lookup_dcookie 212
550#define SYS_epoll_create 213
551#define SYS_epoll_ctl_old 214
552#define SYS_epoll_wait_old 215
553#define SYS_remap_file_pages 216
554#define SYS_getdents64 217
555#define SYS_set_tid_address 218
556#define SYS_restart_syscall 219
557#define SYS_semtimedop 220
558#define SYS_fadvise64 221
559#define SYS_timer_create 222
560#define SYS_timer_settime 223
561#define SYS_timer_gettime 224
562#define SYS_timer_getoverrun 225
563#define SYS_timer_delete 226
564#define SYS_clock_settime 227
565#define SYS_clock_gettime 228
566#define SYS_clock_getres 229
567#define SYS_clock_nanosleep 230
568#define SYS_exit_group 231
569#define SYS_epoll_wait 232
570#define SYS_epoll_ctl 233
571#define SYS_tgkill 234
572#define SYS_utimes 235
573#define SYS_vserver 236
574#define SYS_mbind 237
575#define SYS_set_mempolicy 238
576#define SYS_get_mempolicy 239
577#define SYS_mq_open 240
578#define SYS_mq_unlink 241
579#define SYS_mq_timedsend 242
580#define SYS_mq_timedreceive 243
581#define SYS_mq_notify 244
582#define SYS_mq_getsetattr 245
583#define SYS_kexec_load 246
584#define SYS_waitid 247
585#define SYS_add_key 248
586#define SYS_request_key 249
587#define SYS_keyctl 250
588#define SYS_ioprio_set 251
589#define SYS_ioprio_get 252
590#define SYS_inotify_init 253
591#define SYS_inotify_add_watch 254
592#define SYS_inotify_rm_watch 255
593#define SYS_migrate_pages 256
594#define SYS_openat 257
595#define SYS_mkdirat 258
596#define SYS_mknodat 259
597#define SYS_fchownat 260
598#define SYS_futimesat 261
599#define SYS_newfstatat 262
600#define SYS_unlinkat 263
601#define SYS_renameat 264
602#define SYS_linkat 265
603#define SYS_symlinkat 266
604#define SYS_readlinkat 267
605#define SYS_fchmodat 268
606#define SYS_faccessat 269
607#define SYS_pselect6 270
608#define SYS_ppoll 271
609#define SYS_unshare 272
610#define SYS_set_robust_list 273
611#define SYS_get_robust_list 274
612#define SYS_splice 275
613#define SYS_tee 276
614#define SYS_sync_file_range 277
615#define SYS_vmsplice 278
616#define SYS_move_pages 279
617#define SYS_utimensat 280
618#define SYS_epoll_pwait 281
619#define SYS_signalfd 282
620#define SYS_timerfd_create 283
621#define SYS_eventfd 284
622#define SYS_fallocate 285
623#define SYS_timerfd_settime 286
624#define SYS_timerfd_gettime 287
625#define SYS_accept4 288
626#define SYS_signalfd4 289
627#define SYS_eventfd2 290
628#define SYS_epoll_create1 291
629#define SYS_dup3 292
630#define SYS_pipe2 293
631#define SYS_inotify_init1 294
632#define SYS_preadv 295
633#define SYS_pwritev 296
634#define SYS_rt_tgsigqueueinfo 297
635#define SYS_perf_event_open 298
636#define SYS_recvmmsg 299
637#define SYS_fanotify_init 300
638#define SYS_fanotify_mark 301
639#define SYS_prlimit64 302
640#define SYS_name_to_handle_at 303
641#define SYS_open_by_handle_at 304
642#define SYS_clock_adjtime 305
643#define SYS_syncfs 306
644#define SYS_sendmmsg 307
645#define SYS_setns 308
646#define SYS_getcpu 309
647#define SYS_process_vm_readv 310
648#define SYS_process_vm_writev 311
649#define SYS_kcmp 312
650#define SYS_finit_module 313
651#define SYS_sched_setattr 314
652#define SYS_sched_getattr 315
653#define SYS_renameat2 316
654#define SYS_seccomp 317
655#define SYS_getrandom 318
656#define SYS_memfd_create 319
657#define SYS_kexec_file_load 320
658#define SYS_bpf 321
659#define SYS_execveat 322
660#define SYS_userfaultfd 323
661#define SYS_membarrier 324
662#define SYS_mlock2 325
663#define SYS_copy_file_range 326
664#define SYS_preadv2 327
665#define SYS_pwritev2 328
666#define SYS_pkey_mprotect 329
667#define SYS_pkey_alloc 330
668#define SYS_pkey_free 331
669#define SYS_statx 332
670#define SYS_io_pgetevents 333
671#define SYS_rseq 334
\ No newline at end of file
src/codegen.cpp+32-3
...@@ -8267,10 +8267,39 @@ static void detect_libc(CodeGen *g) {...@@ -8267,10 +8267,39 @@ static void detect_libc(CodeGen *g) {
82678267
8268 if (target_can_build_libc(g->zig_target)) {8268 if (target_can_build_libc(g->zig_target)) {
8269 const char *generic_name = target_libc_generic_name(g->zig_target);8269 const char *generic_name = target_libc_generic_name(g->zig_target);
82708270 const char *arch_name = target_arch_name(g->zig_target->arch);
8271 const char *abi_name = target_abi_name(g->zig_target->abi);
8272 if (target_is_musl(g->zig_target)) {
8273 // musl has some overrides. its headers are ABI-agnostic and so they all have the "musl" ABI name.
8274 abi_name = "musl";
8275 // some architectures are handled by the same set of headers
8276 switch (g->zig_target->arch) {
8277 case ZigLLVM_aarch64:
8278 case ZigLLVM_aarch64_be:
8279 arch_name = "aarch64";
8280 break;
8281 case ZigLLVM_arm:
8282 case ZigLLVM_armeb:
8283 arch_name = "arm";
8284 break;
8285 case ZigLLVM_mips:
8286 case ZigLLVM_mipsel:
8287 arch_name = "mips";
8288 break;
8289 case ZigLLVM_mips64:
8290 case ZigLLVM_mips64el:
8291 arch_name = "mips64";
8292 break;
8293 case ZigLLVM_ppc64:
8294 case ZigLLVM_ppc64le:
8295 arch_name = "powerpc64";
8296 break;
8297 default:
8298 break;
8299 }
8300 }
8271 Buf *arch_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "include" OS_SEP "%s-%s-%s",8301 Buf *arch_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "include" OS_SEP "%s-%s-%s",
8272 buf_ptr(g->zig_lib_dir), target_arch_name(g->zig_target->arch),8302 buf_ptr(g->zig_lib_dir), arch_name, target_os_name(g->zig_target->os), abi_name);
8273 target_os_name(g->zig_target->os), target_abi_name(g->zig_target->abi));
8274 Buf *generic_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "include" OS_SEP "generic-%s",8303 Buf *generic_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "include" OS_SEP "generic-%s",
8275 buf_ptr(g->zig_lib_dir), generic_name);8304 buf_ptr(g->zig_lib_dir), generic_name);
8276 Buf *arch_os_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "include" OS_SEP "%s-%s-any",8305 Buf *arch_os_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "include" OS_SEP "%s-%s-any",
tools/process_headers.zig+95-267
...@@ -19,11 +19,27 @@ const assert = std.debug.assert;...@@ -19,11 +19,27 @@ const assert = std.debug.assert;
1919
20const LibCTarget = struct {20const LibCTarget = struct {
21 name: []const u8,21 name: []const u8,
22 zig_arch: ?@TagType(Arch),22 arch: MultiArch,
23 zig_abi: ?Abi,
24};23};
2524
26const glibc_targets = []LibCTarget{25const MultiArch = union(enum) {
26 aarch64,
27 arm,
28 mips,
29 mips64,
30 powerpc64,
31 specific: @TagType(Arch),
32
33 fn eql(a: MultiArch, b: MultiArch) bool {
34 if (@enumToInt(a) != @enumToInt(b))
35 return false;
36 if (@TagType(MultiArch)(a) != .specific)
37 return true;
38 return a.specific == b.specific;
39 }
40};
41
42const glibc_targets = [_]LibCTarget{
27 LibCTarget{43 LibCTarget{
28 .name = "aarch64_be-linux-gnu",44 .name = "aarch64_be-linux-gnu",
29 .zig_arch = Arch.aarch64_be,45 .zig_arch = Arch.aarch64_be,
...@@ -274,11 +290,6 @@ const glibc_targets = []LibCTarget{...@@ -274,11 +290,6 @@ const glibc_targets = []LibCTarget{
274 .zig_arch = Arch.mips,290 .zig_arch = Arch.mips,
275 .zig_abi = null,291 .zig_abi = null,
276 },292 },
277 LibCTarget{
278 .name = "nios2-linux-gnu",
279 .zig_arch = Arch.nios2,
280 .zig_abi = Abi.gnu,
281 },
282 LibCTarget{293 LibCTarget{
283 .name = "powerpc64le-linux-gnu",294 .name = "powerpc64le-linux-gnu",
284 .zig_arch = Arch.powerpc64le,295 .zig_arch = Arch.powerpc64le,
...@@ -420,261 +431,52 @@ const glibc_targets = []LibCTarget{...@@ -420,261 +431,52 @@ const glibc_targets = []LibCTarget{
420 .zig_abi = null,431 .zig_abi = null,
421 },432 },
422};433};
423const musl_targets = []LibCTarget{434
424 LibCTarget{435const musl_targets = [_]LibCTarget{
425 .name = "aarch64_be-linux-musl-native",
426 .zig_arch = Arch.aarch64_be,
427 .zig_abi = Abi.musl,
428 },
429 LibCTarget{
430 .name = "aarch64-linux-musleabi-native",
431 .zig_arch = Arch.aarch64,
432 .zig_abi = Abi.musleabi,
433 },
434 LibCTarget{
435 .name = "armeb-linux-musleabihf-native",
436 .zig_arch = Arch.armeb,
437 .zig_abi = Abi.musleabihf,
438 },
439 LibCTarget{
440 .name = "armeb-linux-musleabi-native",
441 .zig_arch = Arch.armeb,
442 .zig_abi = Abi.musleabi,
443 },
444 LibCTarget{
445 .name = "armel-linux-musleabihf-native",
446 .zig_arch = null,
447 .zig_abi = Abi.musleabihf,
448 },
449 LibCTarget{
450 .name = "armel-linux-musleabi-native",
451 .zig_arch = null,
452 .zig_abi = Abi.musleabi,
453 },
454 LibCTarget{
455 .name = "arm-linux-musleabihf-native",
456 .zig_arch = Arch.arm,
457 .zig_abi = Abi.musleabihf,
458 },
459 LibCTarget{
460 .name = "arm-linux-musleabi-native",
461 .zig_arch = Arch.arm,
462 .zig_abi = Abi.musleabi,
463 },
464 LibCTarget{
465 .name = "armv5l-linux-musleabihf-native",
466 .zig_arch = null,
467 .zig_abi = Abi.musleabihf,
468 },
469 LibCTarget{
470 .name = "armv7l-linux-musleabihf-native",
471 .zig_arch = null,
472 .zig_abi = Abi.musleabihf,
473 },
474 LibCTarget{
475 .name = "armv7m-linux-musleabi-native",
476 .zig_arch = null,
477 .zig_abi = Abi.musleabi,
478 },
479 LibCTarget{
480 .name = "armv7r-linux-musleabihf-native",
481 .zig_arch = null,
482 .zig_abi = Abi.musleabihf,
483 },
484 LibCTarget{
485 .name = "i486-linux-musl-native",
486 .zig_arch = null,
487 .zig_abi = Abi.musl,
488 },
489 LibCTarget{
490 .name = "i686-linux-musl-native",
491 .zig_arch = Arch.i386,
492 .zig_abi = Abi.musl,
493 },
494 LibCTarget{
495 .name = "i686-w64-mingw32-native",
496 .zig_arch = null,
497 .zig_abi = null,
498 },
499 LibCTarget{
500 .name = "m68k-linux-musl-native",
501 .zig_arch = null,
502 .zig_abi = Abi.musl,
503 },
504 LibCTarget{
505 .name = "microblazeel-linux-musl-native",
506 .zig_arch = null,
507 .zig_abi = Abi.musl,
508 },
509 LibCTarget{
510 .name = "microblaze-linux-musl-native",
511 .zig_arch = null,
512 .zig_abi = Abi.musl,
513 },
514 LibCTarget{
515 .name = "mips64el-linux-musln32-native",
516 .zig_arch = Arch.mips64el,
517 .zig_abi = null,
518 },
519 LibCTarget{
520 .name = "mips64el-linux-musln32sf-native",
521 .zig_arch = Arch.mips64el,
522 .zig_abi = null,
523 },
524 LibCTarget{
525 .name = "mips64el-linux-musl-native",
526 .zig_arch = Arch.mips64el,
527 .zig_abi = Abi.musl,
528 },
529 LibCTarget{
530 .name = "mips64-linux-musln32-native",
531 .zig_arch = Arch.mips64,
532 .zig_abi = null,
533 },
534 LibCTarget{
535 .name = "mips64-linux-musln32sf-native",
536 .zig_arch = Arch.mips64,
537 .zig_abi = null,
538 },
539 LibCTarget{
540 .name = "mips64-linux-musl-native",
541 .zig_arch = Arch.mips64,
542 .zig_abi = Abi.musl,
543 },
544 LibCTarget{
545 .name = "mipsel-linux-musln32-native",
546 .zig_arch = null,
547 .zig_abi = Abi.musl,
548 },
549 LibCTarget{
550 .name = "mipsel-linux-musln32sf-native",
551 .zig_arch = Arch.mipsel,
552 .zig_abi = null,
553 },
554 LibCTarget{
555 .name = "mipsel-linux-musl-native",
556 .zig_arch = Arch.mipsel,
557 .zig_abi = Abi.musl,
558 },
559 LibCTarget{
560 .name = "mipsel-linux-muslsf-native",
561 .zig_arch = Arch.mipsel,
562 .zig_abi = null,
563 },
564 LibCTarget{
565 .name = "mips-linux-musln32sf-native",
566 .zig_arch = Arch.mips,
567 .zig_abi = null,
568 },
569 LibCTarget{
570 .name = "mips-linux-musl-native",
571 .zig_arch = Arch.mips,
572 .zig_abi = Abi.musl,
573 },
574 LibCTarget{
575 .name = "mips-linux-muslsf-native",
576 .zig_arch = Arch.mips,
577 .zig_abi = null,
578 },
579 LibCTarget{
580 .name = "or1k-linux-musl-native",
581 .zig_arch = null,
582 .zig_abi = Abi.musl,
583 },
584 LibCTarget{
585 .name = "powerpc64le-linux-musl-native",
586 .zig_arch = Arch.powerpc64le,
587 .zig_abi = Abi.musl,
588 },
589 LibCTarget{
590 .name = "powerpc64-linux-musl-native",
591 .zig_arch = Arch.powerpc64,
592 .zig_abi = Abi.musl,
593 },
594 LibCTarget{
595 .name = "powerpcle-linux-musl-native",
596 .zig_arch = null,
597 .zig_abi = Abi.musl,
598 },
599 LibCTarget{
600 .name = "powerpcle-linux-muslsf-native",
601 .zig_arch = null,
602 .zig_abi = null,
603 },
604 LibCTarget{436 LibCTarget{
605 .name = "powerpc-linux-musl-native",437 .name = "aarch64",
606 .zig_arch = Arch.powerpc,438 .arch = MultiArch.aarch64,
607 .zig_abi = Abi.musl,
608 },439 },
609 LibCTarget{440 LibCTarget{
610 .name = "powerpc-linux-muslsf-native",441 .name = "arm",
611 .zig_arch = Arch.powerpc,442 .arch = MultiArch.arm,
612 .zig_abi = null,
613 },443 },
614 LibCTarget{444 LibCTarget{
615 .name = "riscv32-linux-musl-native",445 .name = "i386",
616 .zig_arch = Arch.riscv32,446 .arch = MultiArch{ .specific = .i386 },
617 .zig_abi = Abi.musl,
618 },447 },
619 LibCTarget{448 LibCTarget{
620 .name = "riscv64-linux-musl-native",449 .name = "mips",
621 .zig_arch = Arch.riscv64,450 .arch = MultiArch.mips,
622 .zig_abi = Abi.musl,
623 },451 },
624 LibCTarget{452 LibCTarget{
625 .name = "s390x-linux-musl-native",453 .name = "mips64",
626 .zig_arch = Arch.s390x,454 .arch = MultiArch.mips64,
627 .zig_abi = Abi.musl,
628 },455 },
629 LibCTarget{456 LibCTarget{
630 .name = "sh2eb-linux-muslfdpic-native",457 .name = "powerpc",
631 .zig_arch = null,458 .arch = MultiArch{ .specific = .powerpc },
632 .zig_abi = null,
633 },459 },
634 LibCTarget{460 LibCTarget{
635 .name = "sh2eb-linux-musl-native",461 .name = "powerpc64",
636 .zig_arch = null,462 .arch = MultiArch.powerpc64,
637 .zig_abi = Abi.musl,
638 },463 },
639 LibCTarget{464 LibCTarget{
640 .name = "sh2-linux-muslfdpic-native",465 .name = "riscv64",
641 .zig_arch = null,466 .arch = MultiArch{ .specific = .riscv64 },
642 .zig_abi = null,
643 },467 },
644 LibCTarget{468 LibCTarget{
645 .name = "sh2-linux-musl-native",469 .name = "s390x",
646 .zig_arch = null,470 .arch = MultiArch{ .specific = .s390x },
647 .zig_abi = Abi.musl,
648 },471 },
649 LibCTarget{472 LibCTarget{
650 .name = "sh4eb-linux-musl-native",473 .name = "x86_64",
651 .zig_arch = null,474 .arch = MultiArch{ .specific = .x86_64 },
652 .zig_abi = Abi.musl,
653 },
654 LibCTarget{
655 .name = "sh4-linux-musl-native",
656 .zig_arch = null,
657 .zig_abi = Abi.musl,
658 },
659 LibCTarget{
660 .name = "x86_64-linux-musl-native",
661 .zig_arch = Arch.x86_64,
662 .zig_abi = Abi.musl,
663 },
664 LibCTarget{
665 .name = "x86_64-linux-muslx32-native",
666 .zig_arch = Arch.x86_64,
667 .zig_abi = null,
668 },
669 LibCTarget{
670 .name = "x86_64-w64-mingw32-native",
671 .zig_arch = null,
672 .zig_abi = null,
673 },475 },
674};476};
675477
676const DestTarget = struct {478const DestTarget = struct {
677 arch: @TagType(Arch),479 arch: MultiArch,
678 os: Os,480 os: Os,
679 abi: Abi,481 abi: Abi,
680482
...@@ -685,7 +487,7 @@ const DestTarget = struct {...@@ -685,7 +487,7 @@ const DestTarget = struct {
685 }487 }
686488
687 fn eql(a: DestTarget, b: DestTarget) bool {489 fn eql(a: DestTarget, b: DestTarget) bool {
688 return a.arch == b.arch and490 return a.arch.eql(b.arch) and
689 a.os == b.os and491 a.os == b.os and
690 a.abi == b.abi;492 a.abi == b.abi;
691 }493 }
...@@ -706,10 +508,15 @@ const HashToContents = std.AutoHashMap([]const u8, Contents);...@@ -706,10 +508,15 @@ const HashToContents = std.AutoHashMap([]const u8, Contents);
706const TargetToHash = std.HashMap(DestTarget, []const u8, DestTarget.hash, DestTarget.eql);508const TargetToHash = std.HashMap(DestTarget, []const u8, DestTarget.hash, DestTarget.eql);
707const PathTable = std.AutoHashMap([]const u8, *TargetToHash);509const PathTable = std.AutoHashMap([]const u8, *TargetToHash);
708510
511const LibCVendor = enum {
512 musl,
513 glibc,
514};
515
709pub fn main() !void {516pub fn main() !void {
710 var arena = std.heap.ArenaAllocator.init(std.heap.direct_allocator);517 var arena = std.heap.ArenaAllocator.init(std.heap.direct_allocator);
711 const allocator = &arena.allocator;518 const allocator = &arena.allocator;
712 const args = try std.os.argsAlloc(allocator);519 const args = try std.process.argsAlloc(allocator);
713 var search_paths = std.ArrayList([]const u8).init(allocator);520 var search_paths = std.ArrayList([]const u8).init(allocator);
714 var opt_out_dir: ?[]const u8 = null;521 var opt_out_dir: ?[]const u8 = null;
715 var opt_abi: ?[]const u8 = null;522 var opt_abi: ?[]const u8 = null;
...@@ -741,14 +548,22 @@ pub fn main() !void {...@@ -741,14 +548,22 @@ pub fn main() !void {
741548
742 const out_dir = opt_out_dir orelse usageAndExit(args[0]);549 const out_dir = opt_out_dir orelse usageAndExit(args[0]);
743 const abi_name = opt_abi orelse usageAndExit(args[0]);550 const abi_name = opt_abi orelse usageAndExit(args[0]);
744 const libc_targets = if (std.mem.eql(u8, abi_name, "musl"))551 const vendor = if (std.mem.eql(u8, abi_name, "musl"))
745 musl_targets552 LibCVendor.musl
746 else if (std.mem.eql(u8, abi_name, "glibc"))553 else if (std.mem.eql(u8, abi_name, "glibc"))
747 glibc_targets554 LibCVendor.glibc
748 else {555 else {
749 std.debug.warn("unrecognized C ABI: {}\n", abi_name);556 std.debug.warn("unrecognized C ABI: {}\n", abi_name);
750 usageAndExit(args[0]);557 usageAndExit(args[0]);
751 };558 };
559 const generic_name = try std.fmt.allocPrint(allocator, "generic-{}", abi_name);
560
561 // TODO compiler crashed when I wrote this the canonical way
562 var libc_targets: []const LibCTarget = undefined;
563 switch (vendor) {
564 .musl => libc_targets = musl_targets,
565 .glibc => @panic("TODO this regressed"), // glibc_targets,
566 }
752567
753 var path_table = PathTable.init(allocator);568 var path_table = PathTable.init(allocator);
754 var hash_to_contents = HashToContents.init(allocator);569 var hash_to_contents = HashToContents.init(allocator);
...@@ -759,20 +574,29 @@ pub fn main() !void {...@@ -759,20 +574,29 @@ pub fn main() !void {
759574
760 for (libc_targets) |libc_target| {575 for (libc_targets) |libc_target| {
761 const dest_target = DestTarget{576 const dest_target = DestTarget{
762 .arch = libc_target.zig_arch orelse continue,577 .arch = libc_target.arch,
763 .abi = libc_target.zig_abi orelse continue,578 .abi = switch (vendor) {
764 .os = builtin.Os.linux,579 .musl => .musl,
580 else => @panic("TODO this regressed"),
581 },
582 .os = .linux,
765 };583 };
766 search: for (search_paths.toSliceConst()) |search_path| {584 search: for (search_paths.toSliceConst()) |search_path| {
767 const target_include_dir = try std.os.path.join(585 var sub_path: []const []const u8 = undefined;
768 allocator,586 switch (vendor) {
769 [][]const u8{ search_path, libc_target.name, "usr", "include" },587 .musl => {
770 );588 sub_path = [_][]const u8{ search_path, libc_target.name, "usr", "local", "musl", "include" };
589 },
590 .glibc => {
591 sub_path = [_][]const u8{ search_path, libc_target.name, "usr", "include" };
592 },
593 }
594 const target_include_dir = try std.fs.path.join(allocator, sub_path);
771 var dir_stack = std.ArrayList([]const u8).init(allocator);595 var dir_stack = std.ArrayList([]const u8).init(allocator);
772 try dir_stack.append(target_include_dir);596 try dir_stack.append(target_include_dir);
773597
774 while (dir_stack.popOrNull()) |full_dir_name| {598 while (dir_stack.popOrNull()) |full_dir_name| {
775 var dir = std.os.Dir.open(allocator, full_dir_name) catch |err| switch (err) {599 var dir = std.fs.Dir.open(allocator, full_dir_name) catch |err| switch (err) {
776 error.FileNotFound => continue :search,600 error.FileNotFound => continue :search,
777 error.AccessDenied => continue :search,601 error.AccessDenied => continue :search,
778 else => return err,602 else => return err,
...@@ -780,11 +604,11 @@ pub fn main() !void {...@@ -780,11 +604,11 @@ pub fn main() !void {
780 defer dir.close();604 defer dir.close();
781605
782 while (try dir.next()) |entry| {606 while (try dir.next()) |entry| {
783 const full_path = try std.os.path.join(allocator, [][]const u8{ full_dir_name, entry.name });607 const full_path = try std.fs.path.join(allocator, [_][]const u8{ full_dir_name, entry.name });
784 switch (entry.kind) {608 switch (entry.kind) {
785 std.os.Dir.Entry.Kind.Directory => try dir_stack.append(full_path),609 .Directory => try dir_stack.append(full_path),
786 std.os.Dir.Entry.Kind.File => {610 .File => {
787 const rel_path = try std.os.path.relative(allocator, target_include_dir, full_path);611 const rel_path = try std.fs.path.relative(allocator, target_include_dir, full_path);
788 const raw_bytes = try std.io.readFileAlloc(allocator, full_path);612 const raw_bytes = try std.io.readFileAlloc(allocator, full_path);
789 const trimmed = std.mem.trim(u8, raw_bytes, " \r\n\t");613 const trimmed = std.mem.trim(u8, raw_bytes, " \r\n\t");
790 total_bytes += raw_bytes.len;614 total_bytes += raw_bytes.len;
...@@ -798,7 +622,7 @@ pub fn main() !void {...@@ -798,7 +622,7 @@ pub fn main() !void {
798 max_bytes_saved += raw_bytes.len;622 max_bytes_saved += raw_bytes.len;
799 gop.kv.value.hit_count += 1;623 gop.kv.value.hit_count += 1;
800 std.debug.warn(624 std.debug.warn(
801 "duplicate: {} {} ({Bi2})\n",625 "duplicate: {} {} ({Bi:2})\n",
802 libc_target.name,626 libc_target.name,
803 rel_path,627 rel_path,
804 raw_bytes.len,628 raw_bytes.len,
...@@ -829,8 +653,8 @@ pub fn main() !void {...@@ -829,8 +653,8 @@ pub fn main() !void {
829 std.debug.warn("warning: libc target not found: {}\n", libc_target.name);653 std.debug.warn("warning: libc target not found: {}\n", libc_target.name);
830 }654 }
831 }655 }
832 std.debug.warn("summary: {Bi2} could be reduced to {Bi2}\n", total_bytes, total_bytes - max_bytes_saved);656 std.debug.warn("summary: {Bi:2} could be reduced to {Bi:2}\n", total_bytes, total_bytes - max_bytes_saved);
833 try std.os.makePath(allocator, out_dir);657 try std.fs.makePath(allocator, out_dir);
834658
835 var missed_opportunity_bytes: usize = 0;659 var missed_opportunity_bytes: usize = 0;
836 // iterate path_table. for each path, put all the hashes into a list. sort by hit_count.660 // iterate path_table. for each path, put all the hashes into a list. sort by hit_count.
...@@ -850,15 +674,15 @@ pub fn main() !void {...@@ -850,15 +674,15 @@ pub fn main() !void {
850 var best_contents = contents_list.popOrNull().?;674 var best_contents = contents_list.popOrNull().?;
851 if (best_contents.hit_count > 1) {675 if (best_contents.hit_count > 1) {
852 // worth it to make it generic676 // worth it to make it generic
853 const full_path = try std.os.path.join(allocator, [][]const u8{ out_dir, "generic", path_kv.key });677 const full_path = try std.fs.path.join(allocator, [_][]const u8{ out_dir, generic_name, path_kv.key });
854 try std.os.makePath(allocator, std.os.path.dirname(full_path).?);678 try std.fs.makePath(allocator, std.fs.path.dirname(full_path).?);
855 try std.io.writeFile(full_path, best_contents.bytes);679 try std.io.writeFile(full_path, best_contents.bytes);
856 best_contents.is_generic = true;680 best_contents.is_generic = true;
857 while (contents_list.popOrNull()) |contender| {681 while (contents_list.popOrNull()) |contender| {
858 if (contender.hit_count > 1) {682 if (contender.hit_count > 1) {
859 const this_missed_bytes = contender.hit_count * contender.bytes.len;683 const this_missed_bytes = contender.hit_count * contender.bytes.len;
860 missed_opportunity_bytes += this_missed_bytes;684 missed_opportunity_bytes += this_missed_bytes;
861 std.debug.warn("Missed opportunity ({Bi2}): {}\n", this_missed_bytes, path_kv.key);685 std.debug.warn("Missed opportunity ({Bi:2}): {}\n", this_missed_bytes, path_kv.key);
862 } else break;686 } else break;
863 }687 }
864 }688 }
...@@ -868,15 +692,19 @@ pub fn main() !void {...@@ -868,15 +692,19 @@ pub fn main() !void {
868 if (contents.is_generic) continue;692 if (contents.is_generic) continue;
869693
870 const dest_target = hash_kv.key;694 const dest_target = hash_kv.key;
695 const arch_name = switch (dest_target.arch) {
696 .specific => |a| @tagName(a),
697 else => @tagName(dest_target.arch),
698 };
871 const out_subpath = try std.fmt.allocPrint(699 const out_subpath = try std.fmt.allocPrint(
872 allocator,700 allocator,
873 "{}-{}-{}",701 "{}-{}-{}",
874 @tagName(dest_target.arch),702 arch_name,
875 @tagName(dest_target.os),703 @tagName(dest_target.os),
876 @tagName(dest_target.abi),704 @tagName(dest_target.abi),
877 );705 );
878 const full_path = try std.os.path.join(allocator, [][]const u8{ out_dir, out_subpath, path_kv.key });706 const full_path = try std.fs.path.join(allocator, [_][]const u8{ out_dir, out_subpath, path_kv.key });
879 try std.os.makePath(allocator, std.os.path.dirname(full_path).?);707 try std.fs.makePath(allocator, std.fs.path.dirname(full_path).?);
880 try std.io.writeFile(full_path, contents.bytes);708 try std.io.writeFile(full_path, contents.bytes);
881 }709 }
882 }710 }
...@@ -888,5 +716,5 @@ fn usageAndExit(arg0: []const u8) noreturn {...@@ -888,5 +716,5 @@ fn usageAndExit(arg0: []const u8) noreturn {
888 std.debug.warn(" subdirectories of search paths look like, e.g. x86_64-linux-gnu\n");716 std.debug.warn(" subdirectories of search paths look like, e.g. x86_64-linux-gnu\n");
889 std.debug.warn("--out is a dir that will be created, and populated with the results\n");717 std.debug.warn("--out is a dir that will be created, and populated with the results\n");
890 std.debug.warn("--abi is either musl or glibc\n");718 std.debug.warn("--abi is either musl or glibc\n");
891 std.os.exit(1);719 std.process.exit(1);
892}720}