From: Ian Lance Taylor Date: Fri, 15 Jan 1993 23:20:27 +0000 (+0000) Subject: Fri Jan 15 18:17:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9dcfbb6781c465fa4bc3800265977c051229f432;p=binutils-gdb.git Fri Jan 15 18:17:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * ecoff-ext.h: Added prototypes for new ECOFF swapping functions. (opt_ext): New structure. * mips.h (ZMAGIC): Defined to be 0413. (_LIB): Defined to be ".lib" (external_reloc): MIPS ECOFF relocs are only 8 bytes. Added macros to aid in swapping. --- diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog index 50985cef406..f1a832c0dea 100644 --- a/include/coff/ChangeLog +++ b/include/coff/ChangeLog @@ -1,3 +1,12 @@ +Fri Jan 15 18:17:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff-ext.h: Added prototypes for new ECOFF swapping functions. + (opt_ext): New structure. + * mips.h (ZMAGIC): Defined to be 0413. + (_LIB): Defined to be ".lib" + (external_reloc): MIPS ECOFF relocs are only 8 bytes. Added + macros to aid in swapping. + Fri Jan 8 16:19:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * ecoff-ext.h: Added prototypes for ECOFF swapping functions. diff --git a/include/coff/ecoff-ext.h b/include/coff/ecoff-ext.h index bce6765fb3b..d47d369d4f1 100644 --- a/include/coff/ecoff-ext.h +++ b/include/coff/ecoff-ext.h @@ -300,14 +300,46 @@ struct rfd_ext { unsigned char rfd[4]; }; +/* Optimizer symbol external record */ + +struct opt_ext { + unsigned char o_bits1[1]; + unsigned char o_bits2[1]; + unsigned char o_bits3[1]; + unsigned char o_bits4[1]; + struct rndx_ext o_rndx; + unsigned char o_offset[4]; +}; + +#define OPT_BITS2_VALUE_SH_LEFT_BIG 16 +#define OPT_BITS2_VALUE_SH_LEFT_LITTLE 0 + +#define OPT_BITS3_VALUE_SH_LEFT_BIG 8 +#define OPT_BITS3_VALUE_SH_LEFT_LITTLE 8 + +#define OPT_BITS4_VALUE_SH_LEFT_BIG 0 +#define OPT_BITS4_VALUE_SH_LEFT_LITTLE 16 + /* Prototypes for the swapping functions. These require that sym.h be included before this file. */ extern void ecoff_swap_hdr_in PARAMS ((bfd *, struct hdr_ext *, HDRR *)); +extern void ecoff_swap_hdr_out PARAMS ((bfd *, HDRR *, struct hdr_ext *)); extern void ecoff_swap_fdr_in PARAMS ((bfd *, struct fdr_ext *, FDR *)); +extern void ecoff_swap_fdr_out PARAMS ((bfd *, FDR *, struct fdr_ext *)); extern void ecoff_swap_pdr_in PARAMS ((bfd *, struct pdr_ext *, PDR *)); +extern void ecoff_swap_pdr_out PARAMS ((bfd *, PDR *, struct pdr_ext *)); extern void ecoff_swap_sym_in PARAMS ((bfd *, struct sym_ext *, SYMR *)); +extern void ecoff_swap_sym_out PARAMS ((bfd *, SYMR *, struct sym_ext *)); extern void ecoff_swap_ext_in PARAMS ((bfd *, struct ext_ext *, EXTR *)); +extern void ecoff_swap_ext_out PARAMS ((bfd *, EXTR *, struct ext_ext *)); +extern void ecoff_swap_dnr_in PARAMS ((bfd *, struct dnr_ext *, DNR *)); +extern void ecoff_swap_dnr_out PARAMS ((bfd *, DNR *, struct dnr_ext *)); extern void ecoff_swap_tir_in PARAMS ((int bigend, struct tir_ext *, TIR *)); extern void ecoff_swap_rndx_in PARAMS ((int bigend, struct rndx_ext *, RNDXR *)); +extern void ecoff_swap_rndx_out PARAMS ((int bigend, RNDXR *, + struct rndx_ext *)); extern void ecoff_swap_rfd_in PARAMS ((bfd *, struct rfd_ext *, RFDT *)); +extern void ecoff_swap_rfd_out PARAMS ((bfd *, RFDT *, struct rfd_ext *)); +extern void ecoff_swap_opt_in PARAMS ((bfd *, struct opt_ext *, OPTR *)); +extern void ecoff_swap_opt_out PARAMS ((bfd *, OPTR *, struct opt_ext *)); diff --git a/include/coff/mips.h b/include/coff/mips.h index 594def04ff9..5d15274e6e5 100644 --- a/include/coff/mips.h +++ b/include/coff/mips.h @@ -47,6 +47,7 @@ typedef struct external_aouthdr #define AOUTSZ (sizeof(AOUTHDR)) +#define ZMAGIC 0413 /* demand load format, eg normal ld output */ /********************** SECTION HEADER **********************/ @@ -77,6 +78,7 @@ struct external_scnhdr { #define _SBSS ".sbss" #define _LIT4 ".lit4" #define _LIT8 ".lit8" +#define _LIB ".lib" #define DEFAULT_DATA_SECTION_ALIGNMENT 4 #define DEFAULT_BSS_SECTION_ALIGNMENT 4 @@ -98,16 +100,38 @@ struct external_scnhdr { struct external_reloc { unsigned char r_vaddr[4]; - unsigned char r_symndx[4]; - unsigned char r_type[2]; - unsigned char pad[2]; + unsigned char r_bits[4]; }; +/* 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. */ + +#define RELOC_BITS0_SYMNDX_SH_LEFT_BIG 16 +#define RELOC_BITS0_SYMNDX_SH_LEFT_LITTLE 0 + +#define RELOC_BITS1_SYMNDX_SH_LEFT_BIG 8 +#define RELOC_BITS1_SYMNDX_SH_LEFT_LITTLE 8 + +#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_LITTLE 0x78 +#define RELOC_BITS3_TYPE_SH_LITTLE 3 + +#define RELOC_BITS3_EXTERN_BIG 0x01 +#define RELOC_BITS3_EXTERN_LITTLE 0x80 + +/* We store the extern field in the r_offset field of a struct + internal_reloc. FIXME: Do this more sensibly. */ +#define r_extern r_offset /* Relevent values for r_type and ecoff. Would someone please document them */ #define RELOC struct external_reloc -#define RELSZ 12 +#define RELSZ 8 /* gcc uses mips-tfile to output type information in special stabs entries. These must match the corresponding definition in