OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [nindy-share/] [coff.h] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/*  Copyright 1990, 1992 Free Software Foundation, Inc.
/*  Copyright 1990, 1992 Free Software Foundation, Inc.
 *
 *
 *   This code was donated by Intel Corp.
 *   This code was donated by Intel Corp.
 *
 *
 * This is a coff version of a.out.h to support 80960 debugging from
 * This is a coff version of a.out.h to support 80960 debugging from
 * a Unix (possibly BSD) host.  It's used by:
 * a Unix (possibly BSD) host.  It's used by:
 *      o gdb960 to symbols in code generated with Intel (non-GNU) tools.
 *      o gdb960 to symbols in code generated with Intel (non-GNU) tools.
 *      o comm960 to convert a b.out file to a coff file for download.
 *      o comm960 to convert a b.out file to a coff file for download.
 */
 */
 
 
 
 
/********************** FILE HEADER **********************/
/********************** FILE HEADER **********************/
 
 
struct filehdr {
struct filehdr {
        unsigned short  f_magic;        /* magic number                 */
        unsigned short  f_magic;        /* magic number                 */
        unsigned short  f_nscns;        /* number of sections           */
        unsigned short  f_nscns;        /* number of sections           */
        long            f_timdat;       /* time & date stamp            */
        long            f_timdat;       /* time & date stamp            */
        long            f_symptr;       /* file pointer to symtab       */
        long            f_symptr;       /* file pointer to symtab       */
        long            f_nsyms;        /* number of symtab entries     */
        long            f_nsyms;        /* number of symtab entries     */
        unsigned short  f_opthdr;       /* sizeof(optional hdr)         */
        unsigned short  f_opthdr;       /* sizeof(optional hdr)         */
        unsigned short  f_flags;        /* flags                        */
        unsigned short  f_flags;        /* flags                        */
};
};
 
 
 
 
/* Bits for f_flags:
/* Bits for f_flags:
 *      F_RELFLG        relocation info stripped from file
 *      F_RELFLG        relocation info stripped from file
 *      F_EXEC          file is executable (no unresolved externel references)
 *      F_EXEC          file is executable (no unresolved externel references)
 *      F_LNNO          line nunbers stripped from file
 *      F_LNNO          line nunbers stripped from file
 *      F_LSYMS         local symbols stripped from file
 *      F_LSYMS         local symbols stripped from file
 *      F_AR32WR        file has byte ordering of an AR32WR machine (e.g. vax)
 *      F_AR32WR        file has byte ordering of an AR32WR machine (e.g. vax)
 */
 */
#define F_RELFLG        0000001
#define F_RELFLG        0000001
#define F_EXEC          0000002
#define F_EXEC          0000002
#define F_LNNO          0000004
#define F_LNNO          0000004
#define F_LSYMS 0000010
#define F_LSYMS 0000010
#define F_AR32WR        0000400
#define F_AR32WR        0000400
 
 
 
 
/*
/*
 *      Intel 80960 (I960) processor flags.
 *      Intel 80960 (I960) processor flags.
 *      F_I960TYPE == mask for processor type field.
 *      F_I960TYPE == mask for processor type field.
 */
 */
#define F_I960TYPE              0170000
#define F_I960TYPE              0170000
#define F_I960CA                0010000
#define F_I960CA                0010000
#define F_I960FLOAT             0020000
#define F_I960FLOAT             0020000
#define F_I960BA                0030000
#define F_I960BA                0030000
#define F_I960XA                0040000
#define F_I960XA                0040000
 
 
/*
/*
 * i80960 Magic Numbers
 * i80960 Magic Numbers
 */
 */
#define I960ROMAGIC     0540    /* read-only text segments      */
#define I960ROMAGIC     0540    /* read-only text segments      */
#define I960RWMAGIC     0541    /* read-write text segments     */
#define I960RWMAGIC     0541    /* read-write text segments     */
 
 
#define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
#define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
 
 
#define FILHDR  struct filehdr
#define FILHDR  struct filehdr
#define FILHSZ  sizeof(FILHDR)
#define FILHSZ  sizeof(FILHDR)
 
 
 
 
/********************** AOUT "OPTIONAL HEADER" **********************/
/********************** AOUT "OPTIONAL HEADER" **********************/
 
 
typedef struct {
typedef struct {
        unsigned long   phys_addr;
        unsigned long   phys_addr;
        unsigned long   bitarray;
        unsigned long   bitarray;
} TAGBITS;
} TAGBITS;
 
 
typedef struct aouthdr {
typedef struct aouthdr {
        short           magic;  /* type of file                         */
        short           magic;  /* type of file                         */
        short           vstamp; /* version stamp                        */
        short           vstamp; /* version stamp                        */
        unsigned long   tsize;  /* text size in bytes, padded to FW bdry*/
        unsigned long   tsize;  /* text size in bytes, padded to FW bdry*/
        unsigned long   dsize;  /* initialized data "  "                */
        unsigned long   dsize;  /* initialized data "  "                */
        unsigned long   bsize;  /* uninitialized data "   "             */
        unsigned long   bsize;  /* uninitialized data "   "             */
#if U3B
#if U3B
        unsigned long   dum1;
        unsigned long   dum1;
        unsigned long   dum2;   /* pad to entry point   */
        unsigned long   dum2;   /* pad to entry point   */
#endif
#endif
        unsigned long   entry;  /* entry pt.                            */
        unsigned long   entry;  /* entry pt.                            */
        unsigned long   text_start;     /* base of text used for this file */
        unsigned long   text_start;     /* base of text used for this file */
        unsigned long   data_start;     /* base of data used for this file */
        unsigned long   data_start;     /* base of data used for this file */
        unsigned long   tagentries;     /* number of tag entries to follow */
        unsigned long   tagentries;     /* number of tag entries to follow */
} AOUTHDR;
} AOUTHDR;
 
 
/* return a pointer to the tag bits array */
/* return a pointer to the tag bits array */
 
 
#define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
#define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
 
 
/* compute size of a header */
/* compute size of a header */
 
 
#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))
#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))
 
 
/********************** STORAGE CLASSES **********************/
/********************** STORAGE CLASSES **********************/
 
 
#define C_EFCN          -1      /* physical end of function     */
#define C_EFCN          -1      /* physical end of function     */
#define C_NULL          0
#define C_NULL          0
#define C_AUTO          1       /* automatic variable           */
#define C_AUTO          1       /* automatic variable           */
#define C_EXT           2       /* external symbol              */
#define C_EXT           2       /* external symbol              */
#define C_STAT          3       /* static                       */
#define C_STAT          3       /* static                       */
#define C_REG           4       /* register variable            */
#define C_REG           4       /* register variable            */
#define C_EXTDEF        5       /* external definition          */
#define C_EXTDEF        5       /* external definition          */
#define C_LABEL         6       /* label                        */
#define C_LABEL         6       /* label                        */
#define C_ULABEL        7       /* undefined label              */
#define C_ULABEL        7       /* undefined label              */
#define C_MOS           8       /* member of structure          */
#define C_MOS           8       /* member of structure          */
#define C_ARG           9       /* function argument            */
#define C_ARG           9       /* function argument            */
#define C_STRTAG        10      /* structure tag                */
#define C_STRTAG        10      /* structure tag                */
#define C_MOU           11      /* member of union              */
#define C_MOU           11      /* member of union              */
#define C_UNTAG         12      /* union tag                    */
#define C_UNTAG         12      /* union tag                    */
#define C_TPDEF         13      /* type definition              */
#define C_TPDEF         13      /* type definition              */
#define C_USTATIC       14      /* undefined static             */
#define C_USTATIC       14      /* undefined static             */
#define C_ENTAG         15      /* enumeration tag              */
#define C_ENTAG         15      /* enumeration tag              */
#define C_MOE           16      /* member of enumeration        */
#define C_MOE           16      /* member of enumeration        */
#define C_REGPARM       17      /* register parameter           */
#define C_REGPARM       17      /* register parameter           */
#define C_FIELD         18      /* bit field                    */
#define C_FIELD         18      /* bit field                    */
#define C_BLOCK         100     /* ".bb" or ".eb"               */
#define C_BLOCK         100     /* ".bb" or ".eb"               */
#define C_FCN           101     /* ".bf" or ".ef"               */
#define C_FCN           101     /* ".bf" or ".ef"               */
#define C_EOS           102     /* end of structure             */
#define C_EOS           102     /* end of structure             */
#define C_FILE          103     /* file name                    */
#define C_FILE          103     /* file name                    */
#define C_LINE          104     /* line # reformatted as symbol table entry */
#define C_LINE          104     /* line # reformatted as symbol table entry */
#define C_ALIAS         105     /* duplicate tag                */
#define C_ALIAS         105     /* duplicate tag                */
#define C_HIDDEN        106     /* ext symbol in dmert public lib */
#define C_HIDDEN        106     /* ext symbol in dmert public lib */
 
 
        /* New storage classes for 80960 */
        /* New storage classes for 80960 */
 
 
#define C_SCALL         107     /* Procedure reachable via system call  */
#define C_SCALL         107     /* Procedure reachable via system call  */
#define C_LEAFPROC      108     /* Leaf procedure, "call" via BAL       */
#define C_LEAFPROC      108     /* Leaf procedure, "call" via BAL       */
 
 
 
 
/********************** SECTION HEADER **********************/
/********************** SECTION HEADER **********************/
 
 
struct scnhdr {
struct scnhdr {
        char            s_name[8];      /* section name                 */
        char            s_name[8];      /* section name                 */
        long            s_paddr;        /* physical address, aliased s_nlib */
        long            s_paddr;        /* physical address, aliased s_nlib */
        long            s_vaddr;        /* virtual address              */
        long            s_vaddr;        /* virtual address              */
        long            s_size;         /* section size                 */
        long            s_size;         /* section size                 */
        long            s_scnptr;       /* file ptr to raw data for section */
        long            s_scnptr;       /* file ptr to raw data for section */
        long            s_relptr;       /* file ptr to relocation       */
        long            s_relptr;       /* file ptr to relocation       */
        long            s_lnnoptr;      /* file ptr to line numbers     */
        long            s_lnnoptr;      /* file ptr to line numbers     */
        unsigned short  s_nreloc;       /* number of relocation entries */
        unsigned short  s_nreloc;       /* number of relocation entries */
        unsigned short  s_nlnno;        /* number of line number entries*/
        unsigned short  s_nlnno;        /* number of line number entries*/
        long            s_flags;        /* flags                        */
        long            s_flags;        /* flags                        */
        unsigned long   s_align;        /* section alignment            */
        unsigned long   s_align;        /* section alignment            */
};
};
 
 
/*
/*
 * names of "special" sections
 * names of "special" sections
 */
 */
#define _TEXT   ".text"
#define _TEXT   ".text"
#define _DATA   ".data"
#define _DATA   ".data"
#define _BSS    ".bss"
#define _BSS    ".bss"
 
 
/*
/*
 * s_flags "type"
 * s_flags "type"
 */
 */
#define STYP_TEXT       0x20            /* section contains text only   */
#define STYP_TEXT       0x20            /* section contains text only   */
#define STYP_DATA       0x40            /* section contains data only   */
#define STYP_DATA       0x40            /* section contains data only   */
#define STYP_BSS        0x80            /* section contains bss only    */
#define STYP_BSS        0x80            /* section contains bss only    */
 
 
#define SCNHDR  struct scnhdr
#define SCNHDR  struct scnhdr
#define SCNHSZ  sizeof(SCNHDR)
#define SCNHSZ  sizeof(SCNHDR)
 
 
 
 
/********************** LINE NUMBERS **********************/
/********************** LINE NUMBERS **********************/
 
 
/* 1 line number entry for every "breakpointable" source line in a section.
/* 1 line number entry for every "breakpointable" source line in a section.
 * Line numbers are grouped on a per function basis; first entry in a function
 * Line numbers are grouped on a per function basis; first entry in a function
 * grouping will have l_lnno = 0 and in place of physical address will be the
 * grouping will have l_lnno = 0 and in place of physical address will be the
 * symbol table index of the function name.
 * symbol table index of the function name.
 */
 */
struct lineno{
struct lineno{
        union {
        union {
                long l_symndx;  /* function name symbol index, iff l_lnno == 0*/
                long l_symndx;  /* function name symbol index, iff l_lnno == 0*/
                long l_paddr;   /* (physical) address of line number    */
                long l_paddr;   /* (physical) address of line number    */
        } l_addr;
        } l_addr;
        unsigned short  l_lnno; /* line number          */
        unsigned short  l_lnno; /* line number          */
        char padding[2];        /* force alignment      */
        char padding[2];        /* force alignment      */
};
};
 
 
#define LINENO  struct lineno
#define LINENO  struct lineno
#define LINESZ  sizeof(LINENO) 
#define LINESZ  sizeof(LINENO) 
 
 
 
 
/********************** SYMBOLS **********************/
/********************** SYMBOLS **********************/
 
 
#define SYMNMLEN        8       /* # characters in a symbol name        */
#define SYMNMLEN        8       /* # characters in a symbol name        */
#define FILNMLEN        14      /* # characters in a file name          */
#define FILNMLEN        14      /* # characters in a file name          */
#define DIMNUM          4       /* # array dimensions in auxiliary entry */
#define DIMNUM          4       /* # array dimensions in auxiliary entry */
 
 
 
 
struct syment {
struct syment {
        union {
        union {
                char    _n_name[SYMNMLEN];      /* old COFF version     */
                char    _n_name[SYMNMLEN];      /* old COFF version     */
                struct {
                struct {
                        long    _n_zeroes;      /* new == 0             */
                        long    _n_zeroes;      /* new == 0             */
                        long    _n_offset;      /* offset into string table */
                        long    _n_offset;      /* offset into string table */
                } _n_n;
                } _n_n;
                char    *_n_nptr[2];    /* allows for overlaying        */
                char    *_n_nptr[2];    /* allows for overlaying        */
        } _n;
        } _n;
        long            n_value;        /* value of symbol              */
        long            n_value;        /* value of symbol              */
        short           n_scnum;        /* section number               */
        short           n_scnum;        /* section number               */
        char            pad1[2];        /* force alignment              */
        char            pad1[2];        /* force alignment              */
        unsigned long   n_type;         /* type and derived type        */
        unsigned long   n_type;         /* type and derived type        */
        char            n_sclass;       /* storage class                */
        char            n_sclass;       /* storage class                */
        char            n_numaux;       /* number of aux. entries       */
        char            n_numaux;       /* number of aux. entries       */
        char            pad2[2];        /* force alignment              */
        char            pad2[2];        /* force alignment              */
};
};
 
 
#define n_name          _n._n_name
#define n_name          _n._n_name
#define n_zeroes        _n._n_n._n_zeroes
#define n_zeroes        _n._n_n._n_zeroes
#define n_offset        _n._n_n._n_offset
#define n_offset        _n._n_n._n_offset
 
 
/*
/*
 * Relocatable symbols have number of the section in which they are defined,
 * Relocatable symbols have number of the section in which they are defined,
 * or one of the following:
 * or one of the following:
 */
 */
#define N_UNDEF 0        /* undefined symbol                             */
#define N_UNDEF 0        /* undefined symbol                             */
#define N_ABS   -1      /* value of symbol is absolute                  */
#define N_ABS   -1      /* value of symbol is absolute                  */
#define N_DEBUG -2      /* debugging symbol -- symbol value is meaningless */
#define N_DEBUG -2      /* debugging symbol -- symbol value is meaningless */
 
 
/*
/*
 * Type of a symbol, in low 4 bits of the word
 * Type of a symbol, in low 4 bits of the word
 */
 */
#define T_NULL          0
#define T_NULL          0
#define T_VOID          1       /* function argument (only used by compiler) */
#define T_VOID          1       /* function argument (only used by compiler) */
#define T_CHAR          2       /* character            */
#define T_CHAR          2       /* character            */
#define T_SHORT         3       /* short integer        */
#define T_SHORT         3       /* short integer        */
#define T_INT           4       /* integer              */
#define T_INT           4       /* integer              */
#define T_LONG          5       /* long integer         */
#define T_LONG          5       /* long integer         */
#define T_FLOAT         6       /* floating point       */
#define T_FLOAT         6       /* floating point       */
#define T_DOUBLE        7       /* double word          */
#define T_DOUBLE        7       /* double word          */
#define T_STRUCT        8       /* structure            */
#define T_STRUCT        8       /* structure            */
#define T_UNION         9       /* union                */
#define T_UNION         9       /* union                */
#define T_ENUM          10      /* enumeration          */
#define T_ENUM          10      /* enumeration          */
#define T_MOE           11      /* member of enumeration*/
#define T_MOE           11      /* member of enumeration*/
#define T_UCHAR         12      /* unsigned character   */
#define T_UCHAR         12      /* unsigned character   */
#define T_USHORT        13      /* unsigned short       */
#define T_USHORT        13      /* unsigned short       */
#define T_UINT          14      /* unsigned integer     */
#define T_UINT          14      /* unsigned integer     */
#define T_ULONG         15      /* unsigned long        */
#define T_ULONG         15      /* unsigned long        */
#define T_LNGDBL        16      /* long double          */
#define T_LNGDBL        16      /* long double          */
 
 
 
 
/*
/*
 * derived types
 * derived types
 */
 */
#define DT_PTR          1       /* pointer      */
#define DT_PTR          1       /* pointer      */
#define DT_FCN          2       /* function     */
#define DT_FCN          2       /* function     */
#define DT_ARY          3       /* array        */
#define DT_ARY          3       /* array        */
 
 
#define N_BTMASK        037
#define N_BTMASK        037
#define N_TMASK         0140
#define N_TMASK         0140
#define N_BTSHFT        5
#define N_BTSHFT        5
#define N_TSHIFT        2
#define N_TSHIFT        2
 
 
#define BTYPE(x)        ((x) & N_BTMASK)
#define BTYPE(x)        ((x) & N_BTMASK)
 
 
 
 
#define ISPTR(x)        (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
#define ISPTR(x)        (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
#define ISFCN(x)        (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
#define ISFCN(x)        (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
#define ISARY(x)        (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
#define ISARY(x)        (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
 
 
#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
 
 
union auxent {
union auxent {
        struct {
        struct {
                long x_tagndx;  /* str, un, or enum tag indx */
                long x_tagndx;  /* str, un, or enum tag indx */
                union {
                union {
                        struct {
                        struct {
                            unsigned short x_lnno; /* declaration line number */
                            unsigned short x_lnno; /* declaration line number */
                            unsigned short x_size; /* str/union/array size */
                            unsigned short x_size; /* str/union/array size */
                        } x_lnsz;
                        } x_lnsz;
                        long x_fsize;   /* size of function */
                        long x_fsize;   /* size of function */
                } x_misc;
                } x_misc;
                union {
                union {
                        struct {                /* if ISFCN, tag, or .bb */
                        struct {                /* if ISFCN, tag, or .bb */
                            long x_lnnoptr;     /* ptr to fcn line # */
                            long x_lnnoptr;     /* ptr to fcn line # */
                            long x_endndx;      /* entry ndx past block end */
                            long x_endndx;      /* entry ndx past block end */
                        } x_fcn;
                        } x_fcn;
                        struct {                /* if ISARY, up to 4 dimen. */
                        struct {                /* if ISARY, up to 4 dimen. */
                            unsigned short x_dimen[DIMNUM];
                            unsigned short x_dimen[DIMNUM];
                        } x_ary;
                        } x_ary;
                } x_fcnary;
                } x_fcnary;
                unsigned short x_tvndx;         /* tv index */
                unsigned short x_tvndx;         /* tv index */
        } x_sym;
        } x_sym;
 
 
        union {
        union {
                char x_fname[FILNMLEN];
                char x_fname[FILNMLEN];
                struct {
                struct {
                        long x_zeroes;
                        long x_zeroes;
                        long x_offset;
                        long x_offset;
                } x_n;
                } x_n;
        } x_file;
        } x_file;
 
 
        struct {
        struct {
                long x_scnlen;                  /* section length */
                long x_scnlen;                  /* section length */
                unsigned short x_nreloc;        /* # relocation entries */
                unsigned short x_nreloc;        /* # relocation entries */
                unsigned short x_nlinno;        /* # line numbers */
                unsigned short x_nlinno;        /* # line numbers */
        } x_scn;
        } x_scn;
 
 
        struct {
        struct {
                long x_stdindx;
                long x_stdindx;
        } x_sc;
        } x_sc;
 
 
        struct {
        struct {
                unsigned long x_balntry;
                unsigned long x_balntry;
        } x_bal;
        } x_bal;
 
 
        char a[sizeof(struct syment)];  /* force auxent/syment sizes to match */
        char a[sizeof(struct syment)];  /* force auxent/syment sizes to match */
};
};
 
 
#define SYMENT  struct syment
#define SYMENT  struct syment
#define SYMESZ  sizeof(SYMENT)  
#define SYMESZ  sizeof(SYMENT)  
#define AUXENT  union auxent
#define AUXENT  union auxent
#define AUXESZ  sizeof(AUXENT)
#define AUXESZ  sizeof(AUXENT)
 
 
#if VAX || I960
#if VAX || I960
#       define _ETEXT   "_etext"
#       define _ETEXT   "_etext"
#else
#else
#       define _ETEXT   "etext"
#       define _ETEXT   "etext"
#endif
#endif
 
 
/********************** RELOCATION DIRECTIVES **********************/
/********************** RELOCATION DIRECTIVES **********************/
 
 
struct reloc {
struct reloc {
        long r_vaddr;           /* Virtual address of reference */
        long r_vaddr;           /* Virtual address of reference */
        long r_symndx;          /* Index into symbol table      */
        long r_symndx;          /* Index into symbol table      */
        unsigned short r_type;  /* Relocation type              */
        unsigned short r_type;  /* Relocation type              */
        char pad[2];            /* Unused                       */
        char pad[2];            /* Unused                       */
};
};
 
 
/* Only values of r_type GNU/960 cares about */
/* Only values of r_type GNU/960 cares about */
#define R_RELLONG       17      /* Direct 32-bit relocation             */
#define R_RELLONG       17      /* Direct 32-bit relocation             */
#define R_IPRMED        25      /* 24-bit ip-relative relocation        */
#define R_IPRMED        25      /* 24-bit ip-relative relocation        */
#define R_OPTCALL       27      /* 32-bit optimizable call (leafproc/sysproc) */
#define R_OPTCALL       27      /* 32-bit optimizable call (leafproc/sysproc) */
 
 
 
 
#define RELOC struct reloc
#define RELOC struct reloc
#define RELSZ sizeof(RELOC)
#define RELSZ sizeof(RELOC)
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.