Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

masm(CP)

ld(CP)

nm(CP)

strip(CP)

xlist(S)


     X.OUT(F)                                    UNIX System V



     Name
          x.out - format of XENIX link editor output


     Syntax
          #include <x.out.h>


     Description
          The output of the XENIX link editor,  called  the  x.out  or
          segmented   x.out   format,   is   defined   by   the  files
          /usr/include/x.out.h  and
          /usr/include/sys/relsym.h.
          The x.out file has the following general layout:

          1.   Header.

          2.   Extended header.

          3.   File segment table (for segmented formats).

          4.   Segments (Text, Data, Symbol, and Relocation).

          In the segmented format, there may be several text and  data
          segments,  depending  on  the  memory  model of the program.
          Segments within the  file  begin  on  boundaries  which  are
          multiplies of 512 bytes as defined by the file's pagesize.


     Format
          /*
           *   The main and extended header structures.
           *   For x.out segmented (XE_SEG):
           *       1) fields marked with (s) must contain sums of xs_psize for
           *     non-memory images, or xs_vsize for memory images.
           *       2) the contents of fields marked with (u) are undefined.
           */

          struct xexec {          /* x.out header */
            unsigned short x_magic;  /* magic number */
            unsigned short x_ext;    /* size of header extension */
            long    x_text;     /* size of text segment (s) */
            long    x_data;     /* size of initialized data (s) */
            long    x_bss;    /* size of uninitialized data (s) */
            long    x_syms;     /* size of symbol table (s) */
            long    x_reloc;  /* relocation table length (s) */
            long    x_entry;  /* entry point, machine dependent */
            char    x_cpu;    /* cpu type & byte/word order */
            char    x_relsym; /* relocation & symbol format (u) */
            unsigned short x_renv;   /* run-time environment */
          };


          struct xext {            /* x.out header extension */
            long    xe_trsize;     /* size of text relocation (s) */
            long    xe_drsize;     /* size of data relocation (s) */
            long    xe_tbase;   /* text relocation base (u) */
            long    xe_dbase;   /* data relocation base (u) */
            long    xe_stksize;    /* stack size (if XE_FS set) */
                    /* the following must be present if XE_SEG */
            long    xe_segpos;     /* segment table position */
            long    xe_segsize;    /* segment table size */
            long    xe_mdtpos;  /* machine dependent table position */
            long    xe_mdtsize; /* machine dependent table size */
            char    xe_mdttype; /* machine dependent table type */
            char    xe_pagesize;   /* file pagesize, in multiples of 512 */
            char    xe_ostype;     /* operating system type */
            char    xe_osvers;     /* operating system version */
            unsigned short xe_eseg;  /* entry segment, machine dependent */
            unsigned short xe_sres;  /* reserved */
          };


          struct xseg {           /* x.out segment table entry */
            unsigned short xs_type;  /* segment type */
            unsigned short xs_attr;  /* segment attributes */
            unsigned short xs_seg;   /* segment number */
            char    xs_align;   /* log base 2 of alignment */
            char    xs_cres;    /* unused */
            long    xs_filpos;     /* file position */
            long    xs_psize;   /* physical size (in file) */
            long    xs_vsize;   /* virtual size (in core) */
            long    xs_rbase;   /* relocation base address/offset */
            unsigned short xs_noff;  /* segment name string table offset */
            unsigned short xs_sres;  /* unused */
            long    xs_lres;    /* unused */
          };


          struct xiter {        /* x.out iteration record */
            long    xi_size;    /* source byte count */
            long    xi_rep;     /* replication count */
            long    xi_offset;  /* destination offset in segment */
          };

          struct xlist {           /* xlist structure for xlist(3). */
            unsigned short xl_type;  /* symbol type */
            unsigned short xl_seg;   /* file segment table index */
            long    xl_value;      /* symbol value */
            char    *xl_name;      /* pointer to asciz name */
          };

          struct aexec {        /* a.out header */
            unsigned short xa_magic;    /* magic number */
            unsigned short xa_text;     /* size of text segment */
            unsigned short xa_data;     /* size of initialized data */
            unsigned short xa_bss;   /* size of uninitialized data */
            unsigned short xa_syms;     /* size of symbol table */
            unsigned short xa_entry;    /* entry point */
            unsigned short xa_unused;   /* not used */
            unsigned short xa_flag;     /* relocation info stripped */
          };


          struct nlist {        /* nlist structure for nlist(3). */
            char    n_name[8];  /* symbol name */
            int     n_type;        /* type flag */
            unsigned  n_value;     /* value */
          };


          struct bexec {      /* b.out header */
            long xb_magic; /* magic number */
            long xb_text;  /* text segment size */
            long xb_data;  /* data segment size */
            long xb_bss; /* bss size */
            long xb_syms;  /* symbol table size */
            long xb_trsize;   /* text relocation table size */
            long xb_drsize;   /* data relocation table size */
            long xb_entry; /* entry point */
          };


     See Also
          masm(CP), ld(CP), nm(CP), strip(CP), xlist(S)


     Value Added
          x.out is an extension of AT&T System V provided by the Santa
          Cruz Operation.


     (printed 8/23/89)                                  X.OUT(F)

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