Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/include/bout.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    5252#define BMAGIC  0415
    5353/* We don't accept the following (see N_BADMAG macro).
    54  * They're just here so GNU code will compile.
    55  */
     54   They're just here so GNU code will compile.  */
    5655#define OMAGIC  0407            /* old impure format */
    5756#define NMAGIC  0410            /* read-only text */
     
    5958
    6059/* FILE HEADER
    61  *      All 'lengths' are given as a number of bytes.
    62  *      All 'alignments' are for relinkable files only;  an alignment of
    63  *              'n' indicates the corresponding segment must begin at an
    64  *              address that is a multiple of (2**n).
    65  */
    66 struct external_exec {
    67         /* Standard stuff */
    68         unsigned char e_info[4];        /* Identifies this as a b.out file */
    69         unsigned char e_text[4];        /* Length of text */
    70         unsigned char e_data[4];        /* Length of data */
    71         unsigned char e_bss[4];         /* Length of uninitialized data area */
    72         unsigned char e_syms[4];        /* Length of symbol table */
    73         unsigned char e_entry[4];       /* Runtime start address */
    74         unsigned char e_trsize[4];      /* Length of text relocation info */
    75         unsigned char e_drsize[4];      /* Length of data relocation info */
     60        All 'lengths' are given as a number of bytes.
     61        All 'alignments' are for relinkable files only;  an alignment of
     62                'n' indicates the corresponding segment must begin at an
     63                address that is a multiple of (2**n).  */
     64struct external_exec
     65  {
     66    /* Standard stuff */
     67    unsigned char e_info[4];    /* Identifies this as a b.out file */
     68    unsigned char e_text[4];    /* Length of text */
     69    unsigned char e_data[4];    /* Length of data */
     70    unsigned char e_bss[4];     /* Length of uninitialized data area */
     71    unsigned char e_syms[4];    /* Length of symbol table */
     72    unsigned char e_entry[4];   /* Runtime start address */
     73    unsigned char e_trsize[4];  /* Length of text relocation info */
     74    unsigned char e_drsize[4];  /* Length of data relocation info */
    7675
    77         /* Added for i960 */
    78         unsigned char e_tload[4];       /* Text runtime load address */
    79         unsigned char e_dload[4];       /* Data runtime load address */
    80         unsigned char e_talign[1];      /* Alignment of text segment */
    81         unsigned char e_dalign[1];      /* Alignment of data segment */
    82         unsigned char e_balign[1];      /* Alignment of bss segment */
    83         unsigned char e_relaxable[1];   /* Assembled with enough info to allow linker to relax */
    84 };
     76    /* Added for i960 */
     77    unsigned char e_tload[4];   /* Text runtime load address */
     78    unsigned char e_dload[4];   /* Data runtime load address */
     79    unsigned char e_talign[1];  /* Alignment of text segment */
     80    unsigned char e_dalign[1];  /* Alignment of data segment */
     81    unsigned char e_balign[1];  /* Alignment of bss segment */
     82    unsigned char e_relaxable[1];/* Assembled with enough info to allow linker to relax */
     83  };
    8584
    8685#define EXEC_BYTES_SIZE (sizeof (struct external_exec))
    8786
    8887/* These macros use the a_xxx field names, since they operate on the exec
    89    structure after it's been byte-swapped and realigned on the host machine. */
     88   structure after it's been byte-swapped and realigned on the host machine.  */
    9089#define N_BADMAG(x)     (((x).a_info)!=BMAGIC)
    9190#define N_TXTOFF(x)     EXEC_BYTES_SIZE
     
    104103#endif
    105104
    106 /* A single entry in the symbol table
    107  */
    108 struct nlist {
    109         union {
    110                 char    *n_name;
    111                 struct nlist *n_next;
    112                 long    n_strx;         /* Index into string table      */
    113         } n_un;
    114         unsigned char n_type;   /* See below                            */
    115         char    n_other;        /* Used in i80960 support -- see below  */
    116         short   n_desc;
    117         unsigned long n_value;
    118 };
     105/* A single entry in the symbol table.  */
     106struct nlist
     107  {
     108    union
     109      {
     110        char*          n_name;
     111        struct nlist * n_next;
     112        long           n_strx;  /* Index into string table      */
     113      } n_un;
     114
     115    unsigned char n_type;       /* See below                            */
     116    char          n_other;      /* Used in i80960 support -- see below  */
     117    short         n_desc;
     118    unsigned long n_value;
     119  };
    119120
    120121
    121 /* Legal values of n_type
    122  */
     122/* Legal values of n_type.  */
    123123#define N_UNDF  0       /* Undefined symbol     */
    124124#define N_ABS   2       /* Absolute symbol      */
     
    133133
    134134/* MEANING OF 'n_other'
    135  *
    136  * If non-zero, the 'n_other' fields indicates either a leaf procedure or
    137  * a system procedure, as follows:
    138  *
    139  *      1 <= n_other <= 32 :
    140  *              The symbol is the entry point to a system procedure.
    141  *              'n_value' is the address of the entry, as for any other
    142  *              procedure.  The system procedure number (which can be used in
    143  *              a 'calls' instruction) is (n_other-1).  These entries come from
    144  *              '.sysproc' directives.
    145  *
    146  *      n_other == N_CALLNAME
    147  *              the symbol is the 'call' entry point to a leaf procedure.
    148  *              The *next* symbol in the symbol table must be the corresponding
    149  *              'bal' entry point to the procedure (see following).  These
    150  *              entries come from '.leafproc' directives in which two different
    151  *              symbols are specified (the first one is represented here).
    152  *     
    153  *
    154  *      n_other == N_BALNAME
    155  *              the symbol is the 'bal' entry point to a leaf procedure.
    156  *              These entries result from '.leafproc' directives in which only
    157  *              one symbol is specified, or in which the same symbol is
    158  *              specified twice.
    159  *
    160  * Note that an N_CALLNAME entry *must* have a corresponding N_BALNAME entry,
    161  * but not every N_BALNAME entry must have an N_CALLNAME entry.
    162  */
     135 
     136  If non-zero, the 'n_other' fields indicates either a leaf procedure or
     137  a system procedure, as follows:
     138 
     139        1 <= n_other <= 32 :
     140                The symbol is the entry point to a system procedure.
     141                'n_value' is the address of the entry, as for any other
     142                procedure.  The system procedure number (which can be used in
     143                a 'calls' instruction) is (n_other-1).  These entries come from
     144                '.sysproc' directives.
     145 
     146        n_other == N_CALLNAME
     147                the symbol is the 'call' entry point to a leaf procedure.
     148                The *next* symbol in the symbol table must be the corresponding
     149                'bal' entry point to the procedure (see following).  These
     150                entries come from '.leafproc' directives in which two different
     151                symbols are specified (the first one is represented here).
     152       
     153 
     154        n_other == N_BALNAME
     155                the symbol is the 'bal' entry point to a leaf procedure.
     156                These entries result from '.leafproc' directives in which only
     157                one symbol is specified, or in which the same symbol is
     158                specified twice.
     159 
     160  Note that an N_CALLNAME entry *must* have a corresponding N_BALNAME entry,
     161  but not every N_BALNAME entry must have an N_CALLNAME entry.  */
    163162#define N_CALLNAME      ((char)-1)
    164163#define N_BALNAME       ((char)-2)
     
    168167
    169168#define b_out_relocation_info relocation_info
    170 struct relocation_info {
    171         int      r_address;     /* File address of item to be relocated */
    172         unsigned
     169struct relocation_info
     170  {
     171    int  r_address;     /* File address of item to be relocated.  */
     172    unsigned
    173173#define r_index r_symbolnum
    174                 r_symbolnum:24,/* Index of symbol on which relocation is based,
    175                                 *       if r_extern is set.  Otherwise set to
    176                                 *       either N_TEXT, N_DATA, or N_BSS to
    177                                 *       indicate section on which relocation is
    178                                 *       based.
    179                                 */
    180                 r_pcrel:1,      /* 1 => relocate PC-relative; else absolute
    181                                  *      On i960, pc-relative implies 24-bit
    182                                  *      address, absolute implies 32-bit.
    183                                  */
    184                 r_length:2,     /* Number of bytes to relocate:
    185                                  *      0 => 1 byte
    186                                  *      1 => 2 bytes -- used for 13 bit pcrel
    187                                  *      2 => 4 bytes
    188                                  */
    189                 r_extern:1,
    190                 r_bsr:1,        /* Something for the GNU NS32K assembler */
    191                 r_disp:1,       /* Something for the GNU NS32K assembler */
    192                 r_callj:1,      /* 1 if relocation target is an i960 'callj' */
    193                 r_relaxable:1;  /* 1 if enough info is left to relax
    194                                    the data */
     174    r_symbolnum:24,     /* Index of symbol on which relocation is based,
     175                           if r_extern is set.  Otherwise set to
     176                           either N_TEXT, N_DATA, or N_BSS to
     177                           indicate section on which relocation is
     178                           based.  */
     179      r_pcrel:1,        /* 1 => relocate PC-relative; else absolute
     180                           On i960, pc-relative implies 24-bit
     181                           address, absolute implies 32-bit.  */
     182      r_length:2,       /* Number of bytes to relocate:
     183                           0 => 1 byte
     184                           1 => 2 bytes -- used for 13 bit pcrel
     185                           2 => 4 bytes.  */
     186      r_extern:1,
     187      r_bsr:1,          /* Something for the GNU NS32K assembler.  */
     188      r_disp:1,         /* Something for the GNU NS32K assembler.  */
     189      r_callj:1,        /* 1 if relocation target is an i960 'callj'.  */
     190      r_relaxable:1;    /* 1 if enough info is left to relax the data.  */
    195191};
Note: See TracChangeset for help on using the changeset viewer.