2000-07-19 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / include / bout.h
index b0d4fb29a05c9b492c050db43e7275dc47cf847c..8fc28cc3d6d7f2e7f38350b851990c35b68c4932 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * This file is a modified version of 'a.out.h'.  It is to be used in all
  * GNU tools modified to support the i80960 (or tools that operate on
  * object files created by such tools).
  *             'n' indicates the corresponding segment must begin at an
  *             address that is a multiple of (2**n).
  */
-struct exec {
+struct external_exec {
        /* Standard stuff */
-       unsigned long a_magic;  /* Identifies this as a b.out file      */
-       unsigned long a_text;   /* Length of text                       */
-       unsigned long a_data;   /* Length of data                       */
-       unsigned long a_bss;    /* Length of runtime uninitialized data area */
-       unsigned long a_syms;   /* Length of symbol table               */
-       unsigned long a_entry;  /* Runtime start address                */
-       unsigned long a_trsize; /* Length of text relocation info       */
-       unsigned long a_drsize; /* Length of data relocation info       */
+       unsigned char e_info[4];        /* Identifies this as a b.out file */
+       unsigned char e_text[4];        /* Length of text */
+       unsigned char e_data[4];        /* Length of data */
+       unsigned char e_bss[4];         /* Length of uninitialized data area */
+       unsigned char e_syms[4];        /* Length of symbol table */
+       unsigned char e_entry[4];       /* Runtime start address */
+       unsigned char e_trsize[4];      /* Length of text relocation info */
+       unsigned char e_drsize[4];      /* Length of data relocation info */
 
        /* Added for i960 */
-       unsigned long a_tload;  /* Text runtime load address            */
-       unsigned long a_dload;  /* Data runtime load address            */
-       unsigned char a_talign; /* Alignment of text segment            */
-       unsigned char a_dalign; /* Alignment of data segment            */
-       unsigned char a_balign; /* Alignment of bss segment             */
-       unsigned char unused;   /* (Just to make struct size a multiple of 4) */
+       unsigned char e_tload[4];       /* Text runtime load address */
+       unsigned char e_dload[4];       /* Data runtime load address */
+       unsigned char e_talign[1];      /* Alignment of text segment */
+       unsigned char e_dalign[1];      /* Alignment of data segment */
+       unsigned char e_balign[1];      /* Alignment of bss segment */
+       unsigned char e_relaxable[1];   /* Assembled with enough info to allow linker to relax */
 };
 
-#define N_BADMAG(x)    (((x).a_magic)!=BMAGIC)
-#define N_TXTOFF(x)    ( sizeof(struct exec) )
+#define        EXEC_BYTES_SIZE (sizeof (struct external_exec))
+
+/* These macros use the a_xxx field names, since they operate on the exec
+   structure after it's been byte-swapped and realigned on the host machine. */
+#define N_BADMAG(x)    (((x).a_info)!=BMAGIC)
+#define N_TXTOFF(x)    EXEC_BYTES_SIZE
 #define N_DATOFF(x)    ( N_TXTOFF(x) + (x).a_text )
 #define N_TROFF(x)     ( N_DATOFF(x) + (x).a_data )
+#define N_TRELOFF      N_TROFF
 #define N_DROFF(x)     ( N_TROFF(x) + (x).a_trsize )
+#define N_DRELOFF      N_DROFF
 #define N_SYMOFF(x)    ( N_DROFF(x) + (x).a_drsize )
 #define N_STROFF(x)    ( N_SYMOFF(x) + (x).a_syms )
+#define N_DATADDR(x)   ( (x).a_dload )    
+
+/* Address of text segment in memory after it is loaded.  */
+#if !defined (N_TXTADDR)
+#define N_TXTADDR(x) 0
+#endif
 
 /* A single entry in the symbol table
  */
@@ -136,15 +147,17 @@ struct nlist {
  * Note that an N_CALLNAME entry *must* have a corresponding N_BALNAME entry,
  * but not every N_BALNAME entry must have an N_CALLNAME entry.
  */
-#define N_CALLNAME     (-1)
-#define N_BALNAME      (-2)
-#define IS_CALLNAME(x) (N_CALLNAME == (int)(x))
-#define IS_BALNAME(x)  (N_BALNAME == (int)(x))
+#define N_CALLNAME     ((char)-1)
+#define N_BALNAME      ((char)-2)
+#define IS_CALLNAME(x) (N_CALLNAME == (x))
+#define IS_BALNAME(x)  (N_BALNAME == (x))
 #define IS_OTHER(x)    ((x)>0 && (x) <=32)
 
+#define b_out_relocation_info relocation_info
 struct relocation_info {
        int      r_address;     /* File address of item to be relocated */
        unsigned
+#define r_index r_symbolnum
                r_symbolnum:24,/* Index of symbol on which relocation is based,
                                *       if r_extern is set.  Otherwise set to
                                *       either N_TEXT, N_DATA, or N_BSS to
@@ -157,12 +170,13 @@ struct relocation_info {
                                 */
                r_length:2,     /* Number of bytes to relocate:
                                 *      0 => 1 byte
-                                *      1 => 2 bytes
-                                *      2 => 4 bytes -- only value used for i960
+                                *      1 => 2 bytes -- used for 13 bit pcrel
+                                *      2 => 4 bytes 
                                 */
                r_extern:1,
                r_bsr:1,        /* Something for the GNU NS32K assembler */
                r_disp:1,       /* Something for the GNU NS32K assembler */
                r_callj:1,      /* 1 if relocation target is an i960 'callj' */
-               nuthin:1;       /* Unused                               */
+               r_relaxable:1;  /* 1 if enough info is left to relax
+                                  the data */
 };
This page took 0.024493 seconds and 4 git commands to generate.