Rizin
unix-like reverse engineering framework and cli tools
sftypes.h
Go to the documentation of this file.
1 /*
2  * sftypes.h -- shellforge lib types
3  * see http://www.cartel-securite.net/pbiondi/shellforge.html
4  * for more informations
5  *
6  * Copyright (C) 2003 Philippe Biondi <biondi@cartel-securite.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  */
17 
18 /* $Id$ */
19 
20 #ifndef SFTYPES_H
21 #define SFTYPES_H
22 
23 
24 #define NULL ((void*)0)
25 
26 
27 /* XXX this is far from true on every architecture! */
28 typedef unsigned long uint64_t;
29 typedef unsigned int uint32_t;
30 typedef unsigned short uint16_t;
31 typedef unsigned char uint8_t;
32 typedef long int64_t;
33 typedef int int32_t;
34 typedef short int16_t;
35 typedef char int8_t;
36 
37 
38 typedef int pid_t;
39 typedef int ssize_t;
40 typedef int size_t;
41 typedef int off_t;
42 typedef int mode_t;
43 typedef int clock_t;
44 typedef int uid_t;
45 typedef int gid_t;
46 typedef void (*sighandler_t)(int);
47 
48 struct dirent {
49  int d_ino;
50  int d_off;
51  unsigned short int d_reclen;
52  char d_name[256];
53 };
54 
55 struct tms {
56  clock_t tms_utime; /* user time */
57  clock_t tms_stime; /* system time */
58  clock_t tms_cutime; /* user time of children */
59  clock_t tms_cstime; /* system time of children */
60 };
61 typedef int dev_t;
62 typedef int caddr_t;
63 typedef int sigset_t;
64 typedef int cap_user_header_t;
65 typedef int cap_user_data_t;
66 typedef int time_t;
67 struct vm86plus_struct {};
68 typedef int ptrdiff_t;
69 struct utimbuf {};
70 struct __sysctl_args {};
71 struct timezone {};
72 struct sysinfo{};
73 struct iovec {};
74 struct statfs {};
75 struct pollfd {};
76 struct kernel_sym {};
77 struct module {};
78 struct utsname {};
79 struct ustat {};
80 struct stat {};
81 struct sched_param {};
82 struct timeval
83 {
84  long tv_sec; /* seconds */
85  long tv_usec; /* microseconds */
86 };
87 struct timespec
88 {
89  time_t tv_sec; /* seconds */
90  long tv_nsec; /* nanoseconds */
91 };
92 
93 
94 
95 #define PROT_READ 0x1 /* Page can be read. */
96 #define PROT_WRITE 0x2 /* Page can be written. */
97 #define PROT_EXEC 0x4 /* Page can be executed. */
98 #define PROT_NONE 0x0 /* Page can not be accessed. */
99 
100 /* Sharing types (must choose one and only one of these). */
101 #define MAP_SHARED 0x01 /* Share changes. */
102 #define MAP_PRIVATE 0x02 /* Changes are private. */
103 #define MAP_TYPE 0x0f /* Mask for type of mapping. */
104 #define MAP_FIXED 0x10 /* Interpret addr exactly. */
105 #define MAP_FILE 0
106 #define MAP_ANONYMOUS 0x20 /* Don't use a file. */
107 #define MAP_ANON MAP_ANONYMOUS
108 
109 /**************** Error codes *****************/
110 
111 #define EPERM 1 /* Operation not permitted */
112 #define ENOENT 2 /* No such file or directory */
113 #define ESRCH 3 /* No such process */
114 #define EINTR 4 /* Interrupted system call */
115 #define EIO 5 /* I/O error */
116 #define ENXIO 6 /* No such device or address */
117 #define E2BIG 7 /* Argument list too long */
118 #define ENOEXEC 8 /* Exec format error */
119 #define EBADF 9 /* Bad file number */
120 #define ECHILD 10 /* No child processes */
121 #define EAGAIN 11 /* Try again */
122 #define ENOMEM 12 /* Out of memory */
123 #define EACCES 13 /* Permission denied */
124 #define EFAULT 14 /* Bad address */
125 #define ENOTBLK 15 /* Block device required */
126 #define EBUSY 16 /* Device or resource busy */
127 #define EEXIST 17 /* File exists */
128 #define EXDEV 18 /* Cross-device link */
129 #define ENODEV 19 /* No such device */
130 #define ENOTDIR 20 /* Not a directory */
131 #define EISDIR 21 /* Is a directory */
132 #define EINVAL 22 /* Invalid argument */
133 #define ENFILE 23 /* File table overflow */
134 #define EMFILE 24 /* Too many open files */
135 #define ENOTTY 25 /* Not a typewriter */
136 #define ETXTBSY 26 /* Text file busy */
137 #define EFBIG 27 /* File too large */
138 #define ENOSPC 28 /* No space left on device */
139 #define ESPIPE 29 /* Illegal seek */
140 #define EROFS 30 /* Read-only file system */
141 #define EMLINK 31 /* Too many links */
142 #define EPIPE 32 /* Broken pipe */
143 #define EDOM 33 /* Math argument out of domain of func */
144 #define ERANGE 34 /* Math result not representable */
145 
146 #define ESTRPIPE 86 /* Streams pipe error */
147 #define EUSERS 87 /* Too many users */
148 #define ENOTSOCK 88 /* Socket operation on non-socket */
149 #define EDESTADDRREQ 89 /* Destination address required */
150 #define EMSGSIZE 90 /* Message too long */
151 #define EPROTOTYPE 91 /* Protocol wrong type for socket */
152 #define ENOPROTOOPT 92 /* Protocol not available */
153 #define EPROTONOSUPPORT 93 /* Protocol not supported */
154 #define ESOCKTNOSUPPORT 94 /* Socket type not supported */
155 #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
156 #define EPFNOSUPPORT 96 /* Protocol family not supported */
157 #define EAFNOSUPPORT 97 /* Address family not supported by protocol */
158 #define EADDRINUSE 98 /* Address already in use */
159 #define EADDRNOTAVAIL 99 /* Cannot assign requested address */
160 #define ENETDOWN 100 /* Network is down */
161 #define ENETUNREACH 101 /* Network is unreachable */
162 #define ENETRESET 102 /* Network dropped connection because of reset */
163 #define ECONNABORTED 103 /* Software caused connection abort */
164 #define ECONNRESET 104 /* Connection reset by peer */
165 #define ENOBUFS 105 /* No buffer space available */
166 #define EISCONN 106 /* Transport endpoint is already connected */
167 #define ENOTCONN 107 /* Transport endpoint is not connected */
168 #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
169 #define ETOOMANYREFS 109 /* Too many references: cannot splice */
170 #define ETIMEDOUT 110 /* Connection timed out */
171 #define ECONNREFUSED 111 /* Connection refused */
172 #define EHOSTDOWN 112 /* Host is down */
173 #define EHOSTUNREACH 113 /* No route to host */
174 #define EALREADY 114 /* Operation already in progress */
175 #define EINPROGRESS 115 /* Operation now in progress */
176 #define ESTALE 116 /* Stale NFS file handle */
177 #define EUCLEAN 117 /* Structure needs cleaning */
178 #define ENOTNAM 118 /* Not a XENIX named type file */
179 #define ENAVAIL 119 /* No XENIX semaphores available */
180 #define EISNAM 120 /* Is a named type file */
181 #define EREMOTEIO 121 /* Remote I/O error */
182 #define EDQUOT 122 /* Quota exceeded */
183 
184 
185 
186 /**************** Select *******************************/
187 
188 typedef long int fd_mask;
189 
190 #define FD_SETSIZE 1024
191 
192 #define NFDBITS (8 * sizeof (fd_mask))
193 #define __FDELT(d) ((d) / NFDBITS)
194 #define FDMASK(d) ((fd_mask) 1 << ((d) % NFDBITS))
195 
196 typedef struct
197  {
199  } fd_set;
200 
201 # define __FDS_BITS(set) ((set)->fds_bits)
202 
203 
204 #define FD_ZERO(set) \
205  do { \
206  unsigned int __i; \
207  fd_set *__arr = (set); \
208  for (__i = 0; __i < sizeof (fd_set) / sizeof (fd_mask); ++__i) \
209  __FDS_BITS (__arr)[__i] = 0; \
210  } while (0)
211 
212 #define FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= FDMASK (d))
213 #define FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~FDMASK (d))
214 #define FD_ISSET(d, set) (__FDS_BITS (set)[__FDELT (d)] & FDMASK (d))
215 
216 /**************** Sockets and network *******************/
217 
218 
219 typedef unsigned int socklen_t;
220 
221 /* SOCK_ constants */
223 {
224  SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
225  byte streams. */
226 #define SOCK_STREAM SOCK_STREAM
227  SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
228  of fixed maximum length. */
229 #define SOCK_DGRAM SOCK_DGRAM
230  SOCK_RAW = 3, /* Raw protocol interface. */
231 #define SOCK_RAW SOCK_RAW
232  SOCK_RDM = 4, /* Reliably-delivered messages. */
233 #define SOCK_RDM SOCK_RDM
234  SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
235  datagrams of fixed maximum length. */
236 #define SOCK_SEQPACKET SOCK_SEQPACKET
237  SOCK_PACKET = 10 /* Linux specific way of getting packets
238  at the dev level. For writing rarp and
239  other similar things on the user level. */
240 #define SOCK_PACKET SOCK_PACKET
241 };
242 
243 /* Protocol families. */
244 #define PF_UNSPEC 0 /* Unspecified. */
245 #define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
246 #define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
247 #define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
248 #define PF_INET 2 /* IP protocol family. */
249 #define PF_AX25 3 /* Amateur Radio AX.25. */
250 #define PF_IPX 4 /* Novell Internet Protocol. */
251 #define PF_APPLETALK 5 /* Appletalk DDP. */
252 #define PF_NETROM 6 /* Amateur radio NetROM. */
253 #define PF_BRIDGE 7 /* Multiprotocol bridge. */
254 #define PF_ATMPVC 8 /* ATM PVCs. */
255 #define PF_X25 9 /* Reserved for X.25 project. */
256 #if __linux__
257 #define PF_INET6 28 /* IP version 6 on linux. */
258 #endif
259 
260 #if __FreeBSD__
261 #define PF_INET6 10 /* IP version 6. */
262 #endif
263 
264 #define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
265 #define PF_DECnet 12 /* Reserved for DECnet project. */
266 #define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
267 #define PF_SECURITY 14 /* Security callback pseudo AF. */
268 #define PF_KEY 15 /* PF_KEY key management API. */
269 #define PF_NETLINK 16
270 #define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
271 #define PF_PACKET 17 /* Packet family. */
272 #define PF_ASH 18 /* Ash. */
273 #define PF_ECONET 19 /* Acorn Econet. */
274 #define PF_ATMSVC 20 /* ATM SVCs. */
275 #define PF_SNA 22 /* Linux SNA Project */
276 #define PF_IRDA 23 /* IRDA sockets. */
277 #define PF_PPPOX 24 /* PPPoX sockets. */
278 #define PF_WANPIPE 25 /* Wanpipe API sockets. */
279 #define PF_BLUETOOTH 31 /* Bluetooth sockets. */
280 #define PF_MAX 32 /* For now.. */
281 
282  /* Address families. */
283 #define AF_UNSPEC PF_UNSPEC
284 #define AF_LOCAL PF_LOCAL
285 #define AF_UNIX PF_UNIX
286 #define AF_FILE PF_FILE
287 #define AF_INET PF_INET
288 #define AF_AX25 PF_AX25
289 #define AF_IPX PF_IPX
290 #define AF_APPLETALK PF_APPLETALK
291 #define AF_NETROM PF_NETROM
292 #define AF_BRIDGE PF_BRIDGE
293 #define AF_ATMPVC PF_ATMPVC
294 #define AF_X25 PF_X25
295 #define AF_INET6 PF_INET6
296 #define AF_ROSE PF_ROSE
297 #define AF_DECnet PF_DECnet
298 #define AF_NETBEUI PF_NETBEUI
299 #define AF_SECURITY PF_SECURITY
300 #define AF_KEY PF_KEY
301 #define AF_NETLINK PF_NETLINK
302 #define AF_ROUTE PF_ROUTE
303 #define AF_PACKET PF_PACKET
304 #define AF_ASH PF_ASH
305 #define AF_ECONET PF_ECONET
306 #define AF_ATMSVC PF_ATMSVC
307 #define AF_SNA PF_SNA
308 #define AF_IRDA PF_IRDA
309 #define AF_PPPOX PF_PPPOX
310 #define AF_WANPIPE PF_WANPIPE
311 #define AF_BLUETOOTH PF_BLUETOOTH
312 #define AF_MAX PF_MAX
313 
314 #define SOL_RAW 255
315 #define SOL_DECNET 261
316 #define SOL_X25 262
317 #define SOL_PACKET 263
318 #define SOL_ATM 264 /* ATM layer (cell level). */
319 #define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
320 #define SOL_IRDA 266
321 
322 typedef unsigned short int sa_family_t;
323 #define __SOCKADDR_COMMON(sa_prefix) \
324  sa_family_t sa_prefix##family
325 #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
326 
327 struct sockaddr
328  {
329  __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
330  char sa_data[14]; /* Address data. */
331  };
332 
333 typedef unsigned int in_addr_t;
334 typedef unsigned short in_port_t;
335 struct in_addr
336  {
338  };
339 
341  {
343  in_port_t sin_port; /* Port number. */
344  struct in_addr sin_addr; /* Internet address. */
345 
346  /* Pad to size of `struct sockaddr'. */
347  unsigned char sin_zero[sizeof (struct sockaddr) -
349  sizeof (in_port_t) -
350  sizeof (struct in_addr)];
351  };
352 
354 {
356  char sun_path[108]; /* Path name. */
357 };
358 
359 struct in6_addr
360 {
361  union
362  {
365 };
366 
367 #define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
368 static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
369 
371 {
373  in_port_t sin6_port; /* Transport layer port # */
374  uint32_t sin6_flowinfo; /* IPv6 flow information */
375  struct in6_addr sin6_addr; /* IPv6 address */
376  uint32_t sin6_scope_id; /* IPv6 scope-id */
377 };
378 
379 /**** Ancillairy messages ****/
380 
381 enum
382  {
383  SCM_RIGHTS = 0x01, /* Transfer file descriptors. */
384 #define SCM_RIGHTS SCM_RIGHTS
385 #ifdef __USE_BSD
386  SCM_CREDENTIALS = 0x02, /* Credentials passing. */
387 # define SCM_CREDENTIALS SCM_CREDENTIALS
388 #endif
389  __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */
390  };
391 
392 struct msghdr
393  {
394  void *msg_name; /* Address to send to/receive from. */
395  socklen_t msg_namelen; /* Length of address data. */
396 
397  struct iovec *msg_iov; /* Vector of data to send/receive into. */
398  size_t msg_iovlen; /* Number of elements in the vector. */
399 
400  void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
401  size_t msg_controllen; /* Ancillary data buffer length. */
402 
403  int msg_flags; /* Flags on received message. */
404  };
405 
406 /* Structure used for storage of ancillary data object information. */
407 struct cmsghdr
408  {
409  size_t cmsg_len; /* Length of data in cmsg_data plus length
410  of cmsghdr structure. */
411  int cmsg_level; /* Originating protocol. */
412  int cmsg_type; /* Protocol specific type. */
413  };
414 
415 
416 # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
417 #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
418 #define CMSG_FIRSTHDR(mhdr) \
419  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
420  ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
421 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
422  & (size_t) ~(sizeof (size_t) - 1))
423 #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
424  + CMSG_ALIGN (sizeof (struct cmsghdr)))
425 #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
426 
427 #define SOL_SOCKET 1
428 
429 #define SO_DEBUG 1
430 #define SO_REUSEADDR 2
431 #define SO_TYPE 3
432 #define SO_ERROR 4
433 #define SO_DONTROUTE 5
434 #define SO_BROADCAST 6
435 #define SO_SNDBUF 7
436 #define SO_RCVBUF 8
437 #define SO_KEEPALIVE 9
438 #define SO_OOBINLINE 10
439 #define SO_NO_CHECK 11
440 #define SO_PRIORITY 12
441 #define SO_LINGER 13
442 #define SO_BSDCOMPAT 14
443 /* To add :#define SO_REUSEPORT 15 */
444 #define SO_PASSCRED 16
445 #define SO_PEERCRED 17
446 #define SO_RCVLOWAT 18
447 #define SO_SNDLOWAT 19
448 #define SO_RCVTIMEO 20
449 #define SO_SNDTIMEO 21
450 
451 /* Security levels - as per NRL IPv6 - don't actually do anything */
452 #define SO_SECURITY_AUTHENTICATION 22
453 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23
454 #define SO_SECURITY_ENCRYPTION_NETWORK 24
455 
456 #define SO_BINDTODEVICE 25
457 
458 /* Socket filtering */
459 #define SO_ATTACH_FILTER 26
460 #define SO_DETACH_FILTER 27
461 
462 #define SO_PEERNAME 28
463 #define SO_TIMESTAMP 29
464 #define SCM_TIMESTAMP SO_TIMESTAMP
465 
466 #define SO_ACCEPTCONN 30
467 
468 
469 
470 #ifdef SF_BIGENDIAN
471 #define IP(t,z,y,x) ((x)|(y)<<8|(z)<<16|(t)<<24)
472 #define htons(x) (x)
473 #else
474 #define IP(x,y,z,t) ((x)|(y)<<8|(z)<<16|(t)<<24)
475 #define htons(x) ((((x)&0xff)<<8)|(((x)>>8)&0xff))
476 #endif
477 
478 #define ntohs(x) htons(x)
479 #define SA_IN(sa, ip, port) do{ (sa).sin_family=PF_INET; \
480  (sa).sin_port=(htons(port)); \
481  (sa).sin_addr.s_addr=(ip); \
482  }while(0)
483 
484 
485 #define O_ACCMODE 0003
486 #define O_RDONLY 00
487 #define O_WRONLY 01
488 #define O_RDWR 02
489 #define O_CREAT 0100 /* not fcntl */
490 #define O_EXCL 0200 /* not fcntl */
491 #define O_NOCTTY 0400 /* not fcntl */
492 #define O_TRUNC 01000 /* not fcntl */
493 #define O_APPEND 02000
494 #define O_NONBLOCK 04000
495 #define O_NDELAY O_NONBLOCK
496 #define O_SYNC 010000
497 #define FASYNC 020000 /* fcntl, for BSD compatibility */
498 #define O_DIRECT 040000 /* direct disk access hint */
499 #define O_LARGEFILE 0100000
500 #define O_DIRECTORY 0200000 /* must be a directory */
501 #define O_NOFOLLOW 0400000 /* don't follow links */
502 
503 #define F_DUPFD 0 /* dup */
504 #define F_GETFD 1 /* get close_on_exec */
505 #define F_SETFD 2 /* set/clear close_on_exec */
506 #define F_GETFL 3 /* get file->f_flags */
507 #define F_SETFL 4 /* set file->f_flags */
508 #define F_GETLK 5
509 #define F_SETLK 6
510 #define F_SETLKW 7
511 
512 #define F_SETOWN 8 /* for sockets. */
513 #define F_GETOWN 9 /* for sockets. */
514 #define F_SETSIG 10 /* for sockets. */
515 #define F_GETSIG 11 /* for sockets. */
516 
517 #define F_GETLK64 12 /* using 'struct flock64' */
518 #define F_SETLK64 13
519 #define F_SETLKW64 14
520 
521 /* for F_[GET|SET]FL */
522 #define FD_CLOEXEC 1 /* actually anything with low bit set goes */
523 
524 /* for posix fcntl() and lockf() */
525 #define F_RDLCK 0
526 #define F_WRLCK 1
527 #define F_UNLCK 2
528 
529 /* for old implementation of bsd flock () */
530 #define F_EXLCK 4 /* or 3 */
531 #define F_SHLCK 8 /* or 4 */
532 
533 /* for leases */
534 #define F_INPROGRESS 16
535 
536 /* operations for bsd flock(), also used by the kernel implementation */
537 #define LOCK_SH 1 /* shared lock */
538 #define LOCK_EX 2 /* exclusive lock */
539 #define LOCK_NB 4 /* or'd with one of the above to prevent
540  blocking */
541 #define LOCK_UN 8 /* remove lock */
542 
543 #define LOCK_MAND 32 /* This is a mandatory flock */
544 #define LOCK_READ 64 /* ... Which allows concurrent read operations */
545 #define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
546 #define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
547 
548 
549 /**************** from ptrace.h *********/
550 
551 
552 enum __ptrace_request
553 {
554  /* Indicate that the process making this request should be traced.
555  All signals received by this process can be intercepted by its
556  parent, and its parent can use the other `ptrace' requests. */
558 #define PT_TRACE_ME PTRACE_TRACEME
559 
560  /* Return the word in the process's text space at address ADDR. */
562 #define PT_READ_I PTRACE_PEEKTEXT
563 
564  /* Return the word in the process's data space at address ADDR. */
566 #define PT_READ_D PTRACE_PEEKDATA
567 
568  /* Return the word in the process's user area at offset ADDR. */
570 #define PT_READ_U PTRACE_PEEKUSER
571 
572  /* Write the word DATA into the process's text space at address ADDR. */
574 #define PT_WRITE_I PTRACE_POKETEXT
575 
576  /* Write the word DATA into the process's data space at address ADDR. */
578 #define PT_WRITE_D PTRACE_POKEDATA
579 
580  /* Write the word DATA into the process's user area at offset ADDR. */
582 #define PT_WRITE_U PTRACE_POKEUSER
583 
584  /* Continue the process. */
586 #define PT_CONTINUE PTRACE_CONT
587 
588  /* Kill the process. */
590 #define PT_KILL PTRACE_KILL
591 
592  /* Single step the process.
593  This is not supported on all machines. */
595 #define PT_STEP PTRACE_SINGLESTEP
596 
597  /* Get all general purpose registers used by a processes.
598  This is not supported on all machines. */
600 #define PT_GETREGS PTRACE_GETREGS
601 
602  /* Set all general purpose registers used by a processes.
603  This is not supported on all machines. */
605 #define PT_SETREGS PTRACE_SETREGS
606 
607  /* Get all floating point registers used by a processes.
608  This is not supported on all machines. */
610 #define PT_GETFPREGS PTRACE_GETFPREGS
611 
612  /* Set all floating point registers used by a processes.
613  This is not supported on all machines. */
615 #define PT_SETFPREGS PTRACE_SETFPREGS
616 
617  /* Attach to a process that is already running. */
619 #define PT_ATTACH PTRACE_ATTACH
620 
621  /* Detach from a process attached to with PTRACE_ATTACH. */
623 #define PT_DETACH PTRACE_DETACH
624 
625  /* Get all extended floating point registers used by a processes.
626  This is not supported on all machines. */
628 #define PT_GETFPXREGS PTRACE_GETFPXREGS
629 
630  /* Set all extended floating point registers used by a processes.
631  This is not supported on all machines. */
633 #define PT_SETFPXREGS PTRACE_SETFPXREGS
634 
635  /* Continue and stop at the next (return from) syscall. */
636  PTRACE_SYSCALL = 24
637 #define PT_SYSCALL PTRACE_SYSCALL
638 };
639 
640 
641 /************************ ioctl ******************/
642 /* from asm/ioctl.h */
643 
644 #define _IOC_NRBITS 8
645 #define _IOC_TYPEBITS 8
646 #define _IOC_SIZEBITS 14
647 #define _IOC_DIRBITS 2
648 
649 #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
650 #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
651 #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
652 #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
653 
654 #define _IOC_NRSHIFT 0
655 #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
656 #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
657 #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
658 
659 /*
660  * * Direction bits.
661  * */
662 #define _IOC_NONE 0U
663 #define _IOC_WRITE 1U
664 #define _IOC_READ 2U
665 
666 #define _IOC(dir,type,nr,size) \
667  (((dir) << _IOC_DIRSHIFT) | \
668  ((type) << _IOC_TYPESHIFT) | \
669  ((nr) << _IOC_NRSHIFT) | \
670  ((size) << _IOC_SIZESHIFT))
671 
672 /* provoke compile error for invalid uses of size argument */
674 #define _IOC_TYPECHECK(t) \
675  ((sizeof(t) == sizeof(t[1]) && \
676  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
677  sizeof(t) : __invalid_size_argument_for_IOC)
678 
679  /* used to create numbers */
680 #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
681 #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
682 #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
683 #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
684 #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
685 #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
686 #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
687 
688  /* used to decode ioctl numbers.. */
689 #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
690 #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
691 #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
692 #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
693 
694 /* ...and for the drivers/sound files... */
695 
696 #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
697 #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
698 #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
699 #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
700 #define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
701 
702 /* from asm/ioctls.h */
703 
704 #define TCGETS 0x5401
705 #define TCSETS 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
706 #define TCSETSW 0x5403
707 #define TCSETSF 0x5404
708 #define TCGETA 0x5405
709 #define TCSETA 0x5406
710 #define TCSETAW 0x5407
711 #define TCSETAF 0x5408
712 #define TCSBRK 0x5409
713 #define TCXONC 0x540A
714 #define TCFLSH 0x540B
715 #define TIOCEXCL 0x540C
716 #define TIOCNXCL 0x540D
717 #define TIOCSCTTY 0x540E
718 #define TIOCGPGRP 0x540F
719 #define TIOCSPGRP 0x5410
720 #define TIOCOUTQ 0x5411
721 #define TIOCSTI 0x5412
722 #define TIOCGWINSZ 0x5413
723 #define TIOCSWINSZ 0x5414
724 #define TIOCMGET 0x5415
725 #define TIOCMBIS 0x5416
726 #define TIOCMBIC 0x5417
727 #define TIOCMSET 0x5418
728 #define TIOCGSOFTCAR 0x5419
729 #define TIOCSSOFTCAR 0x541A
730 #define FIONREAD 0x541B
731 #define TIOCINQ FIONREAD
732 #define TIOCLINUX 0x541C
733 #define TIOCCONS 0x541D
734 #define TIOCGSERIAL 0x541E
735 #define TIOCSSERIAL 0x541F
736 #define TIOCPKT 0x5420
737 #define FIONBIO 0x5421
738 #define TIOCNOTTY 0x5422
739 #define TIOCSETD 0x5423
740 #define TIOCGETD 0x5424
741 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
742 /* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */
743 #define TIOCSBRK 0x5427 /* BSD compatibility */
744 #define TIOCCBRK 0x5428 /* BSD compatibility */
745 #define TIOCGSID 0x5429 /* Return the session ID of FD */
746 #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
747 #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
748 
749 #define FIONCLEX 0x5450
750 #define FIOCLEX 0x5451
751 #define FIOASYNC 0x5452
752 #define TIOCSERCONFIG 0x5453
753 #define TIOCSERGWILD 0x5454
754 #define TIOCSERSWILD 0x5455
755 #define TIOCGLCKTRMIOS 0x5456
756 #define TIOCSLCKTRMIOS 0x5457
757 #define TIOCSERGSTRUCT 0x5458 /* For debugging only */
758 #define TIOCSERGETLSR 0x5459 /* Get line status register */
759 #define TIOCSERGETMULTI 0x545A /* Get multiport config */
760 #define TIOCSERSETMULTI 0x545B /* Set multiport config */
761 
762 #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
763 #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
764 #define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
765 #define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
766 #define FIOQSIZE 0x5460
767 
768 /* Used for packet mode */
769 #define TIOCPKT_DATA 0
770 #define TIOCPKT_FLUSHREAD 1
771 #define TIOCPKT_FLUSHWRITE 2
772 #define TIOCPKT_STOP 4
773 #define TIOCPKT_START 8
774 #define TIOCPKT_NOSTOP 16
775 #define TIOCPKT_DOSTOP 32
776 
777 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
778 
779 
780 
781 /********************** termio *******************/
782 /* from /usr/include/asm/termios.h */
783 
784 struct winsize {
785  unsigned short ws_row;
786  unsigned short ws_col;
787  unsigned short ws_xpixel;
788  unsigned short ws_ypixel;
789 };
790 
791 #define NCC 8
792 struct termio {
793  unsigned short c_iflag; /* input mode flags */
794  unsigned short c_oflag; /* output mode flags */
795  unsigned short c_cflag; /* control mode flags */
796  unsigned short c_lflag; /* local mode flags */
797  unsigned char c_line; /* line discipline */
798  unsigned char c_cc[NCC]; /* control characters */
799 };
800 
801 /* modem lines */
802 #define TIOCM_LE 0x001
803 #define TIOCM_DTR 0x002
804 #define TIOCM_RTS 0x004
805 #define TIOCM_ST 0x008
806 #define TIOCM_SR 0x010
807 #define TIOCM_CTS 0x020
808 #define TIOCM_CAR 0x040
809 #define TIOCM_RNG 0x080
810 #define TIOCM_DSR 0x100
811 #define TIOCM_CD TIOCM_CAR
812 #define TIOCM_RI TIOCM_RNG
813 #define TIOCM_OUT1 0x2000
814 #define TIOCM_OUT2 0x4000
815 #define TIOCM_LOOP 0x8000
816 
817 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
818 
819 /* line disciplines */
820 #define N_TTY 0
821 #define N_SLIP 1
822 #define N_MOUSE 2
823 #define N_PPP 3
824 #define N_STRIP 4
825 #define N_AX25 5
826 #define N_X25 6 /* X.25 async */
827 #define N_6PACK 7
828 #define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
829 #define N_R3964 9 /* Reserved for Simatic R3964 module */
830 #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
831 #define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
832 #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
833 #define N_HDLC 13 /* synchronous HDLC */
834 #define N_SYNC_PPP 14 /* synchronous PPP */
835 #define N_HCI 15 /* Bluetooth HCI UART */
836 
837 typedef unsigned char cc_t;
838 typedef unsigned int speed_t;
839 typedef unsigned int tcflag_t;
840 
841 #define NCCS 19
842 struct termios {
843  tcflag_t c_iflag; /* input mode flags */
844  tcflag_t c_oflag; /* output mode flags */
845  tcflag_t c_cflag; /* control mode flags */
846  tcflag_t c_lflag; /* local mode flags */
847  cc_t c_line; /* line discipline */
848  cc_t c_cc[NCCS]; /* control characters */
849 };
850 
851 /* c_cc characters */
852 #define VINTR 0
853 #define VQUIT 1
854 #define VERASE 2
855 #define VKILL 3
856 #define VEOF 4
857 #define VTIME 5
858 #define VMIN 6
859 #define VSWTC 7
860 #define VSTART 8
861 #define VSTOP 9
862 #define VSUSP 10
863 #define VEOL 11
864 #define VREPRINT 12
865 #define VDISCARD 13
866 #define VWERASE 14
867 #define VLNEXT 15
868 #define VEOL2 16
869 
870 /* c_iflag bits */
871 #define IGNBRK 0000001
872 #define BRKINT 0000002
873 #define IGNPAR 0000004
874 #define PARMRK 0000010
875 #define INPCK 0000020
876 #define ISTRIP 0000040
877 #define INLCR 0000100
878 #define IGNCR 0000200
879 #define ICRNL 0000400
880 #define IUCLC 0001000
881 #define IXON 0002000
882 #define IXANY 0004000
883 #define IXOFF 0010000
884 #define IMAXBEL 0020000
885 
886 /* c_oflag bits */
887 #define OPOST 0000001
888 #define OLCUC 0000002
889 #define ONLCR 0000004
890 #define OCRNL 0000010
891 #define ONOCR 0000020
892 #define ONLRET 0000040
893 #define OFILL 0000100
894 #define OFDEL 0000200
895 #define NLDLY 0000400
896 #define NL0 0000000
897 #define NL1 0000400
898 #define CRDLY 0003000
899 #define CR0 0000000
900 #define CR1 0001000
901 #define CR2 0002000
902 #define CR3 0003000
903 #define TABDLY 0014000
904 #define TAB0 0000000
905 #define TAB1 0004000
906 #define TAB2 0010000
907 #define TAB3 0014000
908 #define XTABS 0014000
909 #define BSDLY 0020000
910 #define BS0 0000000
911 #define BS1 0020000
912 #define VTDLY 0040000
913 #define VT0 0000000
914 #define VT1 0040000
915 #define FFDLY 0100000
916 #define FF0 0000000
917 #define FF1 0100000
918 
919 /* c_cflag bit meaning */
920 #define CBAUD 0010017
921 #define B0 0000000 /* hang up */
922 #define B50 0000001
923 #define B75 0000002
924 #define B110 0000003
925 #define B134 0000004
926 #define B150 0000005
927 #define B200 0000006
928 #define B300 0000007
929 #define B600 0000010
930 #define B1200 0000011
931 #define B1800 0000012
932 #define B2400 0000013
933 #define B4800 0000014
934 #define B9600 0000015
935 #define B19200 0000016
936 #define B38400 0000017
937 #define EXTA B19200
938 #define EXTB B38400
939 #define CSIZE 0000060
940 #define CS5 0000000
941 #define CS6 0000020
942 #define CS7 0000040
943 #define CS8 0000060
944 #define CSTOPB 0000100
945 #define CREAD 0000200
946 #define PARENB 0000400
947 #define PARODD 0001000
948 #define HUPCL 0002000
949 #define CLOCAL 0004000
950 #define CBAUDEX 0010000
951 #define B57600 0010001
952 #define B115200 0010002
953 #define B230400 0010003
954 #define B460800 0010004
955 #define B500000 0010005
956 #define B576000 0010006
957 #define B921600 0010007
958 #define B1000000 0010010
959 #define B1152000 0010011
960 #define B1500000 0010012
961 #define B2000000 0010013
962 #define B2500000 0010014
963 #define B3000000 0010015
964 #define B3500000 0010016
965 #define B4000000 0010017
966 #define CIBAUD 002003600000 /* input baud rate (not used) */
967 #define CMSPAR 010000000000 /* mark or space (stick) parity */
968 #define CRTSCTS 020000000000 /* flow control */
969 
970 /* c_lflag bits */
971 #define ISIG 0000001
972 #define ICANON 0000002
973 #define XCASE 0000004
974 #define ECHO 0000010
975 #define ECHOE 0000020
976 #define ECHOK 0000040
977 #define ECHONL 0000100
978 #define NOFLSH 0000200
979 #define TOSTOP 0000400
980 #define ECHOCTL 0001000
981 #define ECHOPRT 0002000
982 #define ECHOKE 0004000
983 #define FLUSHO 0010000
984 #define PENDIN 0040000
985 #define IEXTEN 0100000
986 
987 /* tcflow() and TCXONC use these */
988 #define TCOOFF 0
989 #define TCOON 1
990 #define TCIOFF 2
991 #define TCION 3
992 
993 /* tcflush() and TCFLSH use these */
994 #define TCIFLUSH 0
995 #define TCOFLUSH 1
996 #define TCIOFLUSH 2
997 
998 /* tcsetattr uses these */
999 #define TCSANOW 0
1000 #define TCSADRAIN 1
1001 #define TCSAFLUSH 2
1002 
1003 
1004 
1005 #endif /* SFTYPES_H */
1006 
1007 /****************** Elf headers ***************/
1008 /* From /usr/include/elf.h */
1009 
1010 
1011 
1012 /* Type for a 16-bit quantity. */
1014 typedef uint16_t Elf64_Half;
1015 
1016 /* Types for signed and unsigned 32-bit quantities. */
1020 typedef int32_t Elf64_Sword;
1021 
1022 /* Types for signed and unsigned 64-bit quantities. */
1026 typedef int64_t Elf64_Sxword;
1027 
1028 /* Type of addresses. */
1030 typedef uint64_t Elf64_Addr;
1031 
1032 /* Type of file offsets. */
1034 typedef uint64_t Elf64_Off;
1035 
1036 /* Type for section indices, which are 16-bit quantities. */
1038 typedef uint16_t Elf64_Section;
1039 
1040 /* Type for version symbol information. */
1042 typedef Elf64_Half Elf64_Versym;
1043 
1044 
1045 /* The ELF file header. This appears at the start of every ELF file. */
1047 #define EI_NIDENT (16)
1048 
1049 typedef struct
1050 {
1051  unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
1052  Elf32_Half e_type; /* Object file type */
1053  Elf32_Half e_machine; /* Architecture */
1054  Elf32_Word e_version; /* Object file version */
1055  Elf32_Addr e_entry; /* Entry point virtual address */
1056  Elf32_Off e_phoff; /* Program header table file offset */
1057  Elf32_Off e_shoff; /* Section header table file offset */
1058  Elf32_Word e_flags; /* Processor-specific flags */
1059  Elf32_Half e_ehsize; /* ELF header size in bytes */
1060  Elf32_Half e_phentsize; /* Program header table entry size */
1061  Elf32_Half e_phnum; /* Program header table entry count */
1062  Elf32_Half e_shentsize; /* Section header table entry size */
1063  Elf32_Half e_shnum; /* Section header table entry count */
1064  Elf32_Half e_shstrndx; /* Section header string table index */
1065 } Elf32_Ehdr;
1066 
1067 typedef struct
1068 {
1069  unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
1070  Elf64_Half e_type; /* Object file type */
1071  Elf64_Half e_machine; /* Architecture */
1072  Elf64_Word e_version; /* Object file version */
1073  Elf64_Addr e_entry; /* Entry point virtual address */
1074  Elf64_Off e_phoff; /* Program header table file offset */
1075  Elf64_Off e_shoff; /* Section header table file offset */
1076  Elf64_Word e_flags; /* Processor-specific flags */
1077  Elf64_Half e_ehsize; /* ELF header size in bytes */
1078  Elf64_Half e_phentsize; /* Program header table entry size */
1079  Elf64_Half e_phnum; /* Program header table entry count */
1080  Elf64_Half e_shentsize; /* Section header table entry size */
1081  Elf64_Half e_shnum; /* Section header table entry count */
1082  Elf64_Half e_shstrndx; /* Section header string table index */
1083 } Elf64_Ehdr;
1084 
1085 /* Fields in the e_ident array. The EI_* macros are indices into the
1086  array. The macros under each EI_* macro are the values the byte
1087  may have. */
1089 #define EI_MAG0 0 /* File identification byte 0 index */
1090 #define ELFMAG0 0x7f /* Magic number byte 0 */
1092 #define EI_MAG1 1 /* File identification byte 1 index */
1093 #define ELFMAG1 'E' /* Magic number byte 1 */
1095 #define EI_MAG2 2 /* File identification byte 2 index */
1096 #define ELFMAG2 'L' /* Magic number byte 2 */
1098 #define EI_MAG3 3 /* File identification byte 3 index */
1099 #define ELFMAG3 'F' /* Magic number byte 3 */
1100 
1101 /* Conglomeration of the identification bytes, for easy testing as a word. */
1102 #define ELFMAG "\177ELF"
1103 #define SELFMAG 4
1105 #define EI_CLASS 4 /* File class byte index */
1106 #define ELFCLASSNONE 0 /* Invalid class */
1107 #define ELFCLASS32 1 /* 32-bit objects */
1108 #define ELFCLASS64 2 /* 64-bit objects */
1109 #define ELFCLASSNUM 3
1111 #define EI_DATA 5 /* Data encoding byte index */
1112 #define ELFDATANONE 0 /* Invalid data encoding */
1113 #define ELFDATA2LSB 1 /* 2's complement, little endian */
1114 #define ELFDATA2MSB 2 /* 2's complement, big endian */
1115 #define ELFDATANUM 3
1117 #define EI_VERSION 6 /* File version byte index */
1118  /* Value must be EV_CURRENT */
1120 #define EI_OSABI 7 /* OS ABI identification */
1121 #define ELFOSABI_NONE 0 /* UNIX System V ABI */
1122 #define ELFOSABI_SYSV 0 /* Alias. */
1123 #define ELFOSABI_HPUX 1 /* HP-UX */
1124 #define ELFOSABI_NETBSD 2 /* NetBSD. */
1125 #define ELFOSABI_LINUX 3 /* Linux. */
1126 #define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
1127 #define ELFOSABI_AIX 7 /* IBM AIX. */
1128 #define ELFOSABI_IRIX 8 /* SGI Irix. */
1129 #define ELFOSABI_FREEBSD 9 /* FreeBSD. */
1130 #define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
1131 #define ELFOSABI_MODESTO 11 /* Novell Modesto. */
1132 #define ELFOSABI_OPENBSD 12 /* OpenBSD. */
1133 #define ELFOSABI_ARM 97 /* ARM */
1134 #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
1136 #define EI_ABIVERSION 8 /* ABI version */
1138 #define EI_PAD 9 /* Byte index of padding bytes */
1139 
1140 /* Legal values for e_type (object file type). */
1142 #define ET_NONE 0 /* No file type */
1143 #define ET_REL 1 /* Relocatable file */
1144 #define ET_EXEC 2 /* Executable file */
1145 #define ET_DYN 3 /* Shared object file */
1146 #define ET_CORE 4 /* Core file */
1147 #define ET_NUM 5 /* Number of defined types */
1148 #define ET_LOOS 0xfe00 /* OS-specific range start */
1149 #define ET_HIOS 0xfeff /* OS-specific range end */
1150 #define ET_LOPROC 0xff00 /* Processor-specific range start */
1151 #define ET_HIPROC 0xffff /* Processor-specific range end */
1152 
1153 /* Legal values for e_machine (architecture). */
1155 #define EM_NONE 0 /* No machine */
1156 #define EM_M32 1 /* AT&T WE 32100 */
1157 #define EM_SPARC 2 /* SUN SPARC */
1158 #define EM_386 3 /* Intel 80386 */
1159 #define EM_68K 4 /* Motorola m68k family */
1160 #define EM_88K 5 /* Motorola m88k family */
1161 #define EM_860 7 /* Intel 80860 */
1162 #define EM_MIPS 8 /* MIPS R3000 big-endian */
1163 #define EM_S370 9 /* IBM System/370 */
1164 #define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
1166 #define EM_PARISC 15 /* HPPA */
1167 #define EM_VPP500 17 /* Fujitsu VPP500 */
1168 #define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
1169 #define EM_960 19 /* Intel 80960 */
1170 #define EM_PPC 20 /* PowerPC */
1171 #define EM_PPC64 21 /* PowerPC 64-bit */
1172 #define EM_S390 22 /* IBM S390 */
1174 #define EM_V800 36 /* NEC V800 series */
1175 #define EM_FR20 37 /* Fujitsu FR20 */
1176 #define EM_RH32 38 /* TRW RH-32 */
1177 #define EM_RCE 39 /* Motorola RCE */
1178 #define EM_ARM 40 /* ARM */
1179 #define EM_FAKE_ALPHA 41 /* Digital Alpha */
1180 #define EM_SH 42 /* Hitachi SH */
1181 #define EM_SPARCV9 43 /* SPARC v9 64-bit */
1182 #define EM_TRICORE 44 /* Siemens Tricore */
1183 #define EM_ARC 45 /* Argonaut RISC Core */
1184 #define EM_H8_300 46 /* Hitachi H8/300 */
1185 #define EM_H8_300H 47 /* Hitachi H8/300H */
1186 #define EM_H8S 48 /* Hitachi H8S */
1187 #define EM_H8_500 49 /* Hitachi H8/500 */
1188 #define EM_IA_64 50 /* Intel Merced */
1189 #define EM_MIPS_X 51 /* Stanford MIPS-X */
1190 #define EM_COLDFIRE 52 /* Motorola Coldfire */
1191 #define EM_68HC12 53 /* Motorola M68HC12 */
1192 #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
1193 #define EM_PCP 55 /* Siemens PCP */
1194 #define EM_NCPU 56 /* Sony nCPU embeeded RISC */
1195 #define EM_NDR1 57 /* Denso NDR1 microprocessor */
1196 #define EM_STARCORE 58 /* Motorola Start*Core processor */
1197 #define EM_ME16 59 /* Toyota ME16 processor */
1198 #define EM_ST100 60 /* STMicroelectronic ST100 processor */
1199 #define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
1200 #define EM_X86_64 62 /* AMD x86-64 architecture */
1201 #define EM_PDSP 63 /* Sony DSP Processor */
1203 #define EM_FX66 66 /* Siemens FX66 microcontroller */
1204 #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
1205 #define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
1206 #define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
1207 #define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
1208 #define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
1209 #define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
1210 #define EM_SVX 73 /* Silicon Graphics SVx */
1211 #define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
1212 #define EM_VAX 75 /* Digital VAX */
1213 #define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
1214 #define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
1215 #define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
1216 #define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
1217 #define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
1218 #define EM_HUANY 81 /* Harvard University machine-independent object files */
1219 #define EM_PRISM 82 /* SiTera Prism */
1220 #define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
1221 #define EM_FR30 84 /* Fujitsu FR30 */
1222 #define EM_D10V 85 /* Mitsubishi D10V */
1223 #define EM_D30V 86 /* Mitsubishi D30V */
1224 #define EM_V850 87 /* NEC v850 */
1225 #define EM_M32R 88 /* Mitsubishi M32R */
1226 #define EM_MN10300 89 /* Matsushita MN10300 */
1227 #define EM_MN10200 90 /* Matsushita MN10200 */
1228 #define EM_PJ 91 /* picoJava */
1229 #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
1230 #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
1231 #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
1232 #define EM_NUM 95
1233 
1234 /* If it is necessary to assign new unofficial EM_* values, please
1235  pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
1236  chances of collision with official or non-GNU unofficial values. */
1238 #define EM_ALPHA 0x9026
1239 
1240 /* Legal values for e_version (version). */
1242 #define EV_NONE 0 /* Invalid ELF version */
1243 #define EV_CURRENT 1 /* Current version */
1244 #define EV_NUM 2
1245 
1246 /* Section header. */
1247 
1248 typedef struct
1249 {
1250  Elf32_Word sh_name; /* Section name (string tbl index) */
1251  Elf32_Word sh_type; /* Section type */
1252  Elf32_Word sh_flags; /* Section flags */
1253  Elf32_Addr sh_addr; /* Section virtual addr at execution */
1254  Elf32_Off sh_offset; /* Section file offset */
1255  Elf32_Word sh_size; /* Section size in bytes */
1256  Elf32_Word sh_link; /* Link to another section */
1257  Elf32_Word sh_info; /* Additional section information */
1258  Elf32_Word sh_addralign; /* Section alignment */
1259  Elf32_Word sh_entsize; /* Entry size if section holds table */
1260 } Elf32_Shdr;
1261 
1262 typedef struct
1263 {
1264  Elf64_Word sh_name; /* Section name (string tbl index) */
1265  Elf64_Word sh_type; /* Section type */
1266  Elf64_Xword sh_flags; /* Section flags */
1267  Elf64_Addr sh_addr; /* Section virtual addr at execution */
1268  Elf64_Off sh_offset; /* Section file offset */
1269  Elf64_Xword sh_size; /* Section size in bytes */
1270  Elf64_Word sh_link; /* Link to another section */
1271  Elf64_Word sh_info; /* Additional section information */
1272  Elf64_Xword sh_addralign; /* Section alignment */
1273  Elf64_Xword sh_entsize; /* Entry size if section holds table */
1274 } Elf64_Shdr;
1275 
1276 /* Special section indices. */
1278 #define SHN_UNDEF 0 /* Undefined section */
1279 #define SHN_LORESERVE 0xff00 /* Start of reserved indices */
1280 #define SHN_LOPROC 0xff00 /* Start of processor-specific */
1281 #define SHN_BEFORE 0xff00 /* Order section before all others
1282  (Solaris). */
1283 #define SHN_AFTER 0xff01 /* Order section after all others
1284  (Solaris). */
1285 #define SHN_HIPROC 0xff1f /* End of processor-specific */
1286 #define SHN_LOOS 0xff20 /* Start of OS-specific */
1287 #define SHN_HIOS 0xff3f /* End of OS-specific */
1288 #define SHN_ABS 0xfff1 /* Associated symbol is absolute */
1289 #define SHN_COMMON 0xfff2 /* Associated symbol is common */
1290 #define SHN_XINDEX 0xffff /* Index is in extra table. */
1291 #define SHN_HIRESERVE 0xffff /* End of reserved indices */
1293 /* Legal values for sh_type (section type). */
1295 #define SHT_NULL 0 /* Section header table entry unused */
1296 #define SHT_PROGBITS 1 /* Program data */
1297 #define SHT_SYMTAB 2 /* Symbol table */
1298 #define SHT_STRTAB 3 /* String table */
1299 #define SHT_RELA 4 /* Relocation entries with addends */
1300 #define SHT_HASH 5 /* Symbol hash table */
1301 #define SHT_DYNAMIC 6 /* Dynamic linking information */
1302 #define SHT_NOTE 7 /* Notes */
1303 #define SHT_NOBITS 8 /* Program space with no data (bss) */
1304 #define SHT_REL 9 /* Relocation entries, no addends */
1305 #define SHT_SHLIB 10 /* Reserved */
1306 #define SHT_DYNSYM 11 /* Dynamic linker symbol table */
1307 #define SHT_INIT_ARRAY 14 /* Array of constructors */
1308 #define SHT_FINI_ARRAY 15 /* Array of destructors */
1309 #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
1310 #define SHT_GROUP 17 /* Section group */
1311 #define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
1312 #define SHT_NUM 19 /* Number of defined types. */
1313 #define SHT_LOOS 0x60000000 /* Start OS-specific */
1314 #define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */
1315 #define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */
1316 #define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */
1317 #define SHT_SUNW_move 0x6ffffffa
1318 #define SHT_SUNW_COMDAT 0x6ffffffb
1319 #define SHT_SUNW_syminfo 0x6ffffffc
1320 #define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */
1321 #define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */
1322 #define SHT_GNU_versym 0x6fffffff /* Version symbol table. */
1323 #define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
1324 #define SHT_HIOS 0x6fffffff /* End OS-specific type */
1325 #define SHT_LOPROC 0x70000000 /* Start of processor-specific */
1326 #define SHT_HIPROC 0x7fffffff /* End of processor-specific */
1327 #define SHT_LOUSER 0x80000000 /* Start of application-specific */
1328 #define SHT_HIUSER 0x8fffffff /* End of application-specific */
1330 /* Legal values for sh_flags (section flags). */
1332 #define SHF_WRITE (1 << 0) /* Writable */
1333 #define SHF_ALLOC (1 << 1) /* Occupies memory during execution */
1334 #define SHF_EXECINSTR (1 << 2) /* Executable */
1335 #define SHF_MERGE (1 << 4) /* Might be merged */
1336 #define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */
1337 #define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */
1338 #define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */
1339 #define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling
1340  required */
1341 #define SHF_GROUP (1 << 9) /* Section is member of a group. */
1342 #define SHF_TLS (1 << 10) /* Section hold thread-local data. */
1343 #define SHF_MASKOS 0x0ff00000 /* OS-specific. */
1344 #define SHF_MASKPROC 0xf0000000 /* Processor-specific */
1345 #define SHF_ORDERED (1 << 30) /* Special ordering requirement
1346  (Solaris). */
1347 #define SHF_EXCLUDE (1 << 31) /* Section is excluded unless
1348  referenced or allocated (Solaris).*/
1349 
1350 /* Section group handling. */
1351 #define GRP_COMDAT 0x1 /* Mark group as COMDAT. */
1352 
1353 /* Symbol table entry. */
1354 
1355 typedef struct
1356 {
1357  Elf32_Word st_name; /* Symbol name (string tbl index) */
1358  Elf32_Addr st_value; /* Symbol value */
1359  Elf32_Word st_size; /* Symbol size */
1360  unsigned char st_info; /* Symbol type and binding */
1361  unsigned char st_other; /* Symbol visibility */
1362  Elf32_Section st_shndx; /* Section index */
1363 } Elf32_Sym;
1364 
1365 typedef struct
1366 {
1367  Elf64_Word st_name; /* Symbol name (string tbl index) */
1368  unsigned char st_info; /* Symbol type and binding */
1369  unsigned char st_other; /* Symbol visibility */
1370  Elf64_Section st_shndx; /* Section index */
1371  Elf64_Addr st_value; /* Symbol value */
1372  Elf64_Xword st_size; /* Symbol size */
1373 } Elf64_Sym;
1374 
1375 /* The syminfo section if available contains additional information about
1376  every dynamic symbol. */
1377 
1378 typedef struct
1379 {
1380  Elf32_Half si_boundto; /* Direct bindings, symbol bound to */
1381  Elf32_Half si_flags; /* Per symbol flags */
1382 } Elf32_Syminfo;
1383 
1384 typedef struct
1386  Elf64_Half si_boundto; /* Direct bindings, symbol bound to */
1387  Elf64_Half si_flags; /* Per symbol flags */
1388 } Elf64_Syminfo;
1389 
1390 /* Possible values for si_boundto. */
1391 #define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */
1392 #define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */
1393 #define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */
1394 
1395 /* Possible bitmasks for si_flags. */
1396 #define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
1397 #define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
1398 #define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
1399 #define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy
1400  loaded */
1401 /* Syminfo version values. */
1402 #define SYMINFO_NONE 0
1403 #define SYMINFO_CURRENT 1
1404 #define SYMINFO_NUM 2
1405 
1406 
1407 /* How to extract and insert information held in the st_info field. */
1409 #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
1410 #define ELF32_ST_TYPE(val) ((val) & 0xf)
1411 #define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
1412 
1413 /* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
1414 #define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
1415 #define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
1416 #define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
1418 /* Legal values for ST_BIND subfield of st_info (symbol binding). */
1420 #define STB_LOCAL 0 /* Local symbol */
1421 #define STB_GLOBAL 1 /* Global symbol */
1422 #define STB_WEAK 2 /* Weak symbol */
1423 #define STB_NUM 3 /* Number of defined types. */
1424 #define STB_LOOS 10 /* Start of OS-specific */
1425 #define STB_HIOS 12 /* End of OS-specific */
1426 #define STB_LOPROC 13 /* Start of processor-specific */
1427 #define STB_HIPROC 15 /* End of processor-specific */
1429 /* Legal values for ST_TYPE subfield of st_info (symbol type). */
1431 #define STT_NOTYPE 0 /* Symbol type is unspecified */
1432 #define STT_OBJECT 1 /* Symbol is a data object */
1433 #define STT_FUNC 2 /* Symbol is a code object */
1434 #define STT_SECTION 3 /* Symbol associated with a section */
1435 #define STT_FILE 4 /* Symbol's name is file name */
1436 #define STT_COMMON 5 /* Symbol is a common data object */
1437 #define STT_TLS 6 /* Symbol is thread-local data object*/
1438 #define STT_NUM 7 /* Number of defined types. */
1439 #define STT_LOOS 10 /* Start of OS-specific */
1440 #define STT_HIOS 12 /* End of OS-specific */
1441 #define STT_LOPROC 13 /* Start of processor-specific */
1442 #define STT_HIPROC 15 /* End of processor-specific */
1443 
1444 
1445 /* Symbol table indices are found in the hash buckets and chain table
1446  of a symbol hash table section. This special index value indicates
1447  the end of a chain, meaning no further symbols are found in that bucket. */
1448 
1449 #define STN_UNDEF 0 /* End of a chain. */
1451 
1452 /* How to extract and insert information held in the st_other field. */
1454 #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
1456 /* For ELF64 the definitions are the same. */
1457 #define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
1458 
1459 /* Symbol visibility specification encoded in the st_other field. */
1460 #define STV_DEFAULT 0 /* Default symbol visibility rules */
1461 #define STV_INTERNAL 1 /* Processor specific hidden class */
1462 #define STV_HIDDEN 2 /* Sym unavailable in other modules */
1463 #define STV_PROTECTED 3 /* Not preemptible, not exported */
1465 
1466 /* Relocation table entry without addend (in section of type SHT_REL). */
1467 
1468 typedef struct
1469 {
1470  Elf32_Addr r_offset; /* Address */
1471  Elf32_Word r_info; /* Relocation type and symbol index */
1472 } Elf32_Rel;
1473 
1474 /* I have seen two different definitions of the Elf64_Rel and
1475  Elf64_Rela structures, so we'll leave them out until Novell (or
1476  whoever) gets their act together. */
1477 /* The following, at least, is used on Sparc v9, MIPS, and Alpha. */
1478 
1479 typedef struct
1480 {
1481  Elf64_Addr r_offset; /* Address */
1482  Elf64_Xword r_info; /* Relocation type and symbol index */
1485 /* Relocation table entry with addend (in section of type SHT_RELA). */
1486 
1487 typedef struct
1488 {
1489  Elf32_Addr r_offset; /* Address */
1490  Elf32_Word r_info; /* Relocation type and symbol index */
1491  Elf32_Sword r_addend; /* Addend */
1492 } Elf32_Rela;
1493 
1494 typedef struct
1495 {
1496  Elf64_Addr r_offset; /* Address */
1497  Elf64_Xword r_info; /* Relocation type and symbol index */
1498  Elf64_Sxword r_addend; /* Addend */
1499 } Elf64_Rela;
1501 /* How to extract and insert information held in the r_info field. */
1503 #define ELF32_R_SYM(val) ((val) >> 8)
1504 #define ELF32_R_TYPE(val) ((val) & 0xff)
1505 #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
1506 
1507 #define ELF64_R_SYM(i) ((i) >> 32)
1508 #define ELF64_R_TYPE(i) ((i) & 0xffffffff)
1509 #define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
1510 
1511 /* Program segment header. */
1512 
1513 typedef struct
1514 {
1515  Elf32_Word p_type; /* Segment type */
1516  Elf32_Off p_offset; /* Segment file offset */
1517  Elf32_Addr p_vaddr; /* Segment virtual address */
1518  Elf32_Addr p_paddr; /* Segment physical address */
1519  Elf32_Word p_filesz; /* Segment size in file */
1520  Elf32_Word p_memsz; /* Segment size in memory */
1521  Elf32_Word p_flags; /* Segment flags */
1522  Elf32_Word p_align; /* Segment alignment */
1523 } Elf32_Phdr;
1524 
1525 typedef struct
1526 {
1527  Elf64_Word p_type; /* Segment type */
1528  Elf64_Word p_flags; /* Segment flags */
1529  Elf64_Off p_offset; /* Segment file offset */
1530  Elf64_Addr p_vaddr; /* Segment virtual address */
1531  Elf64_Addr p_paddr; /* Segment physical address */
1532  Elf64_Xword p_filesz; /* Segment size in file */
1533  Elf64_Xword p_memsz; /* Segment size in memory */
1534  Elf64_Xword p_align; /* Segment alignment */
1537 /* Legal values for p_type (segment type). */
1539 #define PT_NULL 0 /* Program header table entry unused */
1540 #define PT_LOAD 1 /* Loadable program segment */
1541 #define PT_DYNAMIC 2 /* Dynamic linking information */
1542 #define PT_INTERP 3 /* Program interpreter */
1543 #define PT_NOTE 4 /* Auxiliary information */
1544 #define PT_SHLIB 5 /* Reserved */
1545 #define PT_PHDR 6 /* Entry for header table itself */
1546 #define PT_TLS 7 /* Thread-local storage segment */
1547 #define PT_NUM 8 /* Number of defined types */
1548 #define PT_LOOS 0x60000000 /* Start of OS-specific */
1549 #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
1550 #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
1551 #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
1552 #define PT_LOSUNW 0x6ffffffa
1553 #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
1554 #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
1555 #define PT_HISUNW 0x6fffffff
1556 #define PT_HIOS 0x6fffffff /* End of OS-specific */
1557 #define PT_LOPROC 0x70000000 /* Start of processor-specific */
1558 #define PT_HIPROC 0x7fffffff /* End of processor-specific */
1560 /* Legal values for p_flags (segment flags). */
1561 
1562 #define PF_X (1 << 0) /* Segment is executable */
1563 #define PF_W (1 << 1) /* Segment is writable */
1564 #define PF_R (1 << 2) /* Segment is readable */
1565 #define PF_MASKOS 0x0ff00000 /* OS-specific */
1566 #define PF_MASKPROC 0xf0000000 /* Processor-specific */
1568 /* Legal values for note segment descriptor types for core files. */
1570 #define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
1571 #define NT_FPREGSET 2 /* Contains copy of fpregset struct */
1572 #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
1573 #define NT_PRXREG 4 /* Contains copy of prxregset struct */
1574 #define NT_TASKSTRUCT 4 /* Contains copy of task structure */
1575 #define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */
1576 #define NT_AUXV 6 /* Contains copy of auxv array */
1577 #define NT_GWINDOWS 7 /* Contains copy of gwindows struct */
1578 #define NT_ASRS 8 /* Contains copy of asrset struct */
1579 #define NT_PSTATUS 10 /* Contains copy of pstatus struct */
1580 #define NT_PSINFO 13 /* Contains copy of psinfo struct */
1581 #define NT_PRCRED 14 /* Contains copy of prcred struct */
1582 #define NT_UTSNAME 15 /* Contains copy of utsname struct */
1583 #define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */
1584 #define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */
1585 #define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/
1586 
1587 /* Legal values for the note segment descriptor types for object files. */
1588 
1589 #define NT_VERSION 1 /* Contains a version string. */
1590 
1591 
1592 /* Dynamic section entry. */
1593 
1594 typedef struct
1595 {
1596  Elf32_Sword d_tag; /* Dynamic entry type */
1597  union
1598  {
1599  Elf32_Word d_val; /* Integer value */
1600  Elf32_Addr d_ptr; /* Address value */
1601  } d_un;
1602 } Elf32_Dyn;
1603 
1604 typedef struct
1605 {
1606  Elf64_Sxword d_tag; /* Dynamic entry type */
1607  union
1608  {
1609  Elf64_Xword d_val; /* Integer value */
1610  Elf64_Addr d_ptr; /* Address value */
1611  } d_un;
1614 /* Legal values for d_tag (dynamic entry type). */
1616 #define DT_NULL 0 /* Marks end of dynamic section */
1617 #define DT_NEEDED 1 /* Name of needed library */
1618 #define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */
1619 #define DT_PLTGOT 3 /* Processor defined value */
1620 #define DT_HASH 4 /* Address of symbol hash table */
1621 #define DT_STRTAB 5 /* Address of string table */
1622 #define DT_SYMTAB 6 /* Address of symbol table */
1623 #define DT_RELA 7 /* Address of Rela relocs */
1624 #define DT_RELASZ 8 /* Total size of Rela relocs */
1625 #define DT_RELAENT 9 /* Size of one Rela reloc */
1626 #define DT_STRSZ 10 /* Size of string table */
1627 #define DT_SYMENT 11 /* Size of one symbol table entry */
1628 #define DT_INIT 12 /* Address of init function */
1629 #define DT_FINI 13 /* Address of termination function */
1630 #define DT_SONAME 14 /* Name of shared object */
1631 #define DT_RPATH 15 /* Library search path (deprecated) */
1632 #define DT_SYMBOLIC 16 /* Start symbol search here */
1633 #define DT_REL 17 /* Address of Rel relocs */
1634 #define DT_RELSZ 18 /* Total size of Rel relocs */
1635 #define DT_RELENT 19 /* Size of one Rel reloc */
1636 #define DT_PLTREL 20 /* Type of reloc in PLT */
1637 #define DT_DEBUG 21 /* For debugging; unspecified */
1638 #define DT_TEXTREL 22 /* Reloc might modify .text */
1639 #define DT_JMPREL 23 /* Address of PLT relocs */
1640 #define DT_BIND_NOW 24 /* Process relocations of object */
1641 #define DT_INIT_ARRAY 25 /* Array with addresses of init fct */
1642 #define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */
1643 #define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */
1644 #define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */
1645 #define DT_RUNPATH 29 /* Library search path */
1646 #define DT_FLAGS 30 /* Flags for the object being loaded */
1647 #define DT_ENCODING 32 /* Start of encoded range */
1648 #define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
1649 #define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
1650 #define DT_NUM 34 /* Number used */
1651 #define DT_LOOS 0x6000000d /* Start of OS-specific */
1652 #define DT_HIOS 0x6ffff000 /* End of OS-specific */
1653 #define DT_LOPROC 0x70000000 /* Start of processor-specific */
1654 #define DT_HIPROC 0x7fffffff /* End of processor-specific */
1655 #define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */
1657 /* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
1658  Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's
1659  approach. */
1660 #define DT_VALRNGLO 0x6ffffd00
1661 #define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */
1662 #define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */
1663 #define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */
1664 #define DT_CHECKSUM 0x6ffffdf8
1665 #define DT_PLTPADSZ 0x6ffffdf9
1666 #define DT_MOVEENT 0x6ffffdfa
1667 #define DT_MOVESZ 0x6ffffdfb
1668 #define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */
1669 #define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting
1670  the following DT_* entry. */
1671 #define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */
1672 #define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */
1673 #define DT_VALRNGHI 0x6ffffdff
1674 #define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */
1675 #define DT_VALNUM 12
1677 /* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
1678  Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
1680  If any adjustment is made to the ELF object after it has been
1681  built these entries will need to be adjusted. */
1682 #define DT_ADDRRNGLO 0x6ffffe00
1683 #define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */
1684 #define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */
1685 #define DT_CONFIG 0x6ffffefa /* Configuration information. */
1686 #define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */
1687 #define DT_AUDIT 0x6ffffefc /* Object auditing. */
1688 #define DT_PLTPAD 0x6ffffefd /* PLT padding. */
1689 #define DT_MOVETAB 0x6ffffefe /* Move table. */
1690 #define DT_SYMINFO 0x6ffffeff /* Syminfo table. */
1691 #define DT_ADDRRNGHI 0x6ffffeff
1692 #define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */
1693 #define DT_ADDRNUM 10
1694 
1695 /* The versioning entry types. The next are defined as part of the
1696  GNU extension. */
1697 #define DT_VERSYM 0x6ffffff0
1699 #define DT_RELACOUNT 0x6ffffff9
1700 #define DT_RELCOUNT 0x6ffffffa
1702 /* These were chosen by Sun. */
1703 #define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */
1704 #define DT_VERDEF 0x6ffffffc /* Address of version definition
1705  table */
1706 #define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
1707 #define DT_VERNEED 0x6ffffffe /* Address of table with needed
1708  versions */
1709 #define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
1710 #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
1711 #define DT_VERSIONTAGNUM 16
1713 /* Sun added these machine-independent extensions in the "processor-specific"
1714  range. Be compatible. */
1715 #define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */
1716 #define DT_FILTER 0x7fffffff /* Shared object to get values from */
1717 #define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
1718 #define DT_EXTRANUM 3
1720 /* Values of `d_un.d_val' in the DT_FLAGS entry. */
1721 #define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */
1722 #define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */
1723 #define DF_TEXTREL 0x00000004 /* Object contains text relocations */
1724 #define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */
1725 #define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */
1727 /* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
1728  entry in the dynamic section. */
1729 #define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */
1730 #define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */
1731 #define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */
1732 #define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/
1733 #define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/
1734 #define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/
1735 #define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */
1736 #define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */
1737 #define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */
1738 #define DF_1_TRANS 0x00000200
1739 #define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */
1740 #define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */
1741 #define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */
1742 #define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/
1743 #define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */
1744 #define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */
1745 #define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */
1746 
1747 /* Flags for the feature selection in DT_FEATURE_1. */
1748 #define DTF_1_PARINIT 0x00000001
1749 #define DTF_1_CONFEXP 0x00000002
1750 
1751 /* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */
1752 #define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */
1753 #define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not
1754  generally available. */
1755 
1756 /* Version definition sections. */
1757 
1758 typedef struct
1759 {
1760  Elf32_Half vd_version; /* Version revision */
1761  Elf32_Half vd_flags; /* Version information */
1762  Elf32_Half vd_ndx; /* Version Index */
1763  Elf32_Half vd_cnt; /* Number of associated aux entries */
1764  Elf32_Word vd_hash; /* Version name hash value */
1765  Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
1766  Elf32_Word vd_next; /* Offset in bytes to next verdef
1767  entry */
1768 } Elf32_Verdef;
1769 
1770 typedef struct
1771 {
1772  Elf64_Half vd_version; /* Version revision */
1773  Elf64_Half vd_flags; /* Version information */
1774  Elf64_Half vd_ndx; /* Version Index */
1775  Elf64_Half vd_cnt; /* Number of associated aux entries */
1776  Elf64_Word vd_hash; /* Version name hash value */
1777  Elf64_Word vd_aux; /* Offset in bytes to verdaux array */
1778  Elf64_Word vd_next; /* Offset in bytes to next verdef
1779  entry */
1780 } Elf64_Verdef;
1781 
1783 /* Legal values for vd_version (version revision). */
1784 #define VER_DEF_NONE 0 /* No version */
1785 #define VER_DEF_CURRENT 1 /* Current version */
1786 #define VER_DEF_NUM 2 /* Given version number */
1787 
1788 /* Legal values for vd_flags (version information flags). */
1789 #define VER_FLG_BASE 0x1 /* Version definition of file itself */
1790 #define VER_FLG_WEAK 0x2 /* Weak version identifier */
1791 
1792 /* Versym symbol index values. */
1793 #define VER_NDX_LOCAL 0 /* Symbol is local. */
1794 #define VER_NDX_GLOBAL 1 /* Symbol is global. */
1795 #define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
1796 #define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
1797 
1798 /* Auxialiary version information. */
1799 
1800 typedef struct
1801 {
1802  Elf32_Word vda_name; /* Version or dependency names */
1803  Elf32_Word vda_next; /* Offset in bytes to next verdaux
1804  entry */
1805 } Elf32_Verdaux;
1806 
1807 typedef struct
1808 {
1809  Elf64_Word vda_name; /* Version or dependency names */
1810  Elf64_Word vda_next; /* Offset in bytes to next verdaux
1811  entry */
1812 } Elf64_Verdaux;
1813 
1814 
1815 /* Version dependency section. */
1816 
1817 typedef struct
1818 {
1819  Elf32_Half vn_version; /* Version of structure */
1820  Elf32_Half vn_cnt; /* Number of associated aux entries */
1821  Elf32_Word vn_file; /* Offset of filename for this
1822  dependency */
1823  Elf32_Word vn_aux; /* Offset in bytes to vernaux array */
1824  Elf32_Word vn_next; /* Offset in bytes to next verneed
1825  entry */
1826 } Elf32_Verneed;
1827 
1828 typedef struct
1829 {
1830  Elf64_Half vn_version; /* Version of structure */
1831  Elf64_Half vn_cnt; /* Number of associated aux entries */
1832  Elf64_Word vn_file; /* Offset of filename for this
1833  dependency */
1834  Elf64_Word vn_aux; /* Offset in bytes to vernaux array */
1835  Elf64_Word vn_next; /* Offset in bytes to next verneed
1836  entry */
1837 } Elf64_Verneed;
1838 
1839 
1840 /* Legal values for vn_version (version revision). */
1841 #define VER_NEED_NONE 0 /* No version */
1842 #define VER_NEED_CURRENT 1 /* Current version */
1843 #define VER_NEED_NUM 2 /* Given version number */
1844 
1845 /* Auxiliary needed version information. */
1846 
1847 typedef struct
1848 {
1849  Elf32_Word vna_hash; /* Hash value of dependency name */
1850  Elf32_Half vna_flags; /* Dependency specific information */
1851  Elf32_Half vna_other; /* Unused */
1852  Elf32_Word vna_name; /* Dependency name string offset */
1853  Elf32_Word vna_next; /* Offset in bytes to next vernaux
1854  entry */
1855 } Elf32_Vernaux;
1856 
1857 typedef struct
1859  Elf64_Word vna_hash; /* Hash value of dependency name */
1860  Elf64_Half vna_flags; /* Dependency specific information */
1861  Elf64_Half vna_other; /* Unused */
1862  Elf64_Word vna_name; /* Dependency name string offset */
1863  Elf64_Word vna_next; /* Offset in bytes to next vernaux
1864  entry */
1865 } Elf64_Vernaux;
1866 
1867 
1868 /* Legal values for vna_flags. */
1869 #define VER_FLG_WEAK 0x2 /* Weak version identifier */
1870 
1871 
1872 /* Auxiliary vector. */
1873 
1874 /* This vector is normally only used by the program interpreter. The
1875  usual definition in an ABI supplement uses the name auxv_t. The
1876  vector is not usually defined in a standard <elf.h> file, but it
1877  can't hurt. We rename it to avoid conflicts. The sizes of these
1878  types are an arrangement between the exec server and the program
1879  interpreter, so we don't fully specify them here. */
1880 
1881 typedef struct
1882 {
1883  int a_type; /* Entry type */
1884  union
1885  {
1886  long int a_val; /* Integer value */
1887  void *a_ptr; /* Pointer value */
1888  void (*a_fcn) (void); /* Function pointer value */
1889  } a_un;
1890 } Elf32_auxv_t;
1891 
1892 typedef struct
1893 {
1894  long int a_type; /* Entry type */
1895  union
1896  {
1897  long int a_val; /* Integer value */
1898  void *a_ptr; /* Pointer value */
1899  void (*a_fcn) (void); /* Function pointer value */
1900  } a_un;
1903 /* Legal values for a_type (entry type). */
1905 #define AT_NULL 0 /* End of vector */
1906 #define AT_IGNORE 1 /* Entry should be ignored */
1907 #define AT_EXECFD 2 /* File descriptor of program */
1908 #define AT_PHDR 3 /* Program headers for program */
1909 #define AT_PHENT 4 /* Size of program header entry */
1910 #define AT_PHNUM 5 /* Number of program headers */
1911 #define AT_PAGESZ 6 /* System page size */
1912 #define AT_BASE 7 /* Base address of interpreter */
1913 #define AT_FLAGS 8 /* Flags */
1914 #define AT_ENTRY 9 /* Entry point of program */
1915 #define AT_NOTELF 10 /* Program is not ELF */
1916 #define AT_UID 11 /* Real uid */
1917 #define AT_EUID 12 /* Effective uid */
1918 #define AT_GID 13 /* Real gid */
1919 #define AT_EGID 14 /* Effective gid */
1920 #define AT_CLKTCK 17 /* Frequency of times() */
1922 /* Some more special a_type values describing the hardware. */
1923 #define AT_PLATFORM 15 /* String identifying platform. */
1924 #define AT_HWCAP 16 /* Machine dependent hints about
1925  processor capabilities. */
1927 /* This entry gives some information about the FPU initialization
1928  performed by the kernel. */
1929 #define AT_FPUCW 18 /* Used FPU control word. */
1930 
1931 /* Cache block sizes. */
1932 #define AT_DCACHEBSIZE 19 /* Data cache block size. */
1933 #define AT_ICACHEBSIZE 20 /* Instruction cache block size. */
1934 #define AT_UCACHEBSIZE 21 /* Unified cache block size. */
1935 
1936 /* A special ignored value for PPC, used by the kernel to control the
1937  interpretation of the AUXV. Must be > 16. */
1938 #define AT_IGNOREPPC 22 /* Entry should be ignored. */
1940 #define AT_SECURE 23 /* Boolean, was exec setuid-like? */
1941 
1942 /* Pointer to the global system page used for system calls and other
1943  nice things. */
1944 #define AT_SYSINFO 32
1945 #define AT_SYSINFO_EHDR 33
1946 
1947 /* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains
1948  log2 of line size; mask those to get cache size. */
1949 #define AT_L1I_CACHESHAPE 34
1950 #define AT_L1D_CACHESHAPE 35
1951 #define AT_L2_CACHESHAPE 36
1952 #define AT_L3_CACHESHAPE 37
1953 
1954 /* Note section contents. Each entry in the note section begins with
1955  a header of a fixed form. */
1956 
1957 typedef struct
1958 {
1959  Elf32_Word n_namesz; /* Length of the note's name. */
1960  Elf32_Word n_descsz; /* Length of the note's descriptor. */
1961  Elf32_Word n_type; /* Type of the note. */
1963 
1964 typedef struct
1966  Elf64_Word n_namesz; /* Length of the note's name. */
1967  Elf64_Word n_descsz; /* Length of the note's descriptor. */
1968  Elf64_Word n_type; /* Type of the note. */
1969 } Elf64_Nhdr;
1970 
1971 /* Known names of notes. */
1972 
1973 /* Solaris entries in the note section have this name. */
1974 #define ELF_NOTE_SOLARIS "SUNW Solaris"
1975 
1976 /* Note entries for GNU systems have this name. */
1977 #define ELF_NOTE_GNU "GNU"
1978 
1979 
1980 /* Defined types of notes for Solaris. */
1981 
1982 /* Value of descriptor (one word) is desired pagesize for the binary. */
1983 #define ELF_NOTE_PAGESIZE_HINT 1
1984 
1985 
1986 /* Defined note types for GNU systems. */
1988 /* ABI information. The descriptor consists of words:
1989  word 0: OS descriptor
1990  word 1: major version of the ABI
1991  word 2: minor version of the ABI
1992  word 3: subminor version of the ABI
1993 */
1994 #define ELF_NOTE_ABI 1
1995 
1996 /* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI
1997  note section entry. */
1998 #define ELF_NOTE_OS_LINUX 0
1999 #define ELF_NOTE_OS_GNU 1
2000 #define ELF_NOTE_OS_SOLARIS2 2
2001 #define ELF_NOTE_OS_FREEBSD 3
2002 
2003 
2004 /* Move records. */
2005 typedef struct
2006 {
2007  Elf32_Xword m_value; /* Symbol value. */
2008  Elf32_Word m_info; /* Size and index. */
2009  Elf32_Word m_poffset; /* Symbol offset. */
2010  Elf32_Half m_repeat; /* Repeat count. */
2011  Elf32_Half m_stride; /* Stride info. */
2014 typedef struct
2015 {
2016  Elf64_Xword m_value; /* Symbol value. */
2017  Elf64_Xword m_info; /* Size and index. */
2018  Elf64_Xword m_poffset; /* Symbol offset. */
2019  Elf64_Half m_repeat; /* Repeat count. */
2020  Elf64_Half m_stride; /* Stride info. */
2021 } Elf64_Move;
2022 
2023 /* Macro to construct move records. */
2024 #define ELF32_M_SYM(info) ((info) >> 8)
2025 #define ELF32_M_SIZE(info) ((unsigned char) (info))
2026 #define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
2027 
2028 #define ELF64_M_SYM(info) ELF32_M_SYM (info)
2029 #define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
2030 #define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
2033 /* Motorola 68k specific definitions. */
2035 /* Values for Elf32_Ehdr.e_flags. */
2036 #define EF_CPU32 0x00810000
2038 /* m68k relocs. */
2040 #define R_68K_NONE 0 /* No reloc */
2041 #define R_68K_32 1 /* Direct 32 bit */
2042 #define R_68K_16 2 /* Direct 16 bit */
2043 #define R_68K_8 3 /* Direct 8 bit */
2044 #define R_68K_PC32 4 /* PC relative 32 bit */
2045 #define R_68K_PC16 5 /* PC relative 16 bit */
2046 #define R_68K_PC8 6 /* PC relative 8 bit */
2047 #define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */
2048 #define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */
2049 #define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */
2050 #define R_68K_GOT32O 10 /* 32 bit GOT offset */
2051 #define R_68K_GOT16O 11 /* 16 bit GOT offset */
2052 #define R_68K_GOT8O 12 /* 8 bit GOT offset */
2053 #define R_68K_PLT32 13 /* 32 bit PC relative PLT address */
2054 #define R_68K_PLT16 14 /* 16 bit PC relative PLT address */
2055 #define R_68K_PLT8 15 /* 8 bit PC relative PLT address */
2056 #define R_68K_PLT32O 16 /* 32 bit PLT offset */
2057 #define R_68K_PLT16O 17 /* 16 bit PLT offset */
2058 #define R_68K_PLT8O 18 /* 8 bit PLT offset */
2059 #define R_68K_COPY 19 /* Copy symbol at runtime */
2060 #define R_68K_GLOB_DAT 20 /* Create GOT entry */
2061 #define R_68K_JMP_SLOT 21 /* Create PLT entry */
2062 #define R_68K_RELATIVE 22 /* Adjust by program base */
2063 /* Keep this the last entry. */
2064 #define R_68K_NUM 23
2066 /* Intel 80386 specific definitions. */
2068 /* i386 relocs. */
2070 #define R_386_NONE 0 /* No reloc */
2071 #define R_386_32 1 /* Direct 32 bit */
2072 #define R_386_PC32 2 /* PC relative 32 bit */
2073 #define R_386_GOT32 3 /* 32 bit GOT entry */
2074 #define R_386_PLT32 4 /* 32 bit PLT address */
2075 #define R_386_COPY 5 /* Copy symbol at runtime */
2076 #define R_386_GLOB_DAT 6 /* Create GOT entry */
2077 #define R_386_JMP_SLOT 7 /* Create PLT entry */
2078 #define R_386_RELATIVE 8 /* Adjust by program base */
2079 #define R_386_GOTOFF 9 /* 32 bit offset to GOT */
2080 #define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */
2081 #define R_386_32PLT 11
2082 #define R_386_TLS_TPOFF 14 /* Offset in static TLS block */
2083 #define R_386_TLS_IE 15 /* Address of GOT entry for static TLS
2084  block offset */
2085 #define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block
2086  offset */
2087 #define R_386_TLS_LE 17 /* Offset relative to static TLS
2088  block */
2089 #define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of
2090  general dynamic thread local data */
2091 #define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of
2092  local dynamic thread local data
2093  in LE code */
2094 #define R_386_16 20
2095 #define R_386_PC16 21
2096 #define R_386_8 22
2097 #define R_386_PC8 23
2098 #define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic
2099  thread local data */
2100 #define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */
2101 #define R_386_TLS_GD_CALL 26 /* Relocation for call to
2102  __tls_get_addr() */
2103 #define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */
2104 #define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic
2105  thread local data in LE code */
2106 #define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */
2107 #define R_386_TLS_LDM_CALL 30 /* Relocation for call to
2108  __tls_get_addr() in LDM code */
2109 #define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */
2110 #define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */
2111 #define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS
2112  block offset */
2113 #define R_386_TLS_LE_32 34 /* Negated offset relative to static
2114  TLS block */
2115 #define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */
2116 #define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */
2117 #define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */
2118 /* Keep this the last entry. */
2119 #define R_386_NUM 38
2121 /* SUN SPARC specific definitions. */
2123 /* Legal values for ST_TYPE subfield of st_info (symbol type). */
2125 #define STT_SPARC_REGISTER 13 /* Global register reserved to app. */
2127 /* Values for Elf64_Ehdr.e_flags. */
2129 #define EF_SPARCV9_MM 3
2130 #define EF_SPARCV9_TSO 0
2131 #define EF_SPARCV9_PSO 1
2132 #define EF_SPARCV9_RMO 2
2133 #define EF_SPARC_LEDATA 0x800000 /* little endian data */
2134 #define EF_SPARC_EXT_MASK 0xFFFF00
2135 #define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */
2136 #define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */
2137 #define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */
2138 #define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */
2140 /* SPARC relocs. */
2142 #define R_SPARC_NONE 0 /* No reloc */
2143 #define R_SPARC_8 1 /* Direct 8 bit */
2144 #define R_SPARC_16 2 /* Direct 16 bit */
2145 #define R_SPARC_32 3 /* Direct 32 bit */
2146 #define R_SPARC_DISP8 4 /* PC relative 8 bit */
2147 #define R_SPARC_DISP16 5 /* PC relative 16 bit */
2148 #define R_SPARC_DISP32 6 /* PC relative 32 bit */
2149 #define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */
2150 #define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */
2151 #define R_SPARC_HI22 9 /* High 22 bit */
2152 #define R_SPARC_22 10 /* Direct 22 bit */
2153 #define R_SPARC_13 11 /* Direct 13 bit */
2154 #define R_SPARC_LO10 12 /* Truncated 10 bit */
2155 #define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */
2156 #define R_SPARC_GOT13 14 /* 13 bit GOT entry */
2157 #define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */
2158 #define R_SPARC_PC10 16 /* PC relative 10 bit truncated */
2159 #define R_SPARC_PC22 17 /* PC relative 22 bit shifted */
2160 #define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */
2161 #define R_SPARC_COPY 19 /* Copy symbol at runtime */
2162 #define R_SPARC_GLOB_DAT 20 /* Create GOT entry */
2163 #define R_SPARC_JMP_SLOT 21 /* Create PLT entry */
2164 #define R_SPARC_RELATIVE 22 /* Adjust by program base */
2165 #define R_SPARC_UA32 23 /* Direct 32 bit unaligned */
2167 /* Additional Sparc64 relocs. */
2169 #define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */
2170 #define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */
2171 #define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */
2172 #define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */
2173 #define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */
2174 #define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */
2175 #define R_SPARC_10 30 /* Direct 10 bit */
2176 #define R_SPARC_11 31 /* Direct 11 bit */
2177 #define R_SPARC_64 32 /* Direct 64 bit */
2178 #define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */
2179 #define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */
2180 #define R_SPARC_HM10 35 /* High middle 10 bits of ... */
2181 #define R_SPARC_LM22 36 /* Low middle 22 bits of ... */
2182 #define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */
2183 #define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */
2184 #define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */
2185 #define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */
2186 #define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */
2187 #define R_SPARC_7 43 /* Direct 7 bit */
2188 #define R_SPARC_5 44 /* Direct 5 bit */
2189 #define R_SPARC_6 45 /* Direct 6 bit */
2190 #define R_SPARC_DISP64 46 /* PC relative 64 bit */
2191 #define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */
2192 #define R_SPARC_HIX22 48 /* High 22 bit complemented */
2193 #define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */
2194 #define R_SPARC_H44 50 /* Direct high 12 of 44 bit */
2195 #define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */
2196 #define R_SPARC_L44 52 /* Direct low 10 of 44 bit */
2197 #define R_SPARC_REGISTER 53 /* Global register usage */
2198 #define R_SPARC_UA64 54 /* Direct 64 bit unaligned */
2199 #define R_SPARC_UA16 55 /* Direct 16 bit unaligned */
2200 #define R_SPARC_TLS_GD_HI22 56
2201 #define R_SPARC_TLS_GD_LO10 57
2202 #define R_SPARC_TLS_GD_ADD 58
2203 #define R_SPARC_TLS_GD_CALL 59
2204 #define R_SPARC_TLS_LDM_HI22 60
2205 #define R_SPARC_TLS_LDM_LO10 61
2206 #define R_SPARC_TLS_LDM_ADD 62
2207 #define R_SPARC_TLS_LDM_CALL 63
2208 #define R_SPARC_TLS_LDO_HIX22 64
2209 #define R_SPARC_TLS_LDO_LOX10 65
2210 #define R_SPARC_TLS_LDO_ADD 66
2211 #define R_SPARC_TLS_IE_HI22 67
2212 #define R_SPARC_TLS_IE_LO10 68
2213 #define R_SPARC_TLS_IE_LD 69
2214 #define R_SPARC_TLS_IE_LDX 70
2215 #define R_SPARC_TLS_IE_ADD 71
2216 #define R_SPARC_TLS_LE_HIX22 72
2217 #define R_SPARC_TLS_LE_LOX10 73
2218 #define R_SPARC_TLS_DTPMOD32 74
2219 #define R_SPARC_TLS_DTPMOD64 75
2220 #define R_SPARC_TLS_DTPOFF32 76
2221 #define R_SPARC_TLS_DTPOFF64 77
2222 #define R_SPARC_TLS_TPOFF32 78
2223 #define R_SPARC_TLS_TPOFF64 79
2224 /* Keep this the last entry. */
2225 #define R_SPARC_NUM 80
2227 /* For Sparc64, legal values for d_tag of Elf64_Dyn. */
2229 #define DT_SPARC_REGISTER 0x70000001
2230 #define DT_SPARC_NUM 2
2231 
2232 /* Bits present in AT_HWCAP, primarily for Sparc32. */
2234 #define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */
2235 #define HWCAP_SPARC_STBAR 2
2236 #define HWCAP_SPARC_SWAP 4
2237 #define HWCAP_SPARC_MULDIV 8
2238 #define HWCAP_SPARC_V9 16 /* The cpu is v9, so v8plus is ok. */
2239 #define HWCAP_SPARC_ULTRA3 32
2240 
2241 /* MIPS R3000 specific definitions. */
2243 /* Legal values for e_flags field of Elf32_Ehdr. */
2245 #define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */
2246 #define EF_MIPS_PIC 2 /* Contains PIC code */
2247 #define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */
2248 #define EF_MIPS_XGOT 8
2249 #define EF_MIPS_64BIT_WHIRL 16
2250 #define EF_MIPS_ABI2 32
2251 #define EF_MIPS_ABI_ON32 64
2252 #define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */
2254 /* Legal values for MIPS architecture level. */
2256 #define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
2257 #define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
2258 #define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
2259 #define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
2260 #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
2261 #define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
2262 #define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
2264 /* The following are non-official names and should not be used. */
2266 #define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
2267 #define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
2268 #define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
2269 #define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
2270 #define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
2271 #define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
2272 #define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
2274 /* Special section indices. */
2276 #define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */
2277 #define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
2278 #define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
2279 #define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
2280 #define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
2282 /* Legal values for sh_type field of Elf32_Shdr. */
2284 #define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */
2285 #define SHT_MIPS_MSYM 0x70000001
2286 #define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */
2287 #define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */
2288 #define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */
2289 #define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/
2290 #define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */
2291 #define SHT_MIPS_PACKAGE 0x70000007
2292 #define SHT_MIPS_PACKSYM 0x70000008
2293 #define SHT_MIPS_RELD 0x70000009
2294 #define SHT_MIPS_IFACE 0x7000000b
2295 #define SHT_MIPS_CONTENT 0x7000000c
2296 #define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */
2297 #define SHT_MIPS_SHDR 0x70000010
2298 #define SHT_MIPS_FDESC 0x70000011
2299 #define SHT_MIPS_EXTSYM 0x70000012
2300 #define SHT_MIPS_DENSE 0x70000013
2301 #define SHT_MIPS_PDESC 0x70000014
2302 #define SHT_MIPS_LOCSYM 0x70000015
2303 #define SHT_MIPS_AUXSYM 0x70000016
2304 #define SHT_MIPS_OPTSYM 0x70000017
2305 #define SHT_MIPS_LOCSTR 0x70000018
2306 #define SHT_MIPS_LINE 0x70000019
2307 #define SHT_MIPS_RFDESC 0x7000001a
2308 #define SHT_MIPS_DELTASYM 0x7000001b
2309 #define SHT_MIPS_DELTAINST 0x7000001c
2310 #define SHT_MIPS_DELTACLASS 0x7000001d
2311 #define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */
2312 #define SHT_MIPS_DELTADECL 0x7000001f
2313 #define SHT_MIPS_SYMBOL_LIB 0x70000020
2314 #define SHT_MIPS_EVENTS 0x70000021 /* Event section. */
2315 #define SHT_MIPS_TRANSLATE 0x70000022
2316 #define SHT_MIPS_PIXIE 0x70000023
2317 #define SHT_MIPS_XLATE 0x70000024
2318 #define SHT_MIPS_XLATE_DEBUG 0x70000025
2319 #define SHT_MIPS_WHIRL 0x70000026
2320 #define SHT_MIPS_EH_REGION 0x70000027
2321 #define SHT_MIPS_XLATE_OLD 0x70000028
2322 #define SHT_MIPS_PDR_EXCEPTION 0x70000029
2323 
2324 /* Legal values for sh_flags field of Elf32_Shdr. */
2325 
2326 #define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */
2327 #define SHF_MIPS_MERGE 0x20000000
2328 #define SHF_MIPS_ADDR 0x40000000
2329 #define SHF_MIPS_STRINGS 0x80000000
2330 #define SHF_MIPS_NOSTRIP 0x08000000
2331 #define SHF_MIPS_LOCAL 0x04000000
2332 #define SHF_MIPS_NAMES 0x02000000
2333 #define SHF_MIPS_NODUPE 0x01000000
2334 
2335 
2336 /* Symbol tables. */
2338 /* MIPS specific values for `st_other'. */
2339 #define STO_MIPS_DEFAULT 0x0
2340 #define STO_MIPS_INTERNAL 0x1
2341 #define STO_MIPS_HIDDEN 0x2
2342 #define STO_MIPS_PROTECTED 0x3
2343 #define STO_MIPS_SC_ALIGN_UNUSED 0xff
2344 
2345 /* MIPS specific values for `st_info'. */
2346 #define STB_MIPS_SPLIT_COMMON 13
2347 
2348 /* Entries found in sections of type SHT_MIPS_GPTAB. */
2349 
2350 typedef union
2351 {
2352  struct
2353  {
2354  Elf32_Word gt_current_g_value; /* -G value used for compilation */
2355  Elf32_Word gt_unused; /* Not used */
2356  } gt_header; /* First entry in section */
2357  struct
2358  {
2359  Elf32_Word gt_g_value; /* If this value were used for -G */
2360  Elf32_Word gt_bytes; /* This many bytes would be used */
2361  } gt_entry; /* Subsequent entries in section */
2362 } Elf32_gptab;
2364 /* Entry found in sections of type SHT_MIPS_REGINFO. */
2366 typedef struct
2368  Elf32_Word ri_gprmask; /* General registers used */
2369  Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */
2370  Elf32_Sword ri_gp_value; /* $gp register value */
2372 
2373 /* Entries found in sections of type SHT_MIPS_OPTIONS. */
2374 
2375 typedef struct
2377  unsigned char kind; /* Determines interpretation of the
2378  variable part of descriptor. */
2379  unsigned char size; /* Size of descriptor, including header. */
2380  Elf32_Section section; /* Section header index of section affected,
2381  0 for global options. */
2382  Elf32_Word info; /* Kind-specific information. */
2385 /* Values for `kind' field in Elf_Options. */
2387 #define ODK_NULL 0 /* Undefined. */
2388 #define ODK_REGINFO 1 /* Register usage information. */
2389 #define ODK_EXCEPTIONS 2 /* Exception processing options. */
2390 #define ODK_PAD 3 /* Section padding options. */
2391 #define ODK_HWPATCH 4 /* Hardware workarounds performed */
2392 #define ODK_FILL 5 /* record the fill value used by the linker. */
2393 #define ODK_TAGS 6 /* reserve space for desktop tools to write. */
2394 #define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */
2395 #define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */
2397 /* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */
2399 #define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */
2400 #define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */
2401 #define OEX_PAGE0 0x10000 /* page zero must be mapped. */
2402 #define OEX_SMM 0x20000 /* Force sequential memory mode? */
2403 #define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */
2404 #define OEX_PRECISEFP OEX_FPDBUG
2405 #define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */
2406 
2407 #define OEX_FPU_INVAL 0x10
2408 #define OEX_FPU_DIV0 0x08
2409 #define OEX_FPU_OFLO 0x04
2410 #define OEX_FPU_UFLO 0x02
2411 #define OEX_FPU_INEX 0x01
2412 
2413 /* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */
2414 
2415 #define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */
2416 #define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */
2417 #define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */
2418 #define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */
2420 #define OPAD_PREFIX 0x1
2421 #define OPAD_POSTFIX 0x2
2422 #define OPAD_SYMBOL 0x4
2424 /* Entry found in `.options' section. */
2426 typedef struct
2428  Elf32_Word hwp_flags1; /* Extra flags. */
2429  Elf32_Word hwp_flags2; /* Extra flags. */
2432 /* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */
2434 #define OHWA0_R4KEOP_CHECKED 0x00000001
2435 #define OHWA1_R4KEOP_CLEAN 0x00000002
2437 /* MIPS relocs. */
2439 #define R_MIPS_NONE 0 /* No reloc */
2440 #define R_MIPS_16 1 /* Direct 16 bit */
2441 #define R_MIPS_32 2 /* Direct 32 bit */
2442 #define R_MIPS_REL32 3 /* PC relative 32 bit */
2443 #define R_MIPS_26 4 /* Direct 26 bit shifted */
2444 #define R_MIPS_HI16 5 /* High 16 bit */
2445 #define R_MIPS_LO16 6 /* Low 16 bit */
2446 #define R_MIPS_GPREL16 7 /* GP relative 16 bit */
2447 #define R_MIPS_LITERAL 8 /* 16 bit literal entry */
2448 #define R_MIPS_GOT16 9 /* 16 bit GOT entry */
2449 #define R_MIPS_PC16 10 /* PC relative 16 bit */
2450 #define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */
2451 #define R_MIPS_GPREL32 12 /* GP relative 32 bit */
2453 #define R_MIPS_SHIFT5 16
2454 #define R_MIPS_SHIFT6 17
2455 #define R_MIPS_64 18
2456 #define R_MIPS_GOT_DISP 19
2457 #define R_MIPS_GOT_PAGE 20
2458 #define R_MIPS_GOT_OFST 21
2459 #define R_MIPS_GOT_HI16 22
2460 #define R_MIPS_GOT_LO16 23
2461 #define R_MIPS_SUB 24
2462 #define R_MIPS_INSERT_A 25
2463 #define R_MIPS_INSERT_B 26
2464 #define R_MIPS_DELETE 27
2465 #define R_MIPS_HIGHER 28
2466 #define R_MIPS_HIGHEST 29
2467 #define R_MIPS_CALL_HI16 30
2468 #define R_MIPS_CALL_LO16 31
2469 #define R_MIPS_SCN_DISP 32
2470 #define R_MIPS_REL16 33
2471 #define R_MIPS_ADD_IMMEDIATE 34
2472 #define R_MIPS_PJUMP 35
2473 #define R_MIPS_RELGOT 36
2474 #define R_MIPS_JALR 37
2475 /* Keep this the last entry. */
2476 #define R_MIPS_NUM 38
2478 /* Legal values for p_type field of Elf32_Phdr. */
2480 #define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
2481 #define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */
2482 #define PT_MIPS_OPTIONS 0x70000002
2484 /* Special program header types. */
2486 #define PF_MIPS_LOCAL 0x10000000
2488 /* Legal values for d_tag field of Elf32_Dyn. */
2490 #define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */
2491 #define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */
2492 #define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */
2493 #define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */
2494 #define DT_MIPS_FLAGS 0x70000005 /* Flags */
2495 #define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */
2496 #define DT_MIPS_MSYM 0x70000007
2497 #define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */
2498 #define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */
2499 #define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */
2500 #define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */
2501 #define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */
2502 #define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */
2503 #define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */
2504 #define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */
2505 #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */
2506 #define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */
2507 #define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */
2508 #define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in
2509  DT_MIPS_DELTA_CLASS. */
2510 #define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */
2511 #define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in
2512  DT_MIPS_DELTA_INSTANCE. */
2513 #define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */
2514 #define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in
2515  DT_MIPS_DELTA_RELOC. */
2516 #define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta
2517  relocations refer to. */
2518 #define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in
2519  DT_MIPS_DELTA_SYM. */
2520 #define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the
2521  class declaration. */
2522 #define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in
2523  DT_MIPS_DELTA_CLASSSYM. */
2524 #define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */
2525 #define DT_MIPS_PIXIE_INIT 0x70000023
2526 #define DT_MIPS_SYMBOL_LIB 0x70000024
2527 #define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
2528 #define DT_MIPS_LOCAL_GOTIDX 0x70000026
2529 #define DT_MIPS_HIDDEN_GOTIDX 0x70000027
2530 #define DT_MIPS_PROTECTED_GOTIDX 0x70000028
2531 #define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */
2532 #define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */
2533 #define DT_MIPS_DYNSTR_ALIGN 0x7000002b
2534 #define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */
2535 #define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve
2536  function stored in GOT. */
2537 #define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added
2538  by rld on dlopen() calls. */
2539 #define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
2540 #define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */
2541 #define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */
2542 #define DT_MIPS_NUM 0x32
2543 
2544 /* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
2545 
2546 #define RHF_NONE 0 /* No flags */
2547 #define RHF_QUICKSTART (1 << 0) /* Use quickstart */
2548 #define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */
2549 #define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */
2550 #define RHF_NO_MOVE (1 << 3)
2551 #define RHF_SGI_ONLY (1 << 4)
2552 #define RHF_GUARANTEE_INIT (1 << 5)
2553 #define RHF_DELTA_C_PLUS_PLUS (1 << 6)
2554 #define RHF_GUARANTEE_START_INIT (1 << 7)
2555 #define RHF_PIXIE (1 << 8)
2556 #define RHF_DEFAULT_DELAY_LOAD (1 << 9)
2557 #define RHF_REQUICKSTART (1 << 10)
2558 #define RHF_REQUICKSTARTED (1 << 11)
2559 #define RHF_CORD (1 << 12)
2560 #define RHF_NO_UNRES_UNDEF (1 << 13)
2561 #define RHF_RLD_ORDER_SAFE (1 << 14)
2562 
2563 /* Entries found in sections of type SHT_MIPS_LIBLIST. */
2564 
2565 typedef struct
2566 {
2567  Elf32_Word l_name; /* Name (string table index) */
2568  Elf32_Word l_time_stamp; /* Timestamp */
2569  Elf32_Word l_checksum; /* Checksum */
2570  Elf32_Word l_version; /* Interface version */
2571  Elf32_Word l_flags; /* Flags */
2574 typedef struct
2576  Elf64_Word l_name; /* Name (string table index) */
2577  Elf64_Word l_time_stamp; /* Timestamp */
2578  Elf64_Word l_checksum; /* Checksum */
2579  Elf64_Word l_version; /* Interface version */
2580  Elf64_Word l_flags; /* Flags */
2583 
2584 /* Legal values for l_flags. */
2585 
2586 #define LL_NONE 0
2587 #define LL_EXACT_MATCH (1 << 0) /* Require exact match */
2588 #define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */
2589 #define LL_REQUIRE_MINOR (1 << 2)
2590 #define LL_EXPORTS (1 << 3)
2591 #define LL_DELAY_LOAD (1 << 4)
2592 #define LL_DELTA (1 << 5)
2594 /* Entries found in sections of type SHT_MIPS_CONFLICT. */
2595 
2596 typedef Elf32_Addr Elf32_Conflict;
2599 /* HPPA specific definitions. */
2600 
2601 /* Legal values for e_flags field of Elf32_Ehdr. */
2602 
2603 #define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */
2604 #define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */
2605 #define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */
2606 #define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */
2607 #define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch
2608  prediction. */
2609 #define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */
2610 #define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */
2612 /* Defined values for `e_flags & EF_PARISC_ARCH' are: */
2614 #define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */
2615 #define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
2616 #define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
2618 /* Additional section indeces. */
2620 #define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
2621  symbols in ANSI C. */
2622 #define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
2624 /* Legal values for sh_type field of Elf32_Shdr. */
2626 #define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */
2627 #define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */
2628 #define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */
2630 /* Legal values for sh_flags field of Elf32_Shdr. */
2632 #define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */
2633 #define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */
2634 #define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */
2636 /* Legal values for ST_TYPE subfield of st_info (symbol type). */
2638 #define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */
2640 #define STT_HP_OPAQUE (STT_LOOS + 0x1)
2641 #define STT_HP_STUB (STT_LOOS + 0x2)
2643 /* HPPA relocs. */
2645 #define R_PARISC_NONE 0 /* No reloc. */
2646 #define R_PARISC_DIR32 1 /* Direct 32-bit reference. */
2647 #define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */
2648 #define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */
2649 #define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */
2650 #define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */
2651 #define R_PARISC_PCREL32 9 /* 32-bit rel. address. */
2652 #define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */
2653 #define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */
2654 #define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
2655 #define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
2656 #define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
2657 #define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
2658 #define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
2659 #define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
2660 #define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
2661 #define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
2662 #define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
2663 #define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
2664 #define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
2665 #define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
2666 #define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
2667 #define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
2668 #define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
2669 #define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
2670 #define R_PARISC_FPTR64 64 /* 64 bits function address. */
2671 #define R_PARISC_PLABEL32 65 /* 32 bits function address. */
2672 #define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
2673 #define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
2674 #define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
2675 #define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
2676 #define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */
2677 #define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */
2678 #define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */
2679 #define R_PARISC_DIR64 80 /* 64 bits of eff. address. */
2680 #define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */
2681 #define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */
2682 #define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */
2683 #define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */
2684 #define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */
2685 #define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */
2686 #define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */
2687 #define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */
2688 #define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */
2689 #define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */
2690 #define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */
2691 #define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */
2692 #define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */
2693 #define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */
2694 #define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */
2695 #define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
2696 #define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
2697 #define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
2698 #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
2699 #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
2700 #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
2701 #define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */
2702 #define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */
2703 #define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */
2704 #define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */
2705 #define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */
2706 #define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */
2707 #define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */
2708 #define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */
2709 #define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */
2710 #define R_PARISC_LORESERVE 128
2711 #define R_PARISC_COPY 128 /* Copy relocation. */
2712 #define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */
2713 #define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */
2714 #define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */
2715 #define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */
2716 #define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */
2717 #define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */
2718 #define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/
2719 #define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */
2720 #define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */
2721 #define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */
2722 #define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */
2723 #define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */
2724 #define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */
2725 #define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */
2726 #define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */
2727 #define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/
2728 #define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/
2729 #define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */
2730 #define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */
2731 #define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */
2732 #define R_PARISC_HIRESERVE 255
2733 
2734 /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
2735 
2736 #define PT_HP_TLS (PT_LOOS + 0x0)
2737 #define PT_HP_CORE_NONE (PT_LOOS + 0x1)
2738 #define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
2739 #define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
2740 #define PT_HP_CORE_COMM (PT_LOOS + 0x4)
2741 #define PT_HP_CORE_PROC (PT_LOOS + 0x5)
2742 #define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
2743 #define PT_HP_CORE_STACK (PT_LOOS + 0x7)
2744 #define PT_HP_CORE_SHM (PT_LOOS + 0x8)
2745 #define PT_HP_CORE_MMF (PT_LOOS + 0x9)
2746 #define PT_HP_PARALLEL (PT_LOOS + 0x10)
2747 #define PT_HP_FASTBIND (PT_LOOS + 0x11)
2748 #define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
2749 #define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
2750 #define PT_HP_STACK (PT_LOOS + 0x14)
2752 #define PT_PARISC_ARCHEXT 0x70000000
2753 #define PT_PARISC_UNWIND 0x70000001
2754 
2755 /* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */
2757 #define PF_PARISC_SBP 0x08000000
2759 #define PF_HP_PAGE_SIZE 0x00100000
2760 #define PF_HP_FAR_SHARED 0x00200000
2761 #define PF_HP_NEAR_SHARED 0x00400000
2762 #define PF_HP_CODE 0x01000000
2763 #define PF_HP_MODIFY 0x02000000
2764 #define PF_HP_LAZYSWAP 0x04000000
2765 #define PF_HP_SBP 0x08000000
2768 /* Alpha specific definitions. */
2770 /* Legal values for e_flags field of Elf64_Ehdr. */
2772 #define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */
2773 #define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */
2775 /* Legal values for sh_type field of Elf64_Shdr. */
2777 /* These two are primerily concerned with ECOFF debugging info. */
2778 #define SHT_ALPHA_DEBUG 0x70000001
2779 #define SHT_ALPHA_REGINFO 0x70000002
2781 /* Legal values for sh_flags field of Elf64_Shdr. */
2783 #define SHF_ALPHA_GPREL 0x10000000
2785 /* Legal values for st_other field of Elf64_Sym. */
2786 #define STO_ALPHA_NOPV 0x80 /* No PV required. */
2787 #define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */
2789 /* Alpha relocs. */
2791 #define R_ALPHA_NONE 0 /* No reloc */
2792 #define R_ALPHA_REFLONG 1 /* Direct 32 bit */
2793 #define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
2794 #define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
2795 #define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
2796 #define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
2797 #define R_ALPHA_GPDISP 6 /* Add displacement to GP */
2798 #define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
2799 #define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
2800 #define R_ALPHA_SREL16 9 /* PC relative 16 bit */
2801 #define R_ALPHA_SREL32 10 /* PC relative 32 bit */
2802 #define R_ALPHA_SREL64 11 /* PC relative 64 bit */
2803 #define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */
2804 #define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */
2805 #define R_ALPHA_GPREL16 19 /* GP relative 16 bit */
2806 #define R_ALPHA_COPY 24 /* Copy symbol at runtime */
2807 #define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
2808 #define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
2809 #define R_ALPHA_RELATIVE 27 /* Adjust by program base */
2810 #define R_ALPHA_TLS_GD_HI 28
2811 #define R_ALPHA_TLSGD 29
2812 #define R_ALPHA_TLS_LDM 30
2813 #define R_ALPHA_DTPMOD64 31
2814 #define R_ALPHA_GOTDTPREL 32
2815 #define R_ALPHA_DTPREL64 33
2816 #define R_ALPHA_DTPRELHI 34
2817 #define R_ALPHA_DTPRELLO 35
2818 #define R_ALPHA_DTPREL16 36
2819 #define R_ALPHA_GOTTPREL 37
2820 #define R_ALPHA_TPREL64 38
2821 #define R_ALPHA_TPRELHI 39
2822 #define R_ALPHA_TPRELLO 40
2823 #define R_ALPHA_TPREL16 41
2824 /* Keep this the last entry. */
2825 #define R_ALPHA_NUM 46
2827 /* Magic values of the LITUSE relocation addend. */
2828 #define LITUSE_ALPHA_ADDR 0
2829 #define LITUSE_ALPHA_BASE 1
2830 #define LITUSE_ALPHA_BYTOFF 2
2831 #define LITUSE_ALPHA_JSR 3
2832 #define LITUSE_ALPHA_TLS_GD 4
2833 #define LITUSE_ALPHA_TLS_LDM 5
2836 /* PowerPC specific declarations */
2838 /* Values for Elf32/64_Ehdr.e_flags. */
2839 #define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
2841 /* Cygnus local bits below */
2842 #define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
2843 #define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
2844  flag */
2846 /* PowerPC relocations defined by the ABIs */
2847 #define R_PPC_NONE 0
2848 #define R_PPC_ADDR32 1 /* 32bit absolute address */
2849 #define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
2850 #define R_PPC_ADDR16 3 /* 16bit absolute address */
2851 #define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
2852 #define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
2853 #define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
2854 #define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
2855 #define R_PPC_ADDR14_BRTAKEN 8
2856 #define R_PPC_ADDR14_BRNTAKEN 9
2857 #define R_PPC_REL24 10 /* PC relative 26 bit */
2858 #define R_PPC_REL14 11 /* PC relative 16 bit */
2859 #define R_PPC_REL14_BRTAKEN 12
2860 #define R_PPC_REL14_BRNTAKEN 13
2861 #define R_PPC_GOT16 14
2862 #define R_PPC_GOT16_LO 15
2863 #define R_PPC_GOT16_HI 16
2864 #define R_PPC_GOT16_HA 17
2865 #define R_PPC_PLTREL24 18
2866 #define R_PPC_COPY 19
2867 #define R_PPC_GLOB_DAT 20
2868 #define R_PPC_JMP_SLOT 21
2869 #define R_PPC_RELATIVE 22
2870 #define R_PPC_LOCAL24PC 23
2871 #define R_PPC_UADDR32 24
2872 #define R_PPC_UADDR16 25
2873 #define R_PPC_REL32 26
2874 #define R_PPC_PLT32 27
2875 #define R_PPC_PLTREL32 28
2876 #define R_PPC_PLT16_LO 29
2877 #define R_PPC_PLT16_HI 30
2878 #define R_PPC_PLT16_HA 31
2879 #define R_PPC_SDAREL16 32
2880 #define R_PPC_SECTOFF 33
2881 #define R_PPC_SECTOFF_LO 34
2882 #define R_PPC_SECTOFF_HI 35
2883 #define R_PPC_SECTOFF_HA 36
2885 /* PowerPC relocations defined for the TLS access ABI. */
2886 #define R_PPC_TLS 67 /* none (sym+add)@tls */
2887 #define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */
2888 #define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */
2889 #define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
2890 #define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
2891 #define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
2892 #define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */
2893 #define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */
2894 #define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
2895 #define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
2896 #define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
2897 #define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */
2898 #define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
2899 #define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
2900 #define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
2901 #define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
2902 #define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
2903 #define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
2904 #define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
2905 #define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
2906 #define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */
2907 #define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */
2908 #define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
2909 #define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
2910 #define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */
2911 #define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */
2912 #define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */
2913 #define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */
2914 
2915 /* Keep this the last entry. */
2916 #define R_PPC_NUM 95
2918 /* The remaining relocs are from the Embedded ELF ABI, and are not
2919  in the SVR4 ELF ABI. */
2920 #define R_PPC_EMB_NADDR32 101
2921 #define R_PPC_EMB_NADDR16 102
2922 #define R_PPC_EMB_NADDR16_LO 103
2923 #define R_PPC_EMB_NADDR16_HI 104
2924 #define R_PPC_EMB_NADDR16_HA 105
2925 #define R_PPC_EMB_SDAI16 106
2926 #define R_PPC_EMB_SDA2I16 107
2927 #define R_PPC_EMB_SDA2REL 108
2928 #define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
2929 #define R_PPC_EMB_MRKREF 110
2930 #define R_PPC_EMB_RELSEC16 111
2931 #define R_PPC_EMB_RELST_LO 112
2932 #define R_PPC_EMB_RELST_HI 113
2933 #define R_PPC_EMB_RELST_HA 114
2934 #define R_PPC_EMB_BIT_FLD 115
2935 #define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
2937 /* Diab tool relocations. */
2938 #define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
2939 #define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
2940 #define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
2941 #define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
2942 #define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
2943 #define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
2945 /* This is a phony reloc to handle any old fashioned TOC16 references
2946  that may still be in object files. */
2947 #define R_PPC_TOC16 255
2950 /* PowerPC64 relocations defined by the ABIs */
2951 #define R_PPC64_NONE R_PPC_NONE
2952 #define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */
2953 #define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */
2954 #define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */
2955 #define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */
2956 #define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */
2957 #define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */
2958 #define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */
2959 #define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
2960 #define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
2961 #define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */
2962 #define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */
2963 #define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
2964 #define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
2965 #define R_PPC64_GOT16 R_PPC_GOT16
2966 #define R_PPC64_GOT16_LO R_PPC_GOT16_LO
2967 #define R_PPC64_GOT16_HI R_PPC_GOT16_HI
2968 #define R_PPC64_GOT16_HA R_PPC_GOT16_HA
2970 #define R_PPC64_COPY R_PPC_COPY
2971 #define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
2972 #define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
2973 #define R_PPC64_RELATIVE R_PPC_RELATIVE
2975 #define R_PPC64_UADDR32 R_PPC_UADDR32
2976 #define R_PPC64_UADDR16 R_PPC_UADDR16
2977 #define R_PPC64_REL32 R_PPC_REL32
2978 #define R_PPC64_PLT32 R_PPC_PLT32
2979 #define R_PPC64_PLTREL32 R_PPC_PLTREL32
2980 #define R_PPC64_PLT16_LO R_PPC_PLT16_LO
2981 #define R_PPC64_PLT16_HI R_PPC_PLT16_HI
2982 #define R_PPC64_PLT16_HA R_PPC_PLT16_HA
2983 
2984 #define R_PPC64_SECTOFF R_PPC_SECTOFF
2985 #define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
2986 #define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
2987 #define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
2988 #define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */
2989 #define R_PPC64_ADDR64 38 /* doubleword64 S + A */
2990 #define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */
2991 #define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */
2992 #define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */
2993 #define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */
2994 #define R_PPC64_UADDR64 43 /* doubleword64 S + A */
2995 #define R_PPC64_REL64 44 /* doubleword64 S + A - P */
2996 #define R_PPC64_PLT64 45 /* doubleword64 L + A */
2997 #define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */
2998 #define R_PPC64_TOC16 47 /* half16* S + A - .TOC */
2999 #define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */
3000 #define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */
3001 #define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */
3002 #define R_PPC64_TOC 51 /* doubleword64 .TOC */
3003 #define R_PPC64_PLTGOT16 52 /* half16* M + A */
3004 #define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */
3005 #define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */
3006 #define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */
3008 #define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */
3009 #define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */
3010 #define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */
3011 #define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */
3012 #define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */
3013 #define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */
3014 #define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */
3015 #define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */
3016 #define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */
3017 #define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */
3018 #define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */
3020 /* PowerPC64 relocations defined for the TLS access ABI. */
3021 #define R_PPC64_TLS 67 /* none (sym+add)@tls */
3022 #define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */
3023 #define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */
3024 #define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
3025 #define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
3026 #define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
3027 #define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */
3028 #define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */
3029 #define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
3030 #define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
3031 #define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
3032 #define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */
3033 #define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
3034 #define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
3035 #define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
3036 #define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
3037 #define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
3038 #define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
3039 #define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
3040 #define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
3041 #define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */
3042 #define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
3043 #define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
3044 #define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
3045 #define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */
3046 #define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
3047 #define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */
3048 #define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */
3049 #define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */
3050 #define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */
3051 #define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */
3052 #define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */
3053 #define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */
3054 #define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */
3055 #define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */
3056 #define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */
3057 #define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */
3058 #define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */
3059 #define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */
3060 #define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */
3061 
3062 /* Keep this the last entry. */
3063 #define R_PPC64_NUM 107
3064 
3065 /* PowerPC64 specific values for the Dyn d_tag field. */
3066 #define DT_PPC64_GLINK (DT_LOPROC + 0)
3067 #define DT_PPC64_OPD (DT_LOPROC + 1)
3068 #define DT_PPC64_OPDSZ (DT_LOPROC + 2)
3069 #define DT_PPC64_NUM 3
3070 
3071 
3072 /* ARM specific declarations */
3074 /* Processor specific flags for the ELF header e_flags field. */
3075 #define EF_ARM_RELEXEC 0x01
3076 #define EF_ARM_HASENTRY 0x02
3077 #define EF_ARM_INTERWORK 0x04
3078 #define EF_ARM_APCS_26 0x08
3079 #define EF_ARM_APCS_FLOAT 0x10
3080 #define EF_ARM_PIC 0x20
3081 #define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */
3082 #define EF_ARM_NEW_ABI 0x80
3083 #define EF_ARM_OLD_ABI 0x100
3085 /* Other constants defined in the ARM ELF spec. version B-01. */
3086 /* NB. These conflict with values defined above. */
3087 #define EF_ARM_SYMSARESORTED 0x04
3088 #define EF_ARM_DYNSYMSUSESEGIDX 0x08
3089 #define EF_ARM_MAPSYMSFIRST 0x10
3090 #define EF_ARM_EABIMASK 0XFF000000
3092 #define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
3093 #define EF_ARM_EABI_UNKNOWN 0x00000000
3094 #define EF_ARM_EABI_VER1 0x01000000
3095 #define EF_ARM_EABI_VER2 0x02000000
3097 /* Additional symbol types for Thumb */
3098 #define STT_ARM_TFUNC 0xd
3100 /* ARM-specific values for sh_flags */
3101 #define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
3102 #define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined
3103  in the input to a link step */
3105 /* ARM-specific program header flags */
3106 #define PF_ARM_SB 0x10000000 /* Segment contains the location
3107  addressed by the static base */
3109 /* ARM relocs. */
3110 #define R_ARM_NONE 0 /* No reloc */
3111 #define R_ARM_PC24 1 /* PC relative 26 bit branch */
3112 #define R_ARM_ABS32 2 /* Direct 32 bit */
3113 #define R_ARM_REL32 3 /* PC relative 32 bit */
3114 #define R_ARM_PC13 4
3115 #define R_ARM_ABS16 5 /* Direct 16 bit */
3116 #define R_ARM_ABS12 6 /* Direct 12 bit */
3117 #define R_ARM_THM_ABS5 7
3118 #define R_ARM_ABS8 8 /* Direct 8 bit */
3119 #define R_ARM_SBREL32 9
3120 #define R_ARM_THM_PC22 10
3121 #define R_ARM_THM_PC8 11
3122 #define R_ARM_AMP_VCALL9 12
3123 #define R_ARM_SWI24 13
3124 #define R_ARM_THM_SWI8 14
3125 #define R_ARM_XPC25 15
3126 #define R_ARM_THM_XPC22 16
3127 #define R_ARM_COPY 20 /* Copy symbol at runtime */
3128 #define R_ARM_GLOB_DAT 21 /* Create GOT entry */
3129 #define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
3130 #define R_ARM_RELATIVE 23 /* Adjust by program base */
3131 #define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
3132 #define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
3133 #define R_ARM_GOT32 26 /* 32 bit GOT entry */
3134 #define R_ARM_PLT32 27 /* 32 bit PLT address */
3135 #define R_ARM_ALU_PCREL_7_0 32
3136 #define R_ARM_ALU_PCREL_15_8 33
3137 #define R_ARM_ALU_PCREL_23_15 34
3138 #define R_ARM_LDR_SBREL_11_0 35
3139 #define R_ARM_ALU_SBREL_19_12 36
3140 #define R_ARM_ALU_SBREL_27_20 37
3141 #define R_ARM_GNU_VTENTRY 100
3142 #define R_ARM_GNU_VTINHERIT 101
3143 #define R_ARM_THM_PC11 102 /* thumb unconditional branch */
3144 #define R_ARM_THM_PC9 103 /* thumb conditional branch */
3145 #define R_ARM_RXPC25 249
3146 #define R_ARM_RSBREL32 250
3147 #define R_ARM_THM_RPC22 251
3148 #define R_ARM_RREL32 252
3149 #define R_ARM_RABS22 253
3150 #define R_ARM_RPC24 254
3151 #define R_ARM_RBASE 255
3152 /* Keep this the last entry. */
3153 #define R_ARM_NUM 256
3155 /* IA-64 specific declarations. */
3157 /* Processor specific flags for the Ehdr e_flags field. */
3158 #define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */
3159 #define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */
3160 #define EF_IA_64_ARCH 0xff000000 /* arch. version mask */
3162 /* Processor specific values for the Phdr p_type field. */
3163 #define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */
3164 #define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */
3165 #define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
3166 #define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
3167 #define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
3169 /* Processor specific flags for the Phdr p_flags field. */
3170 #define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */
3172 /* Processor specific values for the Shdr sh_type field. */
3173 #define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */
3174 #define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
3176 /* Processor specific flags for the Shdr sh_flags field. */
3177 #define SHF_IA_64_SHORT 0x10000000 /* section near gp */
3178 #define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */
3180 /* Processor specific values for the Dyn d_tag field. */
3181 #define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
3182 #define DT_IA_64_NUM 1
3184 /* IA-64 relocations. */
3185 #define R_IA64_NONE 0x00 /* none */
3186 #define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */
3187 #define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */
3188 #define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
3189 #define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */
3190 #define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */
3191 #define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */
3192 #define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */
3193 #define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */
3194 #define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */
3195 #define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */
3196 #define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */
3197 #define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */
3198 #define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */
3199 #define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */
3200 #define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */
3201 #define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */
3202 #define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */
3203 #define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */
3204 #define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */
3205 #define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */
3206 #define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */
3207 #define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */
3208 #define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */
3209 #define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */
3210 #define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */
3211 #define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */
3212 #define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */
3213 #define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */
3214 #define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */
3215 #define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */
3216 #define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */
3217 #define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */
3218 #define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */
3219 #define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */
3220 #define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */
3221 #define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */
3222 #define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */
3223 #define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */
3224 #define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */
3225 #define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */
3226 #define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */
3227 #define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */
3228 #define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */
3229 #define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */
3230 #define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */
3231 #define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */
3232 #define R_IA64_REL32MSB 0x6c /* data 4 + REL */
3233 #define R_IA64_REL32LSB 0x6d /* data 4 + REL */
3234 #define R_IA64_REL64MSB 0x6e /* data 8 + REL */
3235 #define R_IA64_REL64LSB 0x6f /* data 8 + REL */
3236 #define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */
3237 #define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */
3238 #define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */
3239 #define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */
3240 #define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */
3241 #define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */
3242 #define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */
3243 #define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
3244 #define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
3245 #define R_IA64_COPY 0x84 /* copy relocation */
3246 #define R_IA64_SUB 0x85 /* Addend and symbol difference */
3247 #define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
3248 #define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
3249 #define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */
3250 #define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */
3251 #define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */
3252 #define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */
3253 #define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */
3254 #define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */
3255 #define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */
3256 #define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */
3257 #define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */
3258 #define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */
3259 #define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */
3260 #define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */
3261 #define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */
3262 #define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */
3263 #define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */
3264 #define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
3265 #define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
3267 /* SH specific declarations */
3269 /* SH relocs. */
3270 #define R_SH_NONE 0
3271 #define R_SH_DIR32 1
3272 #define R_SH_REL32 2
3273 #define R_SH_DIR8WPN 3
3274 #define R_SH_IND12W 4
3275 #define R_SH_DIR8WPL 5
3276 #define R_SH_DIR8WPZ 6
3277 #define R_SH_DIR8BP 7
3278 #define R_SH_DIR8W 8
3279 #define R_SH_DIR8L 9
3280 #define R_SH_SWITCH16 25
3281 #define R_SH_SWITCH32 26
3282 #define R_SH_USES 27
3283 #define R_SH_COUNT 28
3284 #define R_SH_ALIGN 29
3285 #define R_SH_CODE 30
3286 #define R_SH_DATA 31
3287 #define R_SH_LABEL 32
3288 #define R_SH_SWITCH8 33
3289 #define R_SH_GNU_VTINHERIT 34
3290 #define R_SH_GNU_VTENTRY 35
3291 #define R_SH_TLS_GD_32 144
3292 #define R_SH_TLS_LD_32 145
3293 #define R_SH_TLS_LDO_32 146
3294 #define R_SH_TLS_IE_32 147
3295 #define R_SH_TLS_LE_32 148
3296 #define R_SH_TLS_DTPMOD32 149
3297 #define R_SH_TLS_DTPOFF32 150
3298 #define R_SH_TLS_TPOFF32 151
3299 #define R_SH_GOT32 160
3300 #define R_SH_PLT32 161
3301 #define R_SH_COPY 162
3302 #define R_SH_GLOB_DAT 163
3303 #define R_SH_JMP_SLOT 164
3304 #define R_SH_RELATIVE 165
3305 #define R_SH_GOTOFF 166
3306 #define R_SH_GOTPC 167
3307 /* Keep this the last entry. */
3308 #define R_SH_NUM 256
3310 /* Additional s390 relocs */
3312 #define R_390_NONE 0 /* No reloc. */
3313 #define R_390_8 1 /* Direct 8 bit. */
3314 #define R_390_12 2 /* Direct 12 bit. */
3315 #define R_390_16 3 /* Direct 16 bit. */
3316 #define R_390_32 4 /* Direct 32 bit. */
3317 #define R_390_PC32 5 /* PC relative 32 bit. */
3318 #define R_390_GOT12 6 /* 12 bit GOT offset. */
3319 #define R_390_GOT32 7 /* 32 bit GOT offset. */
3320 #define R_390_PLT32 8 /* 32 bit PC relative PLT address. */
3321 #define R_390_COPY 9 /* Copy symbol at runtime. */
3322 #define R_390_GLOB_DAT 10 /* Create GOT entry. */
3323 #define R_390_JMP_SLOT 11 /* Create PLT entry. */
3324 #define R_390_RELATIVE 12 /* Adjust by program base. */
3325 #define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */
3326 #define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */
3327 #define R_390_GOT16 15 /* 16 bit GOT offset. */
3328 #define R_390_PC16 16 /* PC relative 16 bit. */
3329 #define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */
3330 #define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */
3331 #define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */
3332 #define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */
3333 #define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */
3334 #define R_390_64 22 /* Direct 64 bit. */
3335 #define R_390_PC64 23 /* PC relative 64 bit. */
3336 #define R_390_GOT64 24 /* 64 bit GOT offset. */
3337 #define R_390_PLT64 25 /* 64 bit PC relative PLT address. */
3338 #define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */
3339 #define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */
3340 #define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */
3341 #define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */
3342 #define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */
3343 #define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */
3344 #define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */
3345 #define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */
3346 #define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */
3347 #define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */
3348 #define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */
3349 #define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */
3350 #define R_390_TLS_GDCALL 38 /* Tag for function call in general
3351  dynamic TLS code. */
3352 #define R_390_TLS_LDCALL 39 /* Tag for function call in local
3353  dynamic TLS code. */
3354 #define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic
3355  thread local data. */
3356 #define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic
3357  thread local data. */
3358 #define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS
3359  block offset. */
3360 #define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS
3361  block offset. */
3362 #define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS
3363  block offset. */
3364 #define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic
3365  thread local data in LE code. */
3366 #define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic
3367  thread local data in LE code. */
3368 #define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for
3369  negated static TLS block offset. */
3370 #define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for
3371  negated static TLS block offset. */
3372 #define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for
3373  negated static TLS block offset. */
3374 #define R_390_TLS_LE32 50 /* 32 bit negated offset relative to
3375  static TLS block. */
3376 #define R_390_TLS_LE64 51 /* 64 bit negated offset relative to
3377  static TLS block. */
3378 #define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS
3379  block. */
3380 #define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS
3381  block. */
3382 #define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */
3383 #define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */
3384 #define R_390_TLS_TPOFF 56 /* Negated offset in static TLS
3385  block. */
3386 #define R_390_20 57 /* Direct 20 bit. */
3387 #define R_390_GOT20 58 /* 20 bit GOT offset. */
3388 #define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */
3389 #define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS
3390  block offset. */
3391 /* Keep this the last entry. */
3392 #define R_390_NUM 61
3393 
3395 /* CRIS relocations. */
3396 #define R_CRIS_NONE 0
3397 #define R_CRIS_8 1
3398 #define R_CRIS_16 2
3399 #define R_CRIS_32 3
3400 #define R_CRIS_8_PCREL 4
3401 #define R_CRIS_16_PCREL 5
3402 #define R_CRIS_32_PCREL 6
3403 #define R_CRIS_GNU_VTINHERIT 7
3404 #define R_CRIS_GNU_VTENTRY 8
3405 #define R_CRIS_COPY 9
3406 #define R_CRIS_GLOB_DAT 10
3407 #define R_CRIS_JUMP_SLOT 11
3408 #define R_CRIS_RELATIVE 12
3409 #define R_CRIS_16_GOT 13
3410 #define R_CRIS_32_GOT 14
3411 #define R_CRIS_16_GOTPLT 15
3412 #define R_CRIS_32_GOTPLT 16
3413 #define R_CRIS_32_GOTREL 17
3414 #define R_CRIS_32_PLT_GOTREL 18
3415 #define R_CRIS_32_PLT_PCREL 19
3417 #define R_CRIS_NUM 20
3418 
3420 /* AMD x86-64 relocations. */
3421 #define R_X86_64_NONE 0 /* No reloc */
3422 #define R_X86_64_64 1 /* Direct 64 bit */
3423 #define R_X86_64_PC32 2 /* PC relative 32 bit signed */
3424 #define R_X86_64_GOT32 3 /* 32 bit GOT entry */
3425 #define R_X86_64_PLT32 4 /* 32 bit PLT address */
3426 #define R_X86_64_COPY 5 /* Copy symbol at runtime */
3427 #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
3428 #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
3429 #define R_X86_64_RELATIVE 8 /* Adjust by program base */
3430 #define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative
3431  offset to GOT */
3432 #define R_X86_64_32 10 /* Direct 32 bit zero extended */
3433 #define R_X86_64_32S 11 /* Direct 32 bit sign extended */
3434 #define R_X86_64_16 12 /* Direct 16 bit zero extended */
3435 #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
3436 #define R_X86_64_8 14 /* Direct 8 bit sign extended */
3437 #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
3438 #define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
3439 #define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */
3440 #define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */
3441 #define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset
3442  to two GOT entries for GD symbol */
3443 #define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset
3444  to two GOT entries for LD symbol */
3445 #define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
3446 #define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset
3447  to GOT entry for IE symbol */
3448 #define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */
3449 
3450 #define R_X86_64_NUM 24
3453 /* AM33 relocations. */
3454 #define R_MN10300_NONE 0 /* No reloc. */
3455 #define R_MN10300_32 1 /* Direct 32 bit. */
3456 #define R_MN10300_16 2 /* Direct 16 bit. */
3457 #define R_MN10300_8 3 /* Direct 8 bit. */
3458 #define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */
3459 #define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */
3460 #define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */
3461 #define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */
3462 #define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */
3463 #define R_MN10300_24 9 /* Direct 24 bit. */
3464 #define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */
3465 #define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */
3466 #define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */
3467 #define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */
3468 #define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */
3469 #define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */
3470 #define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */
3471 #define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */
3472 #define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */
3473 #define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */
3474 #define R_MN10300_COPY 20 /* Copy symbol at runtime. */
3475 #define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */
3476 #define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */
3477 #define R_MN10300_RELATIVE 23 /* Adjust by program base. */
3479 #define R_MN10300_NUM 24
3482 /* M32R relocs. */
3483 #define R_M32R_NONE 0 /* No reloc. */
3484 #define R_M32R_16 1 /* Direct 16 bit. */
3485 #define R_M32R_32 2 /* Direct 32 bit. */
3486 #define R_M32R_24 3 /* Direct 24 bit. */
3487 #define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */
3488 #define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */
3489 #define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */
3490 #define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */
3491 #define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */
3492 #define R_M32R_LO16 9 /* Low 16 bit. */
3493 #define R_M32R_SDA16 10 /* 16 bit offset in SDA. */
3494 #define R_M32R_GNU_VTINHERIT 11
3495 #define R_M32R_GNU_VTENTRY 12
3496 /* M32R relocs use SHT_RELA. */
3497 #define R_M32R_16_RELA 33 /* Direct 16 bit. */
3498 #define R_M32R_32_RELA 34 /* Direct 32 bit. */
3499 #define R_M32R_24_RELA 35 /* Direct 24 bit. */
3500 #define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */
3501 #define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */
3502 #define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */
3503 #define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */
3504 #define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */
3505 #define R_M32R_LO16_RELA 41 /* Low 16 bit */
3506 #define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */
3507 #define R_M32R_RELA_GNU_VTINHERIT 43
3508 #define R_M32R_RELA_GNU_VTENTRY 44
3509 
3510 #define R_M32R_GOT24 48 /* 24 bit GOT entry */
3511 #define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */
3512 #define R_M32R_COPY 50 /* Copy symbol at runtime */
3513 #define R_M32R_GLOB_DAT 51 /* Create GOT entry */
3514 #define R_M32R_JMP_SLOT 52 /* Create PLT entry */
3515 #define R_M32R_RELATIVE 53 /* Adjust by program base */
3516 #define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */
3517 #define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */
3518 #define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned
3519  low */
3520 #define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed
3521  low */
3522 #define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */
3523 #define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to
3524  GOT with unsigned low */
3525 #define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to
3526  GOT with signed low */
3527 #define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to
3528  GOT */
3529 #define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT
3530  with unsigned low */
3531 #define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT
3532  with signed low */
3533 #define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */
3534 #define R_M32R_NUM 256 /* Keep this the last entry. */
3535 
3536 
3537 struct rusage {
3538  struct timeval ru_utime; /* user time used */
3539  struct timeval ru_stime; /* system time used */
3540  long ru_maxrss; /* maximum resident set size */
3541  long ru_ixrss; /* integral shared memory size */
3542  long ru_idrss; /* integral unshared data size */
3543  long ru_isrss; /* integral unshared stack size */
3544  long ru_minflt; /* page reclaims */
3545  long ru_majflt; /* page faults */
3546  long ru_nswap; /* swaps */
3547  long ru_inblock; /* block input operations */
3548  long ru_oublock; /* block output operations */
3549  long ru_msgsnd; /* messages sent */
3550  long ru_msgrcv; /* messages received */
3551  long ru_nsignals; /* signals received */
3552  long ru_nvcsw; /* voluntary context switches */
3553  long ru_nivcsw; /* involuntary context switches */
3554 };
3555 
3558 #define MAXNAMLEN 255
3559 struct bsd_dirent {
3562  uint8_t d_type;
3563  uint8_t d_namlen;
3564  char d_name[MAXNAMLEN + 1];
3565 };
3566 
3567 /* semop system calls takes an array of these. */
3568 struct sembuf {
3569  unsigned short sem_num; /* semaphore index in array */
3570  short sem_op; /* semaphore operation */
3571  short sem_flg; /* operation flags */
3572 };
3573 
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
uint64_t Elf32_Xword
Definition: glibc_elf.h:43
int32_t Elf32_Sword
Definition: glibc_elf.h:38
uint32_t Elf32_Addr
Definition: glibc_elf.h:49
uint64_t Elf64_Xword
Definition: glibc_elf.h:45
int64_t Elf64_Sxword
Definition: glibc_elf.h:46
uint32_t Elf32_Off
Definition: glibc_elf.h:53
uint64_t Elf64_Off
Definition: glibc_elf.h:54
uint32_t Elf64_Word
Definition: glibc_elf.h:39
uint16_t Elf32_Section
Definition: glibc_elf.h:57
uint16_t Elf64_Section
Definition: glibc_elf.h:58
uint16_t Elf64_Half
Definition: glibc_elf.h:34
uint64_t Elf64_Addr
Definition: glibc_elf.h:50
uint32_t Elf32_Word
Definition: glibc_elf.h:37
voidpf void uLong size
Definition: ioapi.h:138
Elf32_Lib
Definition: mips.h:384
static int
Definition: sfsocketcall.h:114
unsigned char cc_t
Definition: sftypes.h:836
uint64_t Elf32_Xword
Definition: sftypes.h:1022
unsigned int in_addr_t
Definition: sftypes.h:333
unsigned int __invalid_size_argument_for_IOC
int dev_t
Definition: sftypes.h:61
unsigned int speed_t
Definition: sftypes.h:837
#define NCCS
Definition: sftypes.h:840
#define IN6ADDR_ANY_INIT
Definition: sftypes.h:367
int mode_t
Definition: sftypes.h:42
@ __SCM_CONNECT
Definition: sftypes.h:389
#define SOCK_STREAM
Definition: sftypes.h:226
unsigned short uint16_t
Definition: sftypes.h:30
unsigned short int sa_family_t
Definition: sftypes.h:322
uint16_t Elf32_Half
Definition: sftypes.h:1012
int32_t Elf32_Sword
Definition: sftypes.h:1017
long int64_t
Definition: sftypes.h:32
int int32_t
Definition: sftypes.h:33
#define SOCK_RAW
Definition: sftypes.h:231
int32_t Elf64_Sword
Definition: sftypes.h:1019
int uid_t
Definition: sftypes.h:44
uint32_t Elf32_Addr
Definition: sftypes.h:1028
int size_t
Definition: sftypes.h:40
unsigned int uint32_t
Definition: sftypes.h:29
#define SOCK_SEQPACKET
Definition: sftypes.h:236
#define SOCK_DGRAM
Definition: sftypes.h:229
int cap_user_header_t
Definition: sftypes.h:64
uint64_t Elf64_Xword
Definition: sftypes.h:1024
int64_t Elf64_Sxword
Definition: sftypes.h:1025
uint32_t Elf32_Off
Definition: sftypes.h:1032
#define NCC
Definition: sftypes.h:790
#define SCM_RIGHTS
Definition: sftypes.h:384
Elf32_Addr Elf32_Conflict
Definition: sftypes.h:2563
uint64_t Elf64_Off
Definition: sftypes.h:1033
unsigned int socklen_t
Definition: sftypes.h:219
#define __SOCKADDR_COMMON_SIZE
Definition: sftypes.h:325
void(* sighandler_t)(int)
Definition: sftypes.h:46
int caddr_t
Definition: sftypes.h:62
#define SOCK_PACKET
__socket_type
Definition: sftypes.h:223
#define FD_SETSIZE
Definition: sftypes.h:190
Elf32_Half Elf32_Versym
Definition: sftypes.h:1040
int gid_t
Definition: sftypes.h:45
int64_t Elf32_Sxword
Definition: sftypes.h:1023
int clock_t
Definition: sftypes.h:43
long int fd_mask
Definition: sftypes.h:188
unsigned long uint64_t
Definition: sftypes.h:28
short int16_t
Definition: sftypes.h:34
uint32_t Elf64_Word
Definition: sftypes.h:1018
#define MAXNAMLEN
Definition: sftypes.h:3491
int off_t
Definition: sftypes.h:41
int pid_t
Definition: sftypes.h:38
unsigned char uint8_t
Definition: sftypes.h:31
uint16_t Elf32_Section
Definition: sftypes.h:1036
unsigned int tcflag_t
Definition: sftypes.h:838
uint16_t Elf64_Section
Definition: sftypes.h:1037
Elf64_Half Elf64_Versym
Definition: sftypes.h:1041
char int8_t
Definition: sftypes.h:35
uint16_t Elf64_Half
Definition: sftypes.h:1013
unsigned short in_port_t
Definition: sftypes.h:334
__ptrace_request
Definition: sftypes.h:552
@ PTRACE_POKEUSER
Definition: sftypes.h:580
@ PTRACE_POKEDATA
Definition: sftypes.h:576
@ PTRACE_SETFPREGS
Definition: sftypes.h:613
@ PTRACE_SETREGS
Definition: sftypes.h:603
@ PTRACE_CONT
Definition: sftypes.h:584
@ PTRACE_PEEKTEXT
Definition: sftypes.h:560
@ PTRACE_SINGLESTEP
Definition: sftypes.h:593
@ PTRACE_SETFPXREGS
Definition: sftypes.h:631
@ PTRACE_KILL
Definition: sftypes.h:588
@ PTRACE_GETREGS
Definition: sftypes.h:598
@ PTRACE_PEEKDATA
Definition: sftypes.h:564
@ PTRACE_TRACEME
Definition: sftypes.h:556
@ PTRACE_ATTACH
Definition: sftypes.h:617
@ PTRACE_GETFPREGS
Definition: sftypes.h:608
@ PTRACE_GETFPXREGS
Definition: sftypes.h:626
@ PTRACE_SYSCALL
Definition: sftypes.h:635
@ PTRACE_PEEKUSER
Definition: sftypes.h:568
@ PTRACE_POKETEXT
Definition: sftypes.h:572
@ PTRACE_DETACH
Definition: sftypes.h:621
#define EI_NIDENT
Definition: sftypes.h:1046
#define NFDBITS
Definition: sftypes.h:192
uint64_t Elf64_Addr
Definition: sftypes.h:1029
uint32_t Elf32_Word
Definition: sftypes.h:1016
int ssize_t
Definition: sftypes.h:39
int sigset_t
Definition: sftypes.h:63
static const struct in6_addr in6addr_any
Definition: sftypes.h:368
int time_t
Definition: sftypes.h:66
int ptrdiff_t
Definition: sftypes.h:68
int cap_user_data_t
Definition: sftypes.h:65
#define SOCK_RDM
Definition: sftypes.h:233
Elf64_Sxword r_addend
Definition: sftypes.h:1491
Elf64_Addr r_offset
Definition: sftypes.h:1489
Elf64_Xword r_info
Definition: sftypes.h:1490
long int a_type
Definition: sftypes.h:1883
long int a_val
Definition: sftypes.h:1886
void * a_ptr
Definition: sftypes.h:1887
uint32_t d_fileno
Definition: sftypes.h:3493
uint8_t d_type
Definition: sftypes.h:3495
char d_name[MAXNAMLEN+1]
Definition: sftypes.h:3497
uint8_t d_namlen
Definition: sftypes.h:3496
uint16_t d_reclen
Definition: sftypes.h:3494
int cmsg_type
Definition: sftypes.h:412
size_t cmsg_len
Definition: sftypes.h:409
int cmsg_level
Definition: sftypes.h:411
Definition: sftypes.h:48
int d_off
Definition: sftypes.h:50
unsigned short int d_reclen
Definition: sftypes.h:51
char d_name[256]
Definition: sftypes.h:52
int d_ino
Definition: sftypes.h:49
union in6_addr::@318 __in6_u
uint8_t __u6_addr8[16]
Definition: sftypes.h:363
in_addr_t s_addr
Definition: sftypes.h:337
Definition: sftypes.h:73
Definition: sftypes.h:77
struct iovec * msg_iov
Definition: sftypes.h:397
socklen_t msg_namelen
Definition: sftypes.h:395
void * msg_name
Definition: sftypes.h:394
int msg_flags
Definition: sftypes.h:403
size_t msg_controllen
Definition: sftypes.h:401
size_t msg_iovlen
Definition: sftypes.h:398
void * msg_control
Definition: sftypes.h:400
Definition: sftypes.h:75
long ru_nvcsw
Definition: sftypes.h:3485
long ru_nswap
Definition: sftypes.h:3479
struct timeval ru_utime
Definition: sftypes.h:3471
long ru_minflt
Definition: sftypes.h:3477
long ru_nivcsw
Definition: sftypes.h:3486
struct timeval ru_stime
Definition: sftypes.h:3472
long ru_isrss
Definition: sftypes.h:3476
long ru_majflt
Definition: sftypes.h:3478
long ru_idrss
Definition: sftypes.h:3475
long ru_nsignals
Definition: sftypes.h:3484
long ru_msgsnd
Definition: sftypes.h:3482
long ru_ixrss
Definition: sftypes.h:3474
long ru_inblock
Definition: sftypes.h:3480
long ru_msgrcv
Definition: sftypes.h:3483
long ru_maxrss
Definition: sftypes.h:3473
long ru_oublock
Definition: sftypes.h:3481
short sem_flg
Definition: sftypes.h:3504
unsigned short sem_num
Definition: sftypes.h:3502
short sem_op
Definition: sftypes.h:3503
in_port_t sin6_port
Definition: sftypes.h:373
struct in6_addr sin6_addr
Definition: sftypes.h:375
uint32_t sin6_flowinfo
Definition: sftypes.h:374
__SOCKADDR_COMMON(sin6_)
uint32_t sin6_scope_id
Definition: sftypes.h:376
__SOCKADDR_COMMON(sin_)
struct in_addr sin_addr
Definition: sftypes.h:344
in_port_t sin_port
Definition: sftypes.h:343
unsigned char sin_zero[sizeof(struct sockaddr) - __SOCKADDR_COMMON_SIZE - sizeof(in_port_t) - sizeof(struct in_addr)]
Definition: sftypes.h:350
__SOCKADDR_COMMON(sun_)
char sun_path[108]
Definition: sftypes.h:356
__SOCKADDR_COMMON(sa_)
char sa_data[14]
Definition: sftypes.h:330
Definition: sftypes.h:80
Definition: sftypes.h:74
unsigned short c_cflag
Definition: sftypes.h:794
unsigned short c_oflag
Definition: sftypes.h:793
unsigned char c_line
Definition: sftypes.h:796
unsigned short c_iflag
Definition: sftypes.h:792
unsigned short c_lflag
Definition: sftypes.h:795
unsigned char c_cc[NCC]
Definition: sftypes.h:797
tcflag_t c_cflag
Definition: sftypes.h:844
cc_t c_cc[NCCS]
Definition: sftypes.h:847
tcflag_t c_iflag
Definition: sftypes.h:842
tcflag_t c_lflag
Definition: sftypes.h:845
tcflag_t c_oflag
Definition: sftypes.h:843
cc_t c_line
Definition: sftypes.h:846
long tv_nsec
Definition: sftypes.h:90
time_t tv_sec
Definition: sftypes.h:89
long tv_sec
Definition: sftypes.h:84
long tv_usec
Definition: sftypes.h:85
Definition: sftypes.h:55
clock_t tms_utime
Definition: sftypes.h:56
clock_t tms_stime
Definition: sftypes.h:57
clock_t tms_cstime
Definition: sftypes.h:59
clock_t tms_cutime
Definition: sftypes.h:58
Definition: sftypes.h:79
unsigned short ws_row
Definition: sftypes.h:784
unsigned short ws_col
Definition: sftypes.h:785
unsigned short ws_xpixel
Definition: sftypes.h:786
unsigned short ws_ypixel
Definition: sftypes.h:787