* mips.h (OMAGIC): Define.
This commit is contained in:
parent
de17306e90
commit
a434bccf17
2 changed files with 65 additions and 12 deletions
|
@ -1,3 +1,15 @@
|
|||
Wed Jun 9 15:09:09 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* mips.h (OMAGIC): Define.
|
||||
|
||||
Mon Apr 26 18:04:47 1993 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||
|
||||
* internal.h, sh.h: Support for SH.
|
||||
|
||||
Sat Apr 24 21:34:59 1993 Jim Kingdon (kingdon@cygnus.com)
|
||||
|
||||
* a29k.h: Define _LIT.
|
||||
|
||||
Fri Apr 23 18:41:23 1993 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||
|
||||
* alpha.h: New file.
|
||||
|
|
|
@ -15,14 +15,16 @@ struct external_filehdr {
|
|||
};
|
||||
|
||||
|
||||
/* Mips magics */
|
||||
/* Mips magic numbers used in filehdr. MIPS_MAGIC_LITTLE is used on
|
||||
little endian machines. MIPS_MAGIC_BIG is used on big endian
|
||||
machines. Where is MIPS_MAGIC_1 from? */
|
||||
#define MIPS_MAGIC_1 0x0180
|
||||
#define MIPS_MAGIC_2 0x0162
|
||||
#define MIPS_MAGIC_3 0x0160
|
||||
#define MIPS_MAGIC_LITTLE 0x0162
|
||||
#define MIPS_MAGIC_BIG 0x0160
|
||||
|
||||
#define ECOFFBADMAG(x) (((x).f_magic!=MIPS_MAGIC_1) && \
|
||||
((x).f_magic!=MIPS_MAGIC_2) &&\
|
||||
((x).f_magic!=MIPS_MAGIC_3))
|
||||
((x).f_magic!=MIPS_MAGIC_LITTLE) &&\
|
||||
((x).f_magic!=MIPS_MAGIC_BIG))
|
||||
|
||||
|
||||
#define FILHDR struct external_filehdr
|
||||
|
@ -41,12 +43,17 @@ typedef struct external_aouthdr
|
|||
unsigned char entry[4]; /* entry pt. */
|
||||
unsigned char text_start[4]; /* base of text used for this file */
|
||||
unsigned char data_start[4]; /* base of data used for this file */
|
||||
unsigned char bss_start[4]; /* base of bss used for this file */
|
||||
unsigned char gprmask[4]; /* ?? */
|
||||
unsigned char cprmask[4][4]; /* ?? */
|
||||
unsigned char gp_value[4]; /* value for gp register */
|
||||
} AOUTHDR;
|
||||
|
||||
/* compute size of a header */
|
||||
|
||||
#define AOUTSZ (sizeof(AOUTHDR))
|
||||
|
||||
#define OMAGIC 0407 /* not demand paged (ld -N). */
|
||||
#define ZMAGIC 0413 /* demand load format, eg normal ld output */
|
||||
|
||||
/********************** SECTION HEADER **********************/
|
||||
|
@ -103,9 +110,11 @@ struct external_reloc {
|
|||
unsigned char r_bits[4];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 8
|
||||
|
||||
/* MIPS ECOFF uses a packed 8 byte format for relocs. These constants
|
||||
are used to unpack the r_bits field. FIXME: Check these on a big
|
||||
endian machine. */
|
||||
are used to unpack the r_bits field. */
|
||||
|
||||
#define RELOC_BITS0_SYMNDX_SH_LEFT_BIG 16
|
||||
#define RELOC_BITS0_SYMNDX_SH_LEFT_LITTLE 0
|
||||
|
@ -116,8 +125,8 @@ struct external_reloc {
|
|||
#define RELOC_BITS2_SYMNDX_SH_LEFT_BIG 0
|
||||
#define RELOC_BITS2_SYMNDX_SH_LEFT_LITTLE 16
|
||||
|
||||
#define RELOC_BITS3_TYPE_BIG 0x3C
|
||||
#define RELOC_BITS3_TYPE_SH_BIG 2
|
||||
#define RELOC_BITS3_TYPE_BIG 0x1E
|
||||
#define RELOC_BITS3_TYPE_SH_BIG 1
|
||||
#define RELOC_BITS3_TYPE_LITTLE 0x78
|
||||
#define RELOC_BITS3_TYPE_SH_LITTLE 3
|
||||
|
||||
|
@ -128,10 +137,32 @@ struct external_reloc {
|
|||
internal_reloc. FIXME: Do this more sensibly. */
|
||||
#define r_extern r_offset
|
||||
|
||||
/* Relevent values for r_type and ecoff. Would someone please document them */
|
||||
/* If the extern bit is 1, then r_symndx is an index into the external
|
||||
symbol table. If the extern bit is 0, then r_symndx indicates a
|
||||
section, and is one of the following values. */
|
||||
#define RELOC_SECTION_TEXT 1
|
||||
#define RELOC_SECTION_RDATA 2
|
||||
#define RELOC_SECTION_DATA 3
|
||||
#define RELOC_SECTION_SDATA 4
|
||||
#define RELOC_SECTION_SBSS 5
|
||||
#define RELOC_SECTION_BSS 6
|
||||
#define RELOC_SECTION_INIT 7
|
||||
#define RELOC_SECTION_LIT8 8
|
||||
#define RELOC_SECTION_LIT4 9
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 8
|
||||
/* The r_type field is one of the following values. I don't know if
|
||||
any other values can appear. These seem to be all that occur in
|
||||
the Ultrix 4.2 libraries. */
|
||||
#define ECOFF_R_IGNORE 0
|
||||
#define ECOFF_R_REFHALF 1
|
||||
#define ECOFF_R_REFWORD 2
|
||||
#define ECOFF_R_JMPADDR 3
|
||||
#define ECOFF_R_REFHI 4
|
||||
#define ECOFF_R_REFLO 5
|
||||
#define ECOFF_R_GPREL 6
|
||||
#define ECOFF_R_LITERAL 7
|
||||
|
||||
/********************** STABS **********************/
|
||||
|
||||
/* gcc uses mips-tfile to output type information in special stabs
|
||||
entries. These must match the corresponding definition in
|
||||
|
@ -143,3 +174,13 @@ struct external_reloc {
|
|||
#define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
|
||||
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
|
||||
#define STABS_SYMBOL "@stabs"
|
||||
|
||||
/********************** COFF **********************/
|
||||
|
||||
/* gcc also uses mips-tfile to output COFF debugging information.
|
||||
These are the values it uses when outputting the .type directive.
|
||||
These should also be in a shared include file. */
|
||||
#define N_BTMASK (017)
|
||||
#define N_TMASK (060)
|
||||
#define N_BTSHFT (4)
|
||||
#define N_TSHIFT (2)
|
||||
|
|
Loading…
Add table
Reference in a new issue