aboutsummaryrefslogtreecommitdiff
path: root/include/coff-i960.h
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-05-10 19:41:19 +0000
committerSteve Chamberlain <steve@cygnus>1991-05-10 19:41:19 +0000
commit81623791e48b4d001c7f8e7faf443c5dd7dd8496 (patch)
tree47bdbb0682eb9c76b6cd8b809a26dd8f667b696e /include/coff-i960.h
parent9dce1776b6082043999b0d7eaa9f63752e93d043 (diff)
downloadgdb-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-i960.h')
-rwxr-xr-xinclude/coff-i960.h130
1 files changed, 107 insertions, 23 deletions
diff --git a/include/coff-i960.h b/include/coff-i960.h
index 2c1877a..db21c4b 100755
--- a/include/coff-i960.h
+++ b/include/coff-i960.h
@@ -222,17 +222,25 @@ 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;
+ unsigned short l_lnno; /* line number */
+ char padding[2]; /* force alignment */
+};
+
+struct internal_lineno {
union {
long l_symndx; /* function name symbol index, iff l_lnno == 0*/
long l_paddr; /* (physical) address of line number */
} l_addr;
unsigned short l_lnno; /* line number */
- char padding[2]; /* force alignment */
};
-#define LINENO struct lineno
-#define LINESZ sizeof(LINENO)
+#define LINENO struct external_lineno
+#define LINESZ 8
/********************** SYMBOLS **********************/
@@ -241,7 +249,26 @@ struct lineno {
#define FILNMLEN 14 /* # characters in a file name */
#define DIMNUM 4 /* # array dimensions in auxiliary entry */
-struct syment {
+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_flags[2];
+ char e_type[4];
+ char e_sclass[1];
+ char e_numaux[1];
+ char pad2[2];
+};
+
+
+struct internal_syment {
union {
char _n_name[SYMNMLEN]; /* old COFF version */
struct {
@@ -256,14 +283,8 @@ struct syment {
unsigned long 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_ptr _n._n_nptr[1]
-#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,
* or one of the following:
@@ -315,8 +336,69 @@ struct syment {
#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
+union external_auxent {
+ struct {
+ char x_tagndx[4]; /* str, un, or enum tag indx */
+ union {
+ struct {
+ char x_lnno[2]; /* declaration line number */
+ char x_size[2]; /* str/union/array size */
+ } x_lnsz;
+ char x_fsize[4]; /* size of function */
+ } x_misc;
+ union {
+ struct { /* if ISFCN, tag, or .bb */
+ 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. */
+ char x_dimen[DIMNUM][2];
+ } x_ary;
+ } x_fcnary;
+ char x_tvndx[2]; /* tv index */
+ } x_sym;
+
+ union {
+ char x_fname[FILNMLEN];
+ struct {
+ char x_zeroes[4];
+ char x_offset[4];
+ } x_n;
+ } x_file;
+
+ struct {
+ 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)) */
+
+ /******************************************
+ * I960-specific *2nd* aux. entry formats
+ ******************************************/
+ struct {
+ /* This is a very old typo that keeps getting propagated. */
+#define x_stdindx x_stindx
+ char x_stindx[4]; /* sys. table entry */
+ } x_sc; /* system call entry */
-union auxent {
+ struct {
+ char x_balntry[4]; /* BAL entry point */
+ } x_bal; /* BAL-callable function */
+
+ struct {
+ char x_timestamp[4]; /* time stamp */
+ char x_idstring[20]; /* producer identity string */
+ } x_ident; /* Producer ident info */
+
+};
+
+union internal_auxent {
struct {
long x_tagndx; /* str, un, or enum tag indx */
union {
@@ -376,27 +458,29 @@ union auxent {
char x_idstring[20]; /* producer identity string */
} x_ident; /* Producer ident info */
- char a[sizeof(struct syment)]; /* force auxent/syment sizes to match */
+
};
-#define SYMENT struct syment
+#define SYMENT struct external_syment
#define SYMESZ sizeof(SYMENT)
-#define AUXENT union auxent
+#define AUXENT union external_auxent
#define AUXESZ sizeof(AUXENT)
-#if VAX || I960
# define _ETEXT "_etext"
-#else
-# define _ETEXT "etext"
-#endif
/********************** RELOCATION DIRECTIVES **********************/
-struct reloc {
+struct external_reloc {
+ char r_vaddr[4];
+ char r_symndx[4];
+ char r_type[2];
+ char pad[2];
+};
+
+struct internal_reloc {
long r_vaddr; /* Virtual address of reference */
long r_symndx; /* Index into symbol table */
unsigned short r_type; /* Relocation type */
- char pad[2]; /* Unused */
};
/* Relevent values for r_type and i960. Would someone please document them */
@@ -411,8 +495,8 @@ struct reloc {
#define R_GETPA (0x1e)
#define R_TAGWORD (0x1f)
-#define RELOC struct reloc
-#define RELSZ sizeof(RELOC)
+#define RELOC struct external_reloc
+#define RELSZ 12
#define DEFAULT_DATA_SECTION_ALIGNMENT 4
#define DEFAULT_BSS_SECTION_ALIGNMENT 4