1 /**	$MirOS: src/sys/arch/i386/include/exec.h,v 1.6 2008/11/17 01:11:42 tg Exp $ */
2 /*	$OpenBSD: exec.h,v 1.9 2003/04/17 03:42:14 drahn Exp $	*/
3 /*	$NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $	*/
4 
5 /*
6  * Copyright (c) 1993 Christopher G. Demetriou
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. The name of the author may not be used to endorse or promote products
18  *    derived from this software without specific prior written permission
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef _I386_EXEC_H_
33 #define _I386_EXEC_H_
34 
35 #define __LDPGSZ	4096
36 
37 /* Relocation format for a.out. */
38 #ifndef __ELF__
39 struct relocation_info_i386 {
40 	int r_address;			/* offset in text or data segment */
41 	unsigned int r_symbolnum : 24,	/* ordinal number of add symbol */
42 			 r_pcrel :  1,	/* 1 if value should be pc-relative */
43 			r_length :  2,	/* log base 2 of value's width */
44 			r_extern :  1,	/* 1 if need to add symbol to value */
45 		       r_baserel :  1,	/* linkage table relative */
46 		      r_jmptable :  1,	/* relocate to jump table */
47 		      r_relative :  1,	/* load address relative */
48 			  r_copy :  1;	/* run time copy */
49 };
50 #define relocation_info	relocation_info_i386
51 #endif
52 
53 #define NATIVE_EXEC_ELF
54 
55 #define ARCH_ELFSIZE		32
56 
57 #define ELF_TARG_CLASS		ELFCLASS32
58 #define ELF_TARG_DATA		ELFDATA2LSB
59 #define ELF_TARG_MACH		EM_386 /* XXX - EM_486 is currently unused
60                                           by all OSs/compilers/linkers */
61 
62 #define _NLIST_DO_ELF
63 #define _KERN_DO_ELF
64 
65 #ifndef SMALL_KERNEL
66 #define _NLIST_DO_AOUT
67 #define _KERN_DO_AOUT
68 #define _KERN_DO_ECOFF		/* for ports/plan9/kencc */
69 #endif
70 
71 #endif  /* _I386_EXEC_H_ */
72