1:         /*	%M%	%I%	%E%	*/
   2: /*
   3:  * Header prepended to each a.out file.
   4:  */
   5: struct exec {
   6:     long    a_magic;    /* magic number */
   7: unsigned long   a_text;     /* size of text segment */
   8: unsigned long   a_data;     /* size of initialized data */
   9: unsigned long   a_bss;      /* size of uninitialized data */
  10: unsigned long   a_syms;     /* size of symbol table */
  11: unsigned long   a_trsize;   /* size of text relocation */
  12: unsigned long   a_drsize;   /* size of data relocation */
  13: unsigned long   a_entry;    /* entry point */
  14: };
  15: 
  16: #define OMAGIC  0407        /* old impure format */
  17: #define NMAGIC  0410        /* read-only text */
  18: #define ZMAGIC  0413        /* demand load format */
  19: 
  20: /*
  21:  * Macros which take exec structures as arguments and tell whether
  22:  * the file has a reasonable magic number or offsets to text|symbols|strings.
  23:  */
  24: #define N_BADMAG(x) \
  25:     (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
  26: 
  27: #define N_TXTOFF(x) \
  28:     ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec))
  29: #define N_SYMOFF(x) \
  30:     (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize)
  31: #include <a.out.h>

Defined struct's

exec defined in line 5; never used

Defined macros

NMAGIC defined in line 17; used 1 times
  • in line 25
N_BADMAG defined in line 24; never used
N_SYMOFF defined in line 29; never used
N_TXTOFF defined in line 27; used 1 times
  • in line 30
OMAGIC defined in line 16; used 1 times
  • in line 25
ZMAGIC defined in line 18; used 2 times
Last modified: 1985-08-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 693
Valid CSS Valid XHTML 1.0 Strict