diff options
author | Steve Chamberlain <steve@cygnus> | 1991-05-10 19:41:19 +0000 |
---|---|---|
committer | Steve Chamberlain <steve@cygnus> | 1991-05-10 19:41:19 +0000 |
commit | 81623791e48b4d001c7f8e7faf443c5dd7dd8496 (patch) | |
tree | 47bdbb0682eb9c76b6cd8b809a26dd8f667b696e /include/coff-m88k.h | |
parent | 9dce1776b6082043999b0d7eaa9f63752e93d043 (diff) | |
download | gdb-81623791e48b4d001c7f8e7faf443c5dd7dd8496.zip gdb-81623791e48b4d001c7f8e7faf443c5dd7dd8496.tar.gz gdb-81623791e48b4d001c7f8e7faf443c5dd7dd8496.tar.bz2 |
Now there are two incarnations of relocs, linenos and syments. One for
internal digestion, and one full of char arrays for I/O. The original
names have gone to detect errors.
Diffstat (limited to 'include/coff-m88k.h')
-rwxr-xr-x | include/coff-m88k.h | 141 |
1 files changed, 109 insertions, 32 deletions
diff --git a/include/coff-m88k.h b/include/coff-m88k.h index 1a1d5d8..64a7a01 100755 --- a/include/coff-m88k.h +++ b/include/coff-m88k.h @@ -133,7 +133,16 @@ struct scnhdr { * grouping will have l_lnno = 0 and in place of physical address will be the * symbol table index of the function name. */ -struct lineno{ +struct external_lineno{ + union { + char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ + char l_paddr[4]; /* (physical) address of line number */ + } l_addr; + + char l_lnno[4]; + +}; +struct internal_lineno{ union { long l_symndx; /* function name symbol index, iff l_lnno == 0*/ long l_paddr; /* (physical) address of line number */ @@ -143,8 +152,8 @@ struct lineno{ }; -#define LINENO struct lineno -#define LINESZ sizeof(LINENO) +#define LINENO struct external_lineno +#define LINESZ 8 /********************** SYMBOLS **********************/ @@ -153,8 +162,24 @@ struct lineno{ #define FILNMLEN 14 /* # characters in a file name */ #define DIMNUM 4 /* # array dimensions in auxiliary entry */ +struct external_syment +{ + union { + char e_name[SYMNMLEN]; + struct { + char e_zeroes[4]; + char e_offset[4]; + } e; + } e; + char e_value[4]; + char e_scnum[2]; + char e_type[2]; + char e_sclass[1]; + char e_numaux[1]; + char pad2[2]; +}; -struct syment { +struct internal_syment { union { char _n_name[SYMNMLEN]; /* old COFF version */ struct { @@ -168,12 +193,8 @@ struct syment { unsigned short n_type; /* type and derived type */ char n_sclass; /* storage class */ char n_numaux; /* number of aux. entries */ - char pad2[2]; /* force alignment */ -}; -#define n_name _n._n_name -#define n_zeroes _n._n_n._n_zeroes -#define n_offset _n._n_n._n_offset +}; /* * Relocatable symbols have number of the section in which they are defined, @@ -227,58 +248,114 @@ struct syment { #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) -union auxent { +union external_auxent { struct { - long x_tagndx; /* str, un, or enum tag indx */ + char x_tagndx[4]; /* str, un, or enum tag indx */ union { struct { - unsigned long x_lnno; /* declaration line number */ - unsigned long x_size; /* str/union/array size */ + char x_lnno[2]; /* declaration line number */ + char x_size[2]; /* str/union/array size */ } x_lnsz; - long x_fsize; /* size of function */ + char x_fsize[4]; /* size of function */ } x_misc; union { struct { /* if ISFCN, tag, or .bb */ - long x_lnnoptr; /* ptr to fcn line # */ - long x_endndx; /* entry ndx past block end */ + char x_lnnoptr[4]; /* ptr to fcn line # */ + char x_endndx[4]; /* entry ndx past block end */ } x_fcn; struct { /* if ISARY, up to 4 dimen. */ - unsigned short x_dimen[DIMNUM]; + char x_dimen[DIMNUM][2]; } x_ary; } x_fcnary; - unsigned short x_tvndx; /* tv index */ + char x_tvndx[2]; /* tv index */ } x_sym; union { char x_fname[FILNMLEN]; struct { - long x_zeroes; - long x_offset; + char x_zeroes[4]; + char x_offset[4]; } x_n; } x_file; struct { - long x_scnlen; /* section length */ - unsigned long x_nreloc; /* # relocation entries */ - unsigned long x_nlinno; /* # line numbers */ + char x_scnlen[4]; /* section length */ + char x_nreloc[2]; /* # relocation entries */ + char x_nlinno[2]; /* # line numbers */ } x_scn; + struct { + char x_tvfill[4]; /* tv fill value */ + char x_tvlen[2]; /* length of .tv */ + char x_tvran[2][2]; /* tv range */ + } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ + }; +union internal_auxent +{ + struct { + long x_tagndx; /* str, un, or enum tag indx */ + union { + struct { + unsigned short x_lnno; /* declaration line number */ + unsigned short x_size; /* str/union/array size */ + } x_lnsz; + long x_fsize; /* size of function */ + } x_misc; + union { + struct { /* if ISFCN, tag, or .bb */ + long x_lnnoptr; /* ptr to fcn line # */ + long x_endndx; /* entry ndx past block end */ + } x_fcn; + struct { /* if ISARY, up to 4 dimen. */ + unsigned short x_dimen[DIMNUM]; + } x_ary; + } x_fcnary; + unsigned short x_tvndx; /* tv index */ + } x_sym; + + union { + char x_fname[FILNMLEN]; + struct { + long x_zeroes; + long x_offset; + } x_n; + } x_file; + + struct { + long x_scnlen; /* section length */ + unsigned short x_nreloc; /* # relocation entries */ + unsigned short x_nlinno; /* # line numbers */ + } x_scn; + + struct { + long x_tvfill; /* tv fill value */ + unsigned short x_tvlen; /* length of .tv */ + unsigned short x_tvran[2]; /* tv range */ + } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ +}; -#define SYMENT struct syment +#define SYMENT struct external_syment #define SYMESZ 20 -#define AUXENT union auxent +#define AUXENT union external_auxent #define AUXESZ 20 /********************** RELOCATION DIRECTIVES **********************/ -struct reloc { - long r_vaddr; /* Virtual address of reference */ - long r_symndx; /* Index into symbol table */ - unsigned short r_type; /* Relocation type */ - unsigned short r_offset;/* Hi 16 bits of constant */ +struct external_reloc { + char r_vaddr[4]; + char r_symndx[4]; + char r_type[2]; + char r_offset[2]; +}; + +struct internal_reloc { + long r_vaddr; /* Virtual address of reference */ + long r_symndx; /* Index into symbol table */ + unsigned short r_type; /* Relocation type */ + unsigned short r_offset; /* Hi 16 bits of constant */ }; /* Only values of r_type GNU/88k cares about */ @@ -292,7 +369,7 @@ struct reloc { -#define RELOC struct reloc -#define RELSZ sizeof(RELOC) +#define RELOC struct external_reloc +#define RELSZ 12 #define DEFAULT_SECTION_ALIGNMENT 8 /* double word */ |