Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

A.OUT(5)
XENIX System V (1 ���ap� 1989)

���
a.out - �op�a� �a��a, �o�y�ae�o�o � pe�y���a�e pa�o�� �po�pa�� acce����po�a��� � pe�a��opa c���e�.

��������
A.out ����e�c� pe�y����py���� �a��o� �oc�e �a�ep�e��� pa�o�� �po�pa�� acce���epa masm � pe�a��opa c���e� ld. Ec�� � �po�ecce pa�o�� �a��o� �� ���x �po�pa�� �e ���� o��apy�e�� o����� ��� �eo�pe�e�e���e ��o�a����e �epe�e���e, �y�e� co��a� �a�� fa.out.

�op�a� �a��a a.out, �a���ae��� �a��e x.out ��� ce��e���po�a���� x.out, o�pe�e��e�c� �a��a�� /usr/include/a.out.h � /usr/include/sys/relsym.h. �a�� a.out ��ee� c�e�y���e oc�o���e �ac��:

  1. �a�o�o�o�
  2. �o�o����e����� �a�o�o�o�
  3. Ta����a ce��e��a �a��a (��� ce��e���po�a���x �op�a�o�)
  4. Ce��e��� (Te�c�, �a���e, c���o�� � c�e����� ��� �ac�po���)

B ce��e���po�a��o� �op�a�e �o�y� cy�ec��o�a�� �ec�o���o ce��e��o� �e�c�o� � �a���x, � �a��c��oc�� o� �o�e�� �a���� �po�pa���. Ce��e��� � �a��e �a���a��c� c a�peca, �pa��o�o pa��epy c�pa���� �a��a (512 �a��).

�OP�A�

     /*
     *Oc�o��o� � �o�o����e����� �a�o�o�o� c�py��yp.
     *��� ce��e��po�a��o�o �op�a�a x.out (XE_SEG):
     *    1)�o��, �ap��po�a���e (s) �o����
        *         co�ep�a�� cy��y �cex xs_psize,
                  ec�� o�pa� �axo���c� �a ��c�e
        *         ��� xs_vsize ��� o�pa�a �a����.
     *    2)co�ep���oe o��ac�e�, �ap��po�a���x
        *          (u) �eo�pe�e�e�o.
     */

struct xexec{         /*�a�o�o�o� x.out*/
  unsigned short x_magic; /*�a���ec�oe ��c�o*/
  unsigned short x_ext;    /*pa��ep �o�o����e���o�o
                                  �a�o�o��a*/
  long    X-Text;             /*pa��ep ce��e��a �e�c�a (s)*/
  long    x_data;             /*pa��ep �����a����po�a���x
                            �a���x (s)*/
  long    x_bss;              /*pa��ep �e�����a����po�a���x
                   �a���x (s)*/
  long    syms;               /*pa��ep �a����� c���o�o� (s)*/
  long    x_reloc;    /*����a �a����� �epe�e�e��� (s)*/
  long    x_entry;    /*�a����o �a��c��a� �o��a �xo�a*/
  char    x_cpu;              /*��� �po�eccopa � �op��o� �a��/c�o�o*/
  char    x_relsym;   /*�op�� �epe�e�e��� � c���o�o� (u)*/
  unsigned short x_renv;  /* cpe�a ���o��e���*/
};


struct xext {         /* �o�o����e����� �a�o�o�o� x.out  */
  long    xe_trsize;       /* pa��ep �a����� �epe�e�e��� �e�c�a (s) */
  long    xe_drsize;       /* pa��ep �a����� �epe�e�e��� �a���x (s) */
  long    xe_tbase;   /* �a�a �epe�e�ae�o�o �e�c�a(u) */
  long    xe_dbase;   /* �a�a �epe�e�ae��x �a���x(u) */
  long    xe_stksize;      /* pa��ep c�e�a
                           (ec�� XE_FS yc�a�o��e�)     */

/* c�e�y���e �a�ee ��e�e��� �o���� ���� �pe�c�a��e��
   ec�� XE_SEG yc�a�o��e� */

  long    xe_segpos;       /* �o�o�e��e �a����� ce��e��o� */
  long    xe_segsize;      /* pa��ep �a����� ce��e��o� */
  long    xe_mdtpos;       /* �a����o �a��c��oe �o�o�e��e */
  long    xe_mdtsize;       /* �a����o �a��c���� pa��ep �a����� */
  char    xe_mdttype;       /* �a����o �a��c���� ��� �a����� */
  char    xe_pagesize;     /* pa��ep c�pa���� �a��a, �pa��oe 512 */
  char    xe_ostype;        /* ��� o�epa��o��o� c�c�e�� */
  char    xe_osvers;        /* �epc�� o�epa��o��o� c�c�e�� */
  unsigned short xe_eseg;  /*ce��e�� �xo�a, �a��c����
                           o� a��apa�yp� */
  unsigned short xe_sres;  /* pe�ep��po�a� */
};



struct xseg {          /* �a����a ce��e��o� x.out  */
  unsigned short xs_type;  /*��� ce��e��a */
  unsigned short xs_attr;  /*a�p��y�� ce��e��a */
  unsigned short xs_seg;   /*�o�ep ce��e��a */
  char    xs_align;    /* �o�ap��� �o oc�o�a��� 2
                              o� ��pa����a��� */
  char    xs_cres;     /* �e�c�o���ye�c�*/
  long    xs_filpos;        /* �o�o�e��e �a��a */
  long    xs_psize;    /* �����ec��� pa��ep (� �a��e) */
  long    xs_vsize;    /* ��p�ya����� pa��ep (in core) */
  long    xs_rbase;    /* a�pec/c�e�e��e �a�� �epe�e�e��� */
  unsigned short xs_noff;  /* c�e�e��e �o ��e�� ce����a � �a����e ce��e��o�
                              ce��e��a */
  unsigned short xs_sres;  /* �e�c�o���ye�c�*/
  long    xs_lres;     /* �e�c�o���ye�c� */
};

struct xiter {            /* �a��c� �o��ope��� x.out  */
  long    xi_size;     /* source byte count */
  long    xi_rep;      /* replication count */
  long    xi_offset;        /* destination offset in segment */
};

struct xlist {            /* xlist c�py��ypa ��� xlist(3). */
  unsigned short xl_type;  /* ��� c���o�a */
  unsigned short xl_seg;   /* ���e�c �a����� ce��e��a �a��a */
  long    xl_value;    /* �e�����a c���o�a */
  char    *xl_name;    /* y�a�a�e�� �a ���, o�pa���e��oe �y�e� */
};

struct aexec { /* �a�o�o�o� a.out */
  unsigned short xa_magic;    /* �a���ec�oe ��c�o */
  unsigned short xa_text;     /* pa��ep ce��e��a �e�c�a*/
  unsigned short xa_data;     /* pa��ep �����a����po�a���x �a���x */
  unsigned short xa_bss;        /* pa��ep �e�����a����po�a���x �a���x */
  unsigned short xa_syms;     /* pa��ep �a����� c���o�o� */
  unsigned short xa_entry;    /* �o��a �xo�a */
  unsigned short xa_unused;   /* �e �c�o���ye�c� */
  unsigned short xa_flag;     /* ��a� o�cy�c��� �a����� ��e� */
};


struct nlist {                 /* nlist c�py��ypa ��� nlist(3). */
  char    n_name[8];             /* ��� c���o�a */
  int         n_type;            /* ��a� ���a*/
  unsigned  n_value;             /* �e�����a */
};

struct bexec {                  /* �a�o�o�o� b.out */
  long xb_magic;                /* �a���ec�oe ��c�o */
  long xb_text;                 /* pa��ep ce��e��a �e�c�a*/
  long xb_data;                 /* pa��ep ce��e��a �a���x*/
  long xb_bss;                  /* pa��ep �e�����a����po�a���x �a���x */
  long xb_syms;                 /* pa��ep �a����� c���o�o�*/
  long xb_trsize;               /* pa��ep �a����� �epe�e�e���
                                   �e�c�a*/
  long xb_drsize;               /* pa��ep �a����� �epe�e�e���
                                   �a���x*/
  long xb_entry;                /* �o��a �xo�a*/
};

��. �����
masm(1), ld(1), nm(1), strip(1), xlist(1).
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT