home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
- *
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
- * SANTA CRUZ OPERATION INC.
- *
- * The copyright notice above does not evidence any actual or intended
- * publication of such source code.
- */
-
- #ident "@(#)sgs-head:i386/head/filehdr.h 1.25"
-
- #ifndef _FILEHDR_H
- #define _FILEHDR_H
-
- struct filehdr {
- unsigned short f_magic; /* magic number */
- unsigned short f_nscns; /* number of sections */
- long f_timdat; /* time & date stamp */
- long f_symptr; /* file pointer to symtab */
- long f_nsyms; /* number of symtab entries */
- unsigned short f_opthdr; /* sizeof(optional hdr) */
- unsigned short f_flags; /* flags */
- };
-
- /*
- * Bits for f_flags:
- *
- * F_RELFLG relocation info stripped from file
- * F_EXEC file is executable (i.e. no unresolved
- * externel references)
- * F_LNNO line nunbers stripped from file
- * F_LSYMS local symbols stripped from file
- * F_MINMAL this is a minimal object file (".m") output of fextract
- * F_UPDATE this is a fully bound update file, output of ogen
- * F_SWABD this file has had its bytes swabbed (in names)
- * F_AR16WR this file has the byte ordering of an AR16WR (e.g. 11/70) machine
- * (it was created there, or was produced by conv)
- * F_AR32W this file has the byte ordering of an AR32W machine (e.g. 3b,maxi)
- * F_PATCH file contains "patch" list in optional header
- * F_NODF (minimal file only) no decision functions for
- * replaced functions
- */
-
- #define F_RELFLG 0000001
- #define F_EXEC 0000002
- #define F_LNNO 0000004
- #define F_LSYMS 0000010
- #define F_MINMAL 0000020
- #define F_UPDATE 0000040
- #define F_SWABD 0000100
- #define F_AR16WR 0000200
- #define F_AR32WR 0000400
- #define F_AR32W 0001000
- #define F_PATCH 0002000
- #define F_NODF 0002000
-
- /*
- * BELLMAC-32 Identification field
- * F_BM32B file contains BM32B code (as opposed to strictly BM32A)
- * F_BM32MAU file requires MAU (math arith unit) to execute
- */
-
- #define F_BM32ID 0160000
- #define F_BM32MAU 0040000
- #define F_BM32B 0020000
-
- /* F_BM32RST file has RESTORE work-around */
-
- #define F_BM32RST 0010000
-
- /*
- * Flags for the INTEL chips. If the magic number of the object file
- * is IAPX16 or IAPX16TV or IAPX20 or IAPX20TV then if F_80186
- * is set, there are some 80186 instructions in the code, and hence
- * and 80186 or 80286 chip must be used to run the code.
- * If F_80286 is set, then the code has to be run on an 80286 chip.
- * And if neither are set, then the code can run on an 8086, 80186, or
- * 80286 chip.
- *
- */
-
- #define F_80186 010000
- #define F_80286 020000
-
- /*
- * Magic Numbers
- */
-
- /* iAPX - the stack frame and return registers differ from
- * Basic-16 and x86 C compilers, hence new magic numbers
- * are required. These are cross compilers.
- */
-
- /* Intel */
- #define IAPX16 0504
- #define IAPX16TV 0505
- #define IAPX20 0506
- #define IAPX20TV 0507
- /* 0514, 0516 and 0517 reserved for Intel */
-
- /* Basic-16 */
-
- #define B16MAGIC 0502
- #define BTVMAGIC 0503
-
-
- /* x86 */
-
- #define X86MAGIC 0510
- #define XTVMAGIC 0511
-
- /* Intel 286 */
- #define I286SMAGIC 0512
- #define I286LMAGIC 0522 /* used by mc68000 (UNIX PC) and iAPX 286 */
-
- /* Intel 386 */
-
- #define I386MAGIC 0514
-
-
- /* n3b */
- /*
- * NOTE: For New 3B, the old values of magic numbers
- * will be in the optional header in the structure
- * "aouthdr" (identical to old 3B aouthdr).
- */
- #define N3BMAGIC 0550 /* 3B20 executable, no TV */
- #define NTVMAGIC 0551 /* 3B20 executable with TV */
-
- /* MAC-32, 3B15, 3B5 */
-
- #define WE32MAGIC 0560 /* WE 32000, no TV */
- #define FBOMAGIC 0560 /* WE 32000, no TV */
- #define RBOMAGIC 0562 /* reserved for WE 32000 */
- #define MTVMAGIC 0561 /* WE 32000 with TV */
-
- /* VAX 11/780 and VAX 11/750 */
-
- /* writeable text segments */
- #define VAXWRMAGIC 0570
- /* readonly sharable text segments */
- #define VAXROMAGIC 0575
-
- /* Motorola 68020/68030/68040 */
- #define MC68MAGIC MC68MAGICV4
- #define MC68MAGICV4 03146 /* AT&T UNIX System V/68 4.0 */
- /* (UniSoft COFF binaries) */
- #define MC68MAGICV3 0554 /* UniSoft UNIX System V/68 3.2 */
-
- /* Motorola 88000 */
- #define MC88MAGIC 0555 /* M88000 normal file */
-
- /* IBM 370 */
- #define U370WRMAGIC 0530 /* writeble text segments */
- #define U370ROMAGIC 0535 /* readonly sharable text segments */
- /* 0532 and 0533 reserved for u370 */
-
- /* Amdahl 470/580 */
- #define AMDWRMAGIC 0531 /* writable text segments */
- #define AMDROMAGIC 0534 /* readonly sharable text segments */
-
- /* NSC */
- /* 0524 and 0525 reserved for NSC */
-
- /* Zilog */
- /* 0544 and 0545 reserved for Zilog */
- /* i860 */
- #define I860MAGIC 0515
-
- #define FILHDR struct filehdr
- #define FILHSZ sizeof(FILHDR)
-
- #define ISCOFF(x) \
- (((x)==B16MAGIC) || ((x)==BTVMAGIC) || ((x)==X86MAGIC) \
- || ((x)==XTVMAGIC) || ((x)==N3BMAGIC) || ((x)==NTVMAGIC) \
- || ((x)==FBOMAGIC) || ((x)==VAXROMAGIC) || ((x)==VAXWRMAGIC) \
- || ((x)==RBOMAGIC) || ((x)==MC68MAGICV3) \
- || ((x)==MC68MAGICV4) || ((x)==MC88MAGIC) \
- || ((x)==IAPX16) || ((x)==IAPX16TV) \
- || ((x)==IAPX20) || ((x)==IAPX20TV) \
- || ((x)==AMDWRMAGIC) || ((x)==AMDROMAGIC) \
- || ((x)==U370WRMAGIC) || ((x)==U370ROMAGIC) || ((x)==MTVMAGIC) \
- || ((x)==I286SMAGIC) || ((x)==I286LMAGIC) \
- || ((x)==I860MAGIC) \
- || ((x)==I386MAGIC))
-
- #endif /* _FILEHDR_H */
-