Back to index

cell-binutils  2.17cvs20070401
hp300hpux.h
Go to the documentation of this file.
00001 /* Special version of <a.out.h> for use under hp-ux.
00002    Copyright 1988, 1993, 1995, 2001 Free Software Foundation, Inc. */
00003 
00004 struct hp300hpux_exec_bytes
00005 {
00006   unsigned char e_info[4];   /* a_machtype/a_magic */
00007   unsigned char e_spare1[4];
00008   unsigned char e_spare2[4];
00009   unsigned char e_text[4];   /* length of text, in bytes */
00010   unsigned char e_data[4];   /* length of data, in bytes */
00011   unsigned char e_bss[4];    /* length of uninitialized data area , in bytes */
00012   unsigned char e_trsize[4]; /* length of relocation info for text, in bytes*/
00013   unsigned char e_drsize[4]; /* length of relocation info for data, in bytes*/
00014   unsigned char e_passize[4];/* HP = pascal interface size */
00015   unsigned char e_syms[4];   /* HP = symbol table size */
00016   unsigned char e_spare5[4]; /* HP = debug name table size */
00017   unsigned char e_entry[4];  /* start address */
00018   unsigned char e_spare6[4]; /* HP = source line table size */
00019   unsigned char e_supsize[4];/* HP = value table size */
00020   unsigned char e_drelocs[4];
00021   unsigned char e_extension[4]; /* file offset of extension */
00022 };
00023 #define       EXEC_BYTES_SIZE      64
00024 
00025 struct hp300hpux_nlist_bytes
00026   {
00027     unsigned char e_value[4];
00028     unsigned char e_type[1];
00029     unsigned char e_length[1];     /* length of ascii symbol name */
00030     unsigned char e_almod[2];      /* alignment mod */
00031     unsigned char e_shlib[2];   /* info about dynamic linking */
00032   };
00033 #define EXTERNAL_NLIST_SIZE 10
00034 
00035 struct hp300hpux_reloc
00036   {
00037     unsigned char r_address[4];/* offset of of data to relocate */
00038     unsigned char r_index[2];  /* symbol table index of symbol         */
00039     unsigned char r_type[1];   /* relocation type                      */
00040     unsigned char r_length[1]; /* length of item to reloc              */
00041   };
00042 
00043 struct hp300hpux_header_extension
00044 {
00045     unsigned char e_syms[4];
00046     unsigned char unique_headers[12*4];
00047     unsigned char e_header[2];   /* type of header */
00048     unsigned char e_version[2];  /* version        */
00049     unsigned char e_size[4];     /* bytes following*/
00050     unsigned char e_extension[4];/* file offset of next extension */
00051 };
00052 #define EXTERNAL_EXTENSION_HEADER_SIZE (16*4)
00053 
00054 /* hpux separates object files (0x106) and impure executables (0x107)  */
00055 /* but the bfd code does not distinguish between them. Since we want to*/
00056 /* read hpux .o files, we add an special define and use it below in    */
00057 /* offset and address calculations.                                    */
00058 
00059 #define HPUX_DOT_O_MAGIC 0x106
00060 #define OMAGIC 0x107       /* object file or impure executable.  */
00061 #define NMAGIC 0x108       /* Code indicating pure executable.   */
00062 #define ZMAGIC 0x10B       /* demand-paged executable.           */
00063 
00064 #define N_HEADER_IN_TEXT(x) 0
00065 
00066 #if 0 /* libaout.h only uses the lower 8 bits */
00067 #define HP98x6_ID 0x20A
00068 #define HP9000S200_ID 0x20C
00069 #endif
00070 #define HP98x6_ID 0x0A
00071 #define HP9000S200_ID 0x0C
00072 
00073 #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
00074 
00075 #define N_DATADDR(x) \
00076   ((N_MAGIC (x) == OMAGIC || N_MAGIC (x) == HPUX_DOT_O_MAGIC)         \
00077    ? (N_TXTADDR (x) + N_TXTSIZE (x))                                  \
00078    : (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1)            \
00079                      & ~ (bfd_vma) (N_SEGSIZE (x) - 1))))
00080 
00081 #define _N_BADMACH(x) \
00082   (((N_MACHTYPE (x)) != HP9000S200_ID) && ((N_MACHTYPE (x)) != HP98x6_ID))
00083 
00084 #define _N_BADMAG(x)   (N_MAGIC(x) != HPUX_DOT_O_MAGIC \
00085                         && N_MAGIC(x) != OMAGIC         \
00086                      && N_MAGIC(x) != NMAGIC            \
00087                      && N_MAGIC(x) != ZMAGIC )
00088 
00089 #undef _N_HDROFF
00090 #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
00091 
00092 #undef N_DATOFF
00093 #undef N_PASOFF
00094 #undef N_SYMOFF
00095 #undef N_SUPOFF
00096 #undef N_TRELOFF
00097 #undef N_DRELOFF
00098 #undef N_STROFF
00099 
00100 #define N_DATOFF(x)  ( N_TXTOFF(x) + N_TXTSIZE(x) )
00101 #define N_PASOFF(x)     ( N_DATOFF(x) + (x).a_data)
00102 #define N_SYMOFF(x)  ( N_PASOFF(x)   /* + (x).a_passize*/ )
00103 #define N_SUPOFF(x)     ( N_SYMOFF(x) + (x).a_syms )
00104 #define N_TRELOFF(x) ( N_SUPOFF(x)    /* + 0 (x).a_supsize*/ )
00105 #define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
00106 #define N_EXTHOFF(x)    ( N_DRELOFF(x)   /*  + 0 (x).a_drsize */)
00107 #define N_STROFF(x)  ( 0 /* no string table */ )
00108 
00109 /* use these when the file has gnu symbol tables */
00110 #define N_GNU_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
00111 #define N_GNU_DRELOFF(x) (N_GNU_TRELOFF(x) + (x).a_trsize)
00112 #define N_GNU_SYMOFF(x)  (N_GNU_DRELOFF(x) + (x).a_drsize)
00113 
00114 #define TARGET_PAGE_SIZE 0x1000
00115 #define SEGMENT_SIZE 0x1000
00116 #define TEXT_START_ADDR 0
00117 
00118 #undef N_SHARED_LIB
00119 #define N_SHARED_LIB(x)  ( 0 /* no shared libraries */ )