xref: /illumos-gate/usr/src/cmd/strings/a.out.h (revision 2a8bcb4e)
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 /*
34  *	<a.out.h> - Object file structure declarations.
35  */
36 
37 struct aexec {				/* a.out header */
38 	unsigned short	xa_magic;	/* magic number */
39 	unsigned short	xa_text;	/* size of text segment */
40 	unsigned short	xa_data;	/* size of initialized data */
41 	unsigned short	xa_bss;		/* size of unitialized data */
42 	unsigned short	xa_syms;	/* size of symbol table */
43 	unsigned short	xa_entry;	/* entry point */
44 	unsigned short	xa_unused;	/* not used */
45 	unsigned short	xa_flag;	/* relocation info stripped */
46 };
47 
48 
49 /*
50  *	Definitions for aexec.xa_magic, OCTAL, obsolete (short).
51  */
52 
53 #define	FMAGIC		0407	/* normal */
54 #define	NMAGIC		0410	/* pure, shared text */
55 #define	IMAGIC		0411	/* separate I & D */
56 #define	OMAGIC		0405	/* text overlays */
57 #define	ZMAGIC		0413	/* demand load format */
58 
59 #define	A_MAGIC1	FMAGIC
60 #define	A_MAGIC2	NMAGIC
61 #define	A_MAGIC3	IMAGIC
62 #define	A_MAGIC4	OMAGIC
63 
64 #define	ATEXTPOS(ap)	((long)sizeof (struct aexec))
65 #define	ADATAPOS(ap)	(ATEXTPOS(ap) + (long)(ap)->xa_text)
66 #define	ARTEXTPOS(ap)	(ADATAPOS(ap) + (long)(ap)->xa_data)
67 #define	ARDATAPOS(ap)	(ARTEXTPOS(ap) + ((long)\
68 	((ap)->xa_flag? 0 : (ap)->xa_text)))
69 #define	ASYMPOS(ap)	(ATEXTPOS(ap) + \
70 	(((ap)->xa_flag? 1L : 2L) * \
71 	((long)(ap)->xa_text + (long)(ap)->xa_data)))
72 #define	AENDPOS(ap)	(ASYMPOS(ap) + (long)(ap)->xa_syms)
73