
/*
 ******************************************************************************
 *                        Copyright (c) 1985 AT&T                             *
 *                          All Rights Reserved                               *
 *                                                                            *
 *                                                                            *
 *         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T                *
 *       The copyright notice above does not evidence any actual              *
 *       or intended publication of such source code.                         *
 ******************************************************************************
 */

/*
 ******************************************************************************
 *			Modification history:				      *
 *									      *
 *	15/10/90	Addition of new MAGIC number to account for SF	      *
 *			architecture.					      *
 ******************************************************************************
 */

/*
 * @(#)filehdr.h	1.1 (National Semiconductor) 8/6/87 11:57:20
 * @(#) copyrights and other release restrictions may apply
 */

/*
 * static char ID_filhdrh[] = "inc/common/filehdr.h: 1.4 1/19/83";
 */

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_AR32WR	this file has the byte ordering of an AR32WR machine(e.g. vax)
 *	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
#define	 F_RESERVED		0020000
#define  F_STE          00000020  /* size of symbol table entry  */


#define FILHDR          struct filehdr
#define FILHSZ          sizeof(FILHDR)

/*
 * NS32000 magic numbers
 */
#define NS32GMAGIC      0524  /* kernel load by section header       */
#define NS32SMAGIC      0525  /* for modularity                      */
#define NS64EMAGIC	0526  /* For National SF architectures	     */
			      /* in embedded applications.	     */

#define NS32WRMAGIC NS32GMAGIC
#define NS32ROMAGIC NS32GMAGIC
#define NS32MDMAGIC NS32SMAGIC
#define	NS64SFMAGIC NS64EMAGIC

/*
 * For NSC, switch VAX definitions so that source files need not be modified
 */

#ifdef  VAXWRMAGIC
#undef  VAXWRMAGIC
#endif
#ifdef  VAXROMAGIC
#undef  VAXROMAGIC
#endif

#define VAXWRMAGIC NS32GMAGIC
#define VAXROMAGIC NS32GMAGIC

#define ISMAGIC(x)    ((((unsigned short)(x))==(unsigned short)NS32GMAGIC) || \
		       (((unsigned short)(x))==(unsigned short)NS32SMAGIC) || \
		       (((unsigned short)(x))==(unsigned short)NS64EMAGIC))


#define ISCOFF(x) \
	      (((x)==NS32GMAGIC) || ((x)==NS32SMAGIC) || ((x)==NS64EMAGIC))
/* The #define for ISARCHIVE and BADMAGIC has been moved to "ldfcn.h"  */

