filehdr(4)
NAME
filehdr − file header for common object files
SYNOPSIS
#include <filehdr.h>
DESCRIPTION
Every common object file begins with a 20-byte header. The following C struct declaration is used:
structfilehdr
{
unsigned shortf_magic ; /∗ magic number ∗/
unsigned shortf_nscns ; /∗ number of sections ∗/
longf_timdat ;/∗ time & date stamp ∗/
longf_symptr ; /∗ file ptr to symtab ∗/
longf_nsyms ;/∗ # symtab entries ∗/
unsigned shortf_opthdr ; /∗ sizeof(opt hdr) ∗/
unsigned shortf_flags ; /∗ flags ∗/
} ;
F_symptr 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(3S) 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 FBOMAGIC0560/∗ 3B2 and 3B5 computers ∗/
#define N3BMAGIC0550/∗ 3B20 computer ∗/
#define NTVMAGIC0551/∗ 3B20 computer ∗/
#define VAXWRMAGIC0570 /∗ VAX writable text segments ∗/
#define VAXROMAGIC0575 /∗ VAX read only sharable
text segments ∗/
#define HCXWRMAGIC0570 /∗ HCX writable text segments ∗/
#define HCXROMAGIC0575 /∗ HCX read only sharable
text segments ∗/
#define GCXWRMAGIC0520 /∗ GCX writable text segments ∗/
#define GCXROMAGIC0521 /∗ GCX read only sharable
text segments ∗/
#define M88KWRMAGIC0554 /∗ M88K writable text segments ∗/
#define M88KROMAGIC0555 /∗ M88K read only sharable
text segments ∗/
The value in f_timdat is obtained from the time(2) system call. Flag bits currently defined are:
#define F_RELFLG0000001 /∗ relocation entries stripped ∗/
#define F_EXEC0000002/∗ file is executable ∗/
#define F_LNNO0000004/∗ line numbers stripped ∗/
#define F_LSYMS0000010/∗ local symbols stripped ∗/
#define F_MINMAL0000020 /∗ minimal object file ∗/
#define F_UPDATE0000040 /∗ update file, ogen produced ∗/
#define F_SWABD0000100/∗ file is "pre-swabbed" ∗/
#define F_AR16WR0000200 /∗ 16-bit DEC host ∗/
#define F_AR32WR0000400 /∗ 32-bit DEC host ∗/
#define F_AR32W0001000/∗ non-DEC host ∗/
#define F_PATCH0002000/∗ "patch" list in opt hdr ∗/
SEE ALSO
CX/UX Programmer’s Reference Manual