home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / include / aout / hp300hpux.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  3.6 KB  |  105 lines

  1. /* Special version of <a.out.h> for use under hp-ux.
  2.    Copyright (C) 1988,1993 Free Software Foundation, Inc. */
  3.  
  4. struct hp300hpux_exec_bytes
  5. {
  6.   unsigned char e_info[4];   /* a_machtype/a_magic */
  7.   unsigned char e_spare1[4];
  8.   unsigned char e_spare2[4];
  9.   unsigned char e_text[4];   /* length of text, in bytes */
  10.   unsigned char e_data[4];   /* length of data, in bytes */
  11.   unsigned char e_bss[4];    /* length of uninitialized data area , in bytes */
  12.   unsigned char e_trsize[4]; /* length of relocation info for text, in bytes*/
  13.   unsigned char e_drsize[4]; /* length of relocation info for data, in bytes*/
  14.   unsigned char e_passize[4];/* HP = pascal interface size */
  15.   unsigned char e_syms[4];   /* HP = symbol table size */
  16.   unsigned char e_spare5[4]; /* HP = debug name table size */
  17.   unsigned char e_entry[4];  /* start address */
  18.   unsigned char e_spare6[4]; /* HP = source line table size */
  19.   unsigned char e_supsize[4];/* HP = value table size */
  20.   unsigned char e_drelocs[4];
  21.   unsigned char e_extension[4]; /* file offset of extension */
  22. };
  23. #define    EXEC_BYTES_SIZE    64
  24.  
  25. struct hp300hpux_nlist_bytes
  26.   {
  27.     unsigned char e_value[4];
  28.     unsigned char e_type[1];
  29.     unsigned char e_length[1];    /* length of ascii symbol name */
  30.     unsigned char e_almod[2];    /* alignment mod */
  31.     unsigned char e_shlib[2];   /* info about dynamic linking */
  32.   };
  33. #define EXTERNAL_NLIST_SIZE 10
  34.  
  35. struct hp300hpux_reloc
  36.   {
  37.     unsigned char r_address[4];/* offset of of data to relocate */
  38.     unsigned char r_index[2];  /* symbol table index of symbol         */
  39.     unsigned char r_type[1];   /* relocation type                      */
  40.     unsigned char r_length[1]; /* length of item to reloc              */
  41.   };
  42.  
  43. struct hp300hpux_header_extension
  44. {
  45.     unsigned char e_syms[4];
  46.     unsigned char unique_headers[12*4];
  47.     unsigned char e_header[2];   /* type of header */
  48.     unsigned char e_version[2];  /* version        */
  49.     unsigned char e_size[4];     /* bytes following*/
  50.     unsigned char e_extension[4];/* file offset of next extension */
  51. };
  52. #define EXTERNAL_EXTENSION_HEADER_SIZE (16*4)
  53.  
  54. #define OMAGIC 0x106
  55. #define NMAGIC 0x107
  56. #define ZMAGIC 0x10B
  57. #define SHAREMAGIC 0x108
  58.  
  59. #if 0 /* libaout.h only uses the lower 8 bits */
  60. #define HP98x6_ID 0x20A
  61. #define HP9000S200_ID 0x20C
  62. #endif
  63. #define HP98x6_ID 0x0A
  64. #define HP9000S200_ID 0x0C
  65.  
  66. #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
  67.  
  68. #define _N_BADMACH(x)                                                   \
  69. (((N_MACHTYPE (x)) != HP9000S200_ID) &&                                 \
  70.  ((N_MACHTYPE (x)) != HP98x6_ID))
  71.  
  72. #define _N_BADMAG(x)      (N_MAGIC(x) != OMAGIC        \
  73.             && N_MAGIC(x) != NMAGIC        \
  74.               && N_MAGIC(x) != ZMAGIC         \
  75.                         && N_MAGIC(x) != SHAREMAGIC)
  76.  
  77. #undef _N_HDROFF
  78. #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
  79.  
  80. #undef N_DATOFF
  81. #undef N_PASOFF
  82. #undef N_SYMOFF
  83. #undef N_SUPOFF
  84. #undef N_TRELOFF
  85. #undef N_DRELOFF
  86. #undef N_STROFF
  87.  
  88. #define N_DATOFF(x)    ( N_TXTOFF(x) + N_TXTSIZE(x) )
  89. #define N_PASOFF(x)     ( N_DATOFF(x) + (x).a_data)
  90. #define N_SYMOFF(x)    ( N_PASOFF(x)   /* + (x).a_passize*/ )
  91. #define N_SUPOFF(x)     ( N_SYMOFF(x) + (x).a_syms )
  92. #define N_TRELOFF(x)    ( N_SUPOFF(x)    /* + 0 (x).a_supsize*/ )
  93. #define N_DRELOFF(x)    ( N_TRELOFF(x) + (x).a_trsize )
  94. #define N_EXTHOFF(x)    ( N_DRELOFF(x)   /*  + 0 (x).a_drsize */)
  95. #define N_STROFF(x)    ( 0 /* no string table */ )
  96.  
  97. /* use these when the file has gnu symbol tables */
  98. #define N_GNU_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
  99. #define N_GNU_DRELOFF(x) (N_GNU_TRELOFF(x) + (x).a_trsize)
  100. #define N_GNU_SYMOFF(x)  (N_GNU_DRELOFF(x) + (x).a_drsize)
  101.  
  102. #define PAGE_SIZE 0x1000
  103. #define SEGMENT_SIZE 0x1000
  104. #define TEXT_START_ADDR 0
  105.