xref: /titanic_44/usr/src/cmd/sgs/include/a.out.h (revision 495db6fbcd9e8ab893e91f6f5627df6e0cec63cf)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #pragma ident	"%Z%%M%	%I%	%E% SMI"
27 
28 #ifndef	A_DOT_OUT_DOT_H
29 #define	A_DOT_OUT_DOT_H
30 
31 struct exec {
32 #ifdef	sun
33 	unsigned char	a_dynamic:1;	/* has a __DYNAMIC */
34 	unsigned char	a_toolversion:7; /* version of toolset used to create */
35 					/*	this file */
36 	unsigned char	a_machtype;	/* machine type */
37 	unsigned short	a_magic;	/* magic number */
38 #else
39 	unsigned long	a_magic;	/* magic number */
40 #endif
41 	unsigned long	a_text;		/* size of text segment */
42 	unsigned long	a_data;		/* size of initialized data */
43 	unsigned long	a_bss;		/* size of uninitialized data */
44 	unsigned long	a_syms;		/* size of symbol table */
45 	unsigned long	a_entry;	/* entry point */
46 	unsigned long	a_trsize;	/* size of text relocation */
47 	unsigned long	a_drsize;	/* size of data relocation */
48 };
49 
50 /*
51  * Version of struct exec intended to allow LP64 code to
52  * examine a 32-bit definition.
53  */
54 struct exec32 {
55 #ifdef	sun
56 	unsigned char	a_dynamic:1;	/* has a __DYNAMIC */
57 	unsigned char	a_toolversion:7; /* version of toolset used to create */
58 					/*	this file */
59 	unsigned char	a_machtype;	/* machine type */
60 	unsigned short	a_magic;	/* magic number */
61 #else
62 	unsigned int	a_magic;	/* magic number */
63 #endif
64 	unsigned int	a_text;		/* size of text segment */
65 	unsigned int	a_data;		/* size of initialized data */
66 	unsigned int	a_bss;		/* size of uninitialized data */
67 	unsigned int	a_syms;		/* size of symbol table */
68 	unsigned int	a_entry;	/* entry point */
69 	unsigned int	a_trsize;	/* size of text relocation */
70 	unsigned int	a_drsize;	/* size of data relocation */
71 };
72 
73 /*
74  * Macros for identifying an a.out format file.
75  */
76 #define	M_SPARC	3			/* runs only on SPARC */
77 #define	OMAGIC	0407			/* old impure format */
78 #define	NMAGIC	0410			/* read-only text */
79 #define	ZMAGIC	0413			/* demand load format */
80 
81 #define	N_BADMAG(x) \
82 	((x).a_magic != OMAGIC && (x).a_magic != NMAGIC && \
83 	(x).a_magic != ZMAGIC)
84 
85 /*
86  * Page size for a.out (used to overide machdep.h definition).
87  */
88 #ifndef	M_SEGSIZE
89 #define	M_SEGSIZE	0x2000		/* 8k */
90 #endif
91 
92 #endif	/* A_DOT_OUT_DOT_H */
93