day4- リンカースクリプト a.out再び

a.out形式実行ファイルは歴史的にOMAGIC,NMAGIC,ZMAGIC,QMAGICの順番に進化。

ファイルヘッダーは32バイトからなる(各バージョンにおいてもみんな共通らしい)

/usr/include/a.out.hから

struct exec
{
  unsigned long a_info; /* Use macros N_MAGIC, etc for access.  */
  unsigned int a_text;  /* Length of text, in bytes.  */
  unsigned int a_data;  /* Length of data, in bytes.  */
  unsigned int a_bss;   /* Length of uninitialized data area for file, in bytes.  */
  unsigned int a_syms;  /* Length of symbol table data in file, in bytes.  */
  unsigned int a_entry; /* Start address.  */
  unsigned int a_trsize;/* Length of relocation info for text, in bytes.  */
  unsigned int a_drsize;/* Length of relocation info for data, in bytes.  */
};