a.out.h revision 4b29af0a1b8b25b43e4c0cb9bf066c52f3add9bd
1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12#ifndef __A_OUT_GNU_H__ 13#define __A_OUT_GNU_H__ 14 15#define __GNU_EXEC_MACROS__ 16 17#ifndef __STRUCT_EXEC_OVERRIDE__ 18 19#include <asm/a.out.h> 20 21#endif 22 23enum machine_type { 24#ifdef M_OLDSUN2 25 M__OLDSUN2 = M_OLDSUN2, 26#else 27 M_OLDSUN2 = 0, 28#endif 29#ifdef M_68010 30 M__68010 = M_68010, 31#else 32 M_68010 = 1, 33#endif 34#ifdef M_68020 35 M__68020 = M_68020, 36#else 37 M_68020 = 2, 38#endif 39#ifdef M_SPARC 40 M__SPARC = M_SPARC, 41#else 42 M_SPARC = 3, 43#endif 44 45 M_386 = 100, 46 M_MIPS1 = 151, 47 M_MIPS2 = 152 48}; 49 50#ifndef N_MAGIC 51#define N_MAGIC(exec) ((exec).a_info & 0xffff) 52#endif 53#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) 54#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) 55#define N_SET_INFO(exec, magic, type, flags) ((exec).a_info = ((magic) & 0xffff) | (((int)(type) & 0xff) << 16) | (((flags) & 0xff) << 24)) 56#define N_SET_MAGIC(exec, magic) ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff))) 57 58#define N_SET_MACHTYPE(exec, machtype) ((exec).a_info = ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) 59 60#define N_SET_FLAGS(exec, flags) ((exec).a_info = ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) 61 62#define OMAGIC 0407 63 64#define NMAGIC 0410 65 66#define ZMAGIC 0413 67 68#define QMAGIC 0314 69 70#define CMAGIC 0421 71 72#ifndef N_BADMAG 73#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) 74#endif 75 76#define _N_HDROFF(x) (1024 - sizeof (struct exec)) 77 78#ifndef N_TXTOFF 79#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec))) 80#endif 81 82#ifndef N_DATOFF 83#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) 84#endif 85 86#ifndef N_TRELOFF 87#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) 88#endif 89 90#ifndef N_DRELOFF 91#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) 92#endif 93 94#ifndef N_SYMOFF 95#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) 96#endif 97 98#ifndef N_STROFF 99#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) 100#endif 101 102#ifndef N_TXTADDR 103#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0) 104#endif 105 106#if defined(vax) || defined(hp300) || defined(pyr) 107#define SEGMENT_SIZE page_size 108#endif 109#ifdef sony 110#define SEGMENT_SIZE 0x2000 111#endif 112#ifdef is68k 113#define SEGMENT_SIZE 0x20000 114#endif 115#if defined(m68k) && defined(PORTAR) 116#define PAGE_SIZE 0x400 117#define SEGMENT_SIZE PAGE_SIZE 118#endif 119 120#ifdef linux 121#include <asm/page.h> 122#if defined(__i386__) || defined(__mc68000__) 123#define SEGMENT_SIZE 1024 124#else 125#ifndef SEGMENT_SIZE 126#define SEGMENT_SIZE PAGE_SIZE 127#endif 128#endif 129#endif 130 131#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE) 132 133#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) 134 135#ifndef N_DATADDR 136#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) 137#endif 138 139#ifndef N_BSSADDR 140#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) 141#endif 142 143#ifndef N_NLIST_DECLARED 144struct nlist { 145 union { 146 char *n_name; 147 struct nlist *n_next; 148 long n_strx; 149 } n_un; 150 unsigned char n_type; 151 char n_other; 152 short n_desc; 153 unsigned long n_value; 154}; 155#endif 156 157#ifndef N_UNDF 158#define N_UNDF 0 159#endif 160#ifndef N_ABS 161#define N_ABS 2 162#endif 163#ifndef N_TEXT 164#define N_TEXT 4 165#endif 166#ifndef N_DATA 167#define N_DATA 6 168#endif 169#ifndef N_BSS 170#define N_BSS 8 171#endif 172#ifndef N_FN 173#define N_FN 15 174#endif 175 176#ifndef N_EXT 177#define N_EXT 1 178#endif 179#ifndef N_TYPE 180#define N_TYPE 036 181#endif 182#ifndef N_STAB 183#define N_STAB 0340 184#endif 185 186#define N_INDR 0xa 187 188#define N_SETA 0x14 189#define N_SETT 0x16 190#define N_SETD 0x18 191#define N_SETB 0x1A 192 193#define N_SETV 0x1C 194 195#ifndef N_RELOCATION_INFO_DECLARED 196 197struct relocation_info 198{ 199 200 int r_address; 201 202 unsigned int r_symbolnum:24; 203 204 unsigned int r_pcrel:1; 205 206 unsigned int r_length:2; 207 208 unsigned int r_extern:1; 209 210#ifdef NS32K 211 unsigned r_bsr:1; 212 unsigned r_disp:1; 213 unsigned r_pad:2; 214#else 215 unsigned int r_pad:4; 216#endif 217}; 218#endif 219 220#endif 221