* 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 **********************/
#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 {
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:
#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 {
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 */
#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
* 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 */
};
-#define LINENO struct lineno
-#define LINESZ sizeof(LINENO)
+#define LINENO struct external_lineno
+#define LINESZ 8
/********************** SYMBOLS **********************/
#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 {
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,
#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 */
-#define RELOC struct reloc
-#define RELSZ sizeof(RELOC)
+#define RELOC struct external_reloc
+#define RELSZ 12
#define DEFAULT_SECTION_ALIGNMENT 8 /* double word */