Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ filehdr(4) — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(2)

fseek(3S)

a.out(4)



FILEHDR(4)          RISC/os Reference Manual           FILEHDR(4)



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:

          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 pointer to symbolic header */
                  long            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 sym-
     bolic header can be found.  Its value can be used as the
     offset in fseek(3S) to position an I/O stream to the sym-
     bolic header.  The RISC/os system optional header is 56-
     bytes.  The valid magic numbers are given below:

          #define MIPSEBMAGIC       0x0160  /* objects for MIPS big-endian machines */
          #define MIPSELMAGIC       0x0162  /* objects for MIPS little-endian machines */
          #define MIPSEBUMAGIC      0x0180  /* ucode objects for MIPS big-endian machines */
          #define MIPSELUMAGIC      0x0182  /* 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:

          #define SMIPSEBMAGIC      0x6001
          #define SMIPSELMAGIC      0x6201

     The value in f_timdat is obtained from the time(2) system
     call.  Flag bits used in MIPS 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 */

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





                        Printed 11/19/92                   Page 1



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