Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ filehdr(4) — GL1 W2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(2)

fseek(3S)

a.out(4)

FILEHDR(4)  —  Silicon Graphics not on PDP-11

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 always 36 bytes.  The valid magic numbers are given below:

#define N3BMAGIC 0550 /∗ 3B20S ∗/
#define NTVMAGIC 0551 /∗ 3B20S ∗/
#define VAXWRMAGIC 0570 /∗ VAX writable text segments ∗/
#define VAXROMAGIC 0575 /∗ VAX readonly sharable text segments ∗/

The value in f_timdat is obtained from the time(2) system call. Flag bits currently defined are:

#define F_RELFLG 00001 /∗ relocation entries stripped ∗/
#define F_EXEC 00002 /∗ file is executable ∗/
#define F_LNNO 00004 /∗ line numbers stripped ∗/
#define F_LSYMS 00010 /∗ local symbols stripped ∗/
#define F_MINMAL 00020 /∗ minimal object file ∗/
#define F_UPDATE 00040 /∗ update file, ogen produced ∗/
#define F_SWABD 00100 /∗ file is "pre-swabbed" ∗/
#define F_AR16WR 00200 /∗ 16 bit DEC host ∗/
#define F_AR32WR 00400 /∗ 32 bit DEC host ∗/
#define F_AR32W 01000 /∗ non-DEC host ∗/
#define F_PATCH 02000 /∗ "patch" list in opt hdr ∗/

SEE ALSO

time(2), fseek(3S), a.out(4). 

Version 2.1  —  January 02, 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026