#sccs "@(#)inchead:filehdr.h 1.3" 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 * F_FPU 3 bits which encode fp type * F_CPU 2 bits which encode processor type */ #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 /* * F_CPU takes up bits 04000 + 010000 */ #define F_CPU 0004000 /* * F_FPU takes up bits 0100000 + 040000 + 020000 */ #define F_FPU 0020000 /* * each is an enumeration which contain the vlue held in F_FPU and F_CPU * the default values are setup for * backward compatiablity(ie 0's imply 68010/no flt code ) * empty enumerations leave for 2 new CPU types and 4 FPU types */ /* for F_CPU */ #define F_M68010 0 #define F_M68020 1 /* for F_FPU */ #define F_NOFPU 0 #define F_SOFT 1 #define F_M68881 2 #define F_SKY 4 /* * macros used to set/access F_FPU/F_CPU bits */ #define SETFPU(t, v) t = ((t)&~(07<<13))|(((v)&07)<<13) #define SETCPU(t, v) t = ((t)&~(03<<11))|(((v)&03)<<11) #define GETFPU(t) (((t)>>13)&07) #define GETCPU(t) (((t)>>11)&03) /* * Magic Numbers */ /* Basic-16 */ #define B16MAGIC 0502 #define BTVMAGIC 0503 /* x86 */ #define X86MAGIC 0510 #define XTVMAGIC 0511 /* 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 #define NTVMAGIC 0551 /* XL */ #define XLMAGIC 0540 /* MAC-32 3b-5 */ #define FBOMAGIC 0560 #define M80MAGIC 0560 #define RBOMAGIC 0562 #define MTVMAGIC 0561 /* VAX 11/780 and VAX 11/750 */ /* writeable text segments */ #define VAXWRMAGIC 0570 /* readonly sharable text segments */ #define VAXROMAGIC 0575 /* Motorola 68000/68008/68010/68020 */ #define MC68KWRMAGIC 0520 /* writeable text segments */ #define MC68KROMAGIC 0521 /* readonly shareable text segments */ #define MC68KPGMAGIC 0522 /* demand paged text segments */ /* IBM 370 */ #define U370WRMAGIC 0530 /* writeble text segments */ #define U370ROMAGIC 0535 /* readonly sharable text segments */ #define FILHDR struct filehdr #define FILHSZ sizeof(FILHDR)