xref: /onnv-gate/usr/src/cmd/sgs/include/a.out.h (revision 6223:30d6740da48d)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*6223Sab196087  * Common Development and Distribution License (the "License").
6*6223Sab196087  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*6223Sab196087  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*6223Sab196087  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifndef	A_DOT_OUT_DOT_H
290Sstevel@tonic-gate #define	A_DOT_OUT_DOT_H
300Sstevel@tonic-gate 
310Sstevel@tonic-gate struct exec {
320Sstevel@tonic-gate #ifdef	sun
330Sstevel@tonic-gate 	unsigned char	a_dynamic:1;	/* has a __DYNAMIC */
340Sstevel@tonic-gate 	unsigned char	a_toolversion:7; /* version of toolset used to create */
350Sstevel@tonic-gate 					/*	this file */
360Sstevel@tonic-gate 	unsigned char	a_machtype;	/* machine type */
370Sstevel@tonic-gate 	unsigned short	a_magic;	/* magic number */
380Sstevel@tonic-gate #else
390Sstevel@tonic-gate 	unsigned long	a_magic;	/* magic number */
400Sstevel@tonic-gate #endif
410Sstevel@tonic-gate 	unsigned long	a_text;		/* size of text segment */
420Sstevel@tonic-gate 	unsigned long	a_data;		/* size of initialized data */
430Sstevel@tonic-gate 	unsigned long	a_bss;		/* size of uninitialized data */
440Sstevel@tonic-gate 	unsigned long	a_syms;		/* size of symbol table */
450Sstevel@tonic-gate 	unsigned long	a_entry;	/* entry point */
460Sstevel@tonic-gate 	unsigned long	a_trsize;	/* size of text relocation */
470Sstevel@tonic-gate 	unsigned long	a_drsize;	/* size of data relocation */
480Sstevel@tonic-gate };
490Sstevel@tonic-gate 
500Sstevel@tonic-gate /*
51*6223Sab196087  * Version of struct exec intended to allow LP64 code to
52*6223Sab196087  * examine a 32-bit definition.
53*6223Sab196087  */
54*6223Sab196087 struct exec32 {
55*6223Sab196087 #ifdef	sun
56*6223Sab196087 	unsigned char	a_dynamic:1;	/* has a __DYNAMIC */
57*6223Sab196087 	unsigned char	a_toolversion:7; /* version of toolset used to create */
58*6223Sab196087 					/*	this file */
59*6223Sab196087 	unsigned char	a_machtype;	/* machine type */
60*6223Sab196087 	unsigned short	a_magic;	/* magic number */
61*6223Sab196087 #else
62*6223Sab196087 	unsigned int	a_magic;	/* magic number */
63*6223Sab196087 #endif
64*6223Sab196087 	unsigned int	a_text;		/* size of text segment */
65*6223Sab196087 	unsigned int	a_data;		/* size of initialized data */
66*6223Sab196087 	unsigned int	a_bss;		/* size of uninitialized data */
67*6223Sab196087 	unsigned int	a_syms;		/* size of symbol table */
68*6223Sab196087 	unsigned int	a_entry;	/* entry point */
69*6223Sab196087 	unsigned int	a_trsize;	/* size of text relocation */
70*6223Sab196087 	unsigned int	a_drsize;	/* size of data relocation */
71*6223Sab196087 };
72*6223Sab196087 
73*6223Sab196087 /*
740Sstevel@tonic-gate  * Macros for identifying an a.out format file.
750Sstevel@tonic-gate  */
760Sstevel@tonic-gate #define	M_SPARC	3			/* runs only on SPARC */
770Sstevel@tonic-gate #define	OMAGIC	0407			/* old impure format */
780Sstevel@tonic-gate #define	NMAGIC	0410			/* read-only text */
790Sstevel@tonic-gate #define	ZMAGIC	0413			/* demand load format */
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #define	N_BADMAG(x) \
820Sstevel@tonic-gate 	((x).a_magic != OMAGIC && (x).a_magic != NMAGIC && \
830Sstevel@tonic-gate 	(x).a_magic != ZMAGIC)
840Sstevel@tonic-gate 
850Sstevel@tonic-gate /*
860Sstevel@tonic-gate  * Page size for a.out (used to overide machdep.h definition).
870Sstevel@tonic-gate  */
880Sstevel@tonic-gate #ifndef	M_SEGSIZE
890Sstevel@tonic-gate #define	M_SEGSIZE	0x2000		/* 8k */
900Sstevel@tonic-gate #endif
910Sstevel@tonic-gate 
92*6223Sab196087 #endif	/* A_DOT_OUT_DOT_H */
93