filehdr(FP) 6 January 1993 filehdr(FP) Name filehdr - file header for common object files Syntax #include <filehdr.h> Description Every common object file begins with a 20-byte header. The following C struct declaration is used: 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 ptr to symtab */ long f_nsyms ; /* # symtab entries */ unsigned short f_opthdr ; /* sizeof(opt hdr) */ unsigned short f_flags ; /* flags */ } ; fsymptr is the byte offset into the file at which the symbol table can be found. Its value can be used as the offset in fseek(S) to position an I/O stream to the symbol table. The UNIX system optional header is 28 bytes. The valid magic numbers are given below: #define I286SMAGIC 0512 /* 80286 computers-small model programs */ #define I286LMAGIC 0522 /* 80286 computers-large model programs */ #define I386MAGIC 0514 /* 80386 computers */ #define FBOMAGIC 0560 /* 3B2 and 3B15 computers */ #define N3BMAGIC 0550 /* 3B20 computer */ #define NTVMAGIC 0551 /* 3B20 computer */ #define VAXWRMAGIC 0570 /* VAX writable text segments */ #define VAXROMAGIC 0575 /* VAX read only sharable */ The value in ftimdat is obtained from the time(S) system call. Flag bits currently defined are: #define F_RELFLG 0000001 /* relocation entries stripped */ #define F_EXEC 0000002 /* file is executable */ #define F_LNNO 0000004 /* line numbers stripped */ #define F_LSYMS 0000010 /* local symbols stripped */ #define F_MINMAL 0000020 /* minimal object file */ #define F_UPDATE 0000040 /* update file, ogen produced */ #define F_SWABD 0000100 /* file is "pre-swabbed" */ #define F_AR16WR 0000200 /* 16-bit DEC host */ #define F_AR32WR 0000400 /* 32-bit DEC host */ #define F_AR32W 0001000 /* non-DEC host */ #define F_PATCH 0002000 /* "patch" list in opt hdr */ #define F_80186 010000 /* contains 80186 instructions */ #define F_80286 020000 /* contains 80286 instructions */ #define F_BM32ID 0160000 /* WE32000 family ID field */ #define F_BM32B 0020000 /* file contains WE 32100 code */ #define F_BM32MAU 0040000 /* file reqs MAU to execute */ #define F_BM32RST 0010000 /* this object file contains restore */ See also a.out(FP), fseek(S), time(S)