filehdr(4) — File Formats
NAME
filehdr − File header for object files
SYNOPSIS
#include < filehdr.h>
DESCRIPTION
Every object file begins with a header. The following C struct declaration is used:
struct filehdr
{
unsigned short f_magic; /∗ magic number ∗/
unsigned short f_nscns; /∗ number of sections ∗/
int f_timdat; /∗ time & date stamp ∗/
long f_symptr; /∗ file pointer to symbolic header ∗/
int f_nsyms; /∗ sizeof(symbolic header) ∗/
unsigned short f_opthdr; /∗ sizeof(optional header) ∗/
unsigned short f_flags; /∗ flags ∗/
};
f_symptr is the byte offset into the file at which the symbolic header can be found. Its value can be used as the offset in fseek(3) to position an I/O stream to the symbolic header. f_nsyms contains the size of the symbolic header. The valid magic numbers are given below:
#define ALPHAMAGIC0603 /∗ object file ∗/
#define ALPHAUMAGIC0617/∗ ucode object file ∗/
The value in f_timdat is obtained from the times(3) system call. Flag bits used in objects 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 ∗/