FILEHDR(5) — NEWS-OS Programmer’s Manual
NAME
filehdr − file header for MIPS object files
SYNOPSIS
#include < filehdr.h>
DESCRIPTION
Every MIPS 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 pointer to symbolic header ∗/
longf_nsyms;/∗ sizeof(symbolic header) ∗/
unsigned shortf_opthdr;/∗ sizeof(optional header) ∗/
unsigned shortf_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(3S) to position an I/O stream to the symbolic header. The NEWS-OS system optional header is 56-bytes. The valid magic numbers are given below:
#defineMIPSEBMAGIC0x0160/∗ objects for MIPS big-endian machines ∗/
#defineMIPSELMAGIC0x0162/∗ objects for MIPS little-endian machines ∗/
#defineMIPSEBUMAGIC0x0180/∗ ucode objects for MIPS big-endian machines ∗/
#defineMIPSELUMAGIC0x0182/∗ ucode objects for MIPS little-endian machines ∗/
MIPS object files can be loaded and examined on machines differing from the object’s target byte sex. Therefore, for object file magic numbers, the byte swapped values have define constants associated with them:
#defineSMIPSEBMAGIC0x6001
#defineSMIPSELMAGIC0x6201
The value in f_timdat is obtained from the time(2) system call. Flag bits used in MIPS objects are:
#defineF_RELFLG0000001/∗ relocation entries stripped ∗/
#defineF_EXEC0000002/∗ file is executable ∗/
#defineF_LNNO0000004/∗ line numbers stripped ∗/
#defineF_LSYMS0000010/∗ local symbols stripped ∗/
SEE ALSO
NEWS-OSRelease 4.2.1R