Go to the documentation of this file. 1 #ifndef _UAPI__A_OUT_GNU_H__
2 #define _UAPI__A_OUT_GNU_H__
4 #define __GNU_EXEC_MACROS__
6 #ifndef __STRUCT_EXEC_OVERRIDE__
16 #if defined (M_OLDSUN2)
42 #if !defined (N_MAGIC)
43 #define N_MAGIC(exec) ((exec).a_info & 0xffff)
45 #define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
46 #define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
47 #define N_SET_INFO(exec, magic, type, flags) \
48 ((exec).a_info = ((magic) & 0xffff) \
49 | (((int)(type) & 0xff) << 16) \
50 | (((flags) & 0xff) << 24))
51 #define N_SET_MAGIC(exec, magic) \
52 ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
54 #define N_SET_MACHTYPE(exec, machtype) \
56 ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
58 #define N_SET_FLAGS(exec, flags) \
60 ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
75 #if !defined (N_BADMAG)
76 #define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
77 && N_MAGIC(x) != NMAGIC \
78 && N_MAGIC(x) != ZMAGIC \
79 && N_MAGIC(x) != QMAGIC)
82 #define _N_HDROFF(x) (1024 - sizeof (struct exec))
84 #if !defined (N_TXTOFF)
86 (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
87 (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
90 #if !defined (N_DATOFF)
91 #define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
94 #if !defined (N_TRELOFF)
95 #define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
98 #if !defined (N_DRELOFF)
99 #define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
102 #if !defined (N_SYMOFF)
103 #define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
106 #if !defined (N_STROFF)
107 #define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
111 #if !defined (N_TXTADDR)
112 #define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
118 #if defined(vax) || defined(hp300) || defined(pyr)
119 #define SEGMENT_SIZE page_size
122 #define SEGMENT_SIZE 0x2000
125 #define SEGMENT_SIZE 0x20000
127 #if defined(m68k) && defined(PORTAR)
128 #define PAGE_SIZE 0x400
129 #define SEGMENT_SIZE PAGE_SIZE
136 #if defined(__i386__) || defined(__mc68000__)
137 #define SEGMENT_SIZE 1024
141 #define SEGMENT_SIZE getpagesize()
147 #define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
149 #define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
152 #define N_DATADDR(x) \
153 (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
154 : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
158 #if !defined (N_BSSADDR)
159 #define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
162 #if !defined (N_NLIST_DECLARED)
176 #if !defined (N_UNDF)
182 #if !defined (N_TEXT)
185 #if !defined (N_DATA)
198 #if !defined (N_TYPE)
201 #if !defined (N_STAB)
235 #if !defined (N_RELOCATION_INFO_DECLARED)