xref: /illumos-gate/usr/src/uts/common/sys/exechdr.h (revision 4eaa471005973e11a6110b69fe990530b3b95a38)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/inttypes.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * format of the exec header
40  * known by kernel and by user programs
41  */
42 struct exec {
43 	unsigned	a_dynamic:1;	/* has a __DYNAMIC */
44 	unsigned	a_toolversion:7; /* version of toolset used to */
45 					/* create this file */
46 	unsigned char	a_machtype;	/* machine type */
47 	uint16_t 	a_magic;	/* magic number */
48 	uint32_t	a_text;		/* size of text segment */
49 	uint32_t	a_data;		/* size of initialized data */
50 	uint32_t	a_bss;		/* size of uninitialized data */
51 	uint32_t	a_syms;		/* size of symbol table */
52 	uint32_t	a_entry;	/* entry point */
53 	uint32_t	a_trsize;	/* size of text relocation */
54 	uint32_t	a_drsize;	/* size of data relocation */
55 };
56 
57 #define	OMAGIC	0407		/* old impure format */
58 #define	NMAGIC	0410		/* read-only text */
59 #define	ZMAGIC	0413		/* demand load format */
60 
61 /* machine types */
62 
63 #define	M_OLDSUN2	0	/* old sun-2 executable files */
64 #define	M_68010		1	/* runs on either 68010 or 68020 */
65 #define	M_68020		2	/* runs only on 68020 */
66 #define	M_SPARC		3	/* runs only on SPARC */
67 
68 #define	TV_SUN2_SUN3	0
69 #define	TV_SUN4		1
70 
71 #ifdef	__cplusplus
72 }
73 #endif
74 
75 #endif /* _SYS_EXECHDR_H */
76