xref: /illumos-gate/usr/src/uts/common/sys/exechdr.h (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1995-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_EXECHDR_H
28 #define	_SYS_EXECHDR_H
29 
30 #include <sys/inttypes.h>
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * format of the exec header
38  * known by kernel and by user programs
39  */
40 struct exec {
41 	unsigned	a_dynamic:1;	/* has a __DYNAMIC */
42 	unsigned	a_toolversion:7; /* version of toolset used to */
43 					/* create this file */
44 	unsigned char	a_machtype;	/* machine type */
45 	uint16_t 	a_magic;	/* magic number */
46 	uint32_t	a_text;		/* size of text segment */
47 	uint32_t	a_data;		/* size of initialized data */
48 	uint32_t	a_bss;		/* size of uninitialized data */
49 	uint32_t	a_syms;		/* size of symbol table */
50 	uint32_t	a_entry;	/* entry point */
51 	uint32_t	a_trsize;	/* size of text relocation */
52 	uint32_t	a_drsize;	/* size of data relocation */
53 };
54 
55 #define	OMAGIC	0407		/* old impure format */
56 #define	NMAGIC	0410		/* read-only text */
57 #define	ZMAGIC	0413		/* demand load format */
58 
59 /* machine types */
60 
61 #define	M_OLDSUN2	0	/* old sun-2 executable files */
62 #define	M_68010		1	/* runs on either 68010 or 68020 */
63 #define	M_68020		2	/* runs only on 68020 */
64 #define	M_SPARC		3	/* runs only on SPARC */
65 
66 #define	TV_SUN2_SUN3	0
67 #define	TV_SUN4		1
68 
69 #ifdef	__cplusplus
70 }
71 #endif
72 
73 #endif /* _SYS_EXECHDR_H */
74