xref: /titanic_52/usr/src/cmd/strings/a.out.h (revision 9e39c5ba00a55fa05777cc94b148296af305e135)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*	Copyright (c) 1987, 1988 Microsoft Corporation	*/
31 /*	  All Rights Reserved	*/
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 /*
36  *	<a.out.h> - Object file structure declarations.
37  */
38 
39 struct aexec {				/* a.out header */
40 	unsigned short	xa_magic;	/* magic number */
41 	unsigned short	xa_text;	/* size of text segment */
42 	unsigned short	xa_data;	/* size of initialized data */
43 	unsigned short	xa_bss;		/* size of unitialized data */
44 	unsigned short	xa_syms;	/* size of symbol table */
45 	unsigned short	xa_entry;	/* entry point */
46 	unsigned short	xa_unused;	/* not used */
47 	unsigned short	xa_flag;	/* relocation info stripped */
48 };
49 
50 
51 /*
52  *	Definitions for aexec.xa_magic, OCTAL, obsolete (short).
53  */
54 
55 #define	FMAGIC		0407	/* normal */
56 #define	NMAGIC		0410	/* pure, shared text */
57 #define	IMAGIC		0411	/* separate I & D */
58 #define	OMAGIC		0405	/* text overlays */
59 #define	ZMAGIC		0413	/* demand load format */
60 
61 #define	A_MAGIC1	FMAGIC
62 #define	A_MAGIC2	NMAGIC
63 #define	A_MAGIC3	IMAGIC
64 #define	A_MAGIC4	OMAGIC
65 
66 #define	ATEXTPOS(ap)	((long)sizeof (struct aexec))
67 #define	ADATAPOS(ap)	(ATEXTPOS(ap) + (long)(ap)->xa_text)
68 #define	ARTEXTPOS(ap)	(ADATAPOS(ap) + (long)(ap)->xa_data)
69 #define	ARDATAPOS(ap)	(ARTEXTPOS(ap) + ((long)\
70 	((ap)->xa_flag? 0 : (ap)->xa_text)))
71 #define	ASYMPOS(ap)	(ATEXTPOS(ap) + \
72 	(((ap)->xa_flag? 1L : 2L) * \
73 	((long)(ap)->xa_text + (long)(ap)->xa_data)))
74 #define	AENDPOS(ap)	(ASYMPOS(ap) + (long)(ap)->xa_syms)
75