Include: Sync lto-symtab.h and plugin-api.h with GCC
[deliverable/binutils-gdb.git] / include / coff / mips.h
index d143ed26f91e186eb367023402904ee6ea8f43cb..2b8e0d93d2bd97020406daee1151632b50d95a4f 100644 (file)
@@ -1,17 +1,26 @@
 /* ECOFF support on MIPS machines.
-   coff/ecoff.h must be included before this file.  */
-
-/********************** FILE HEADER **********************/
-
-struct external_filehdr {
-  unsigned char f_magic[2];    /* magic number                 */
-  unsigned char f_nscns[2];    /* number of sections           */
-  unsigned char f_timdat[4];   /* time & date stamp            */
-  unsigned char f_symptr[4];   /* file pointer to symtab       */
-  unsigned char f_nsyms[4];    /* number of symtab entries     */
-  unsigned char f_opthdr[2];   /* sizeof(optional hdr)         */
-  unsigned char f_flags[2];    /* flags                        */
-};
+   coff/ecoff.h must be included before this file.
+   
+   Copyright (C) 1999-2020 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#define DO_NOT_DEFINE_AOUTHDR
+#define L_LNNO_SIZE 4
+#include "coff/external.h"
 
 /* Magic numbers are defined in coff/ecoff.h.  */
 #define MIPS_ECOFF_BADMAG(x) (((x).f_magic!=MIPS_MAGIC_1) && \
@@ -22,12 +31,9 @@ struct external_filehdr {
                              ((x).f_magic!=MIPS_MAGIC_LITTLE3) && \
                              ((x).f_magic!=MIPS_MAGIC_BIG3))
 
-#define        FILHDR  struct external_filehdr
-#define        FILHSZ  20
 
 /********************** AOUT "OPTIONAL HEADER" **********************/
 
-
 typedef struct external_aouthdr
 {
   unsigned char magic[2];      /* type of file                         */
@@ -46,32 +52,16 @@ typedef struct external_aouthdr
 
 /* compute size of a header */
 
-#define AOUTSZ (sizeof(AOUTHDR))
-
-/********************** SECTION HEADER **********************/
-
-struct external_scnhdr {
-  unsigned char        s_name[8];      /* section name                 */
-  unsigned char        s_paddr[4];     /* physical address, aliased s_nlib */
-  unsigned char        s_vaddr[4];     /* virtual address              */
-  unsigned char        s_size[4];      /* section size                 */
-  unsigned char        s_scnptr[4];    /* file ptr to raw data for section */
-  unsigned char        s_relptr[4];    /* file ptr to relocation       */
-  unsigned char        s_lnnoptr[4];   /* file ptr to line numbers     */
-  unsigned char        s_nreloc[2];    /* number of relocation entries */
-  unsigned char        s_nlnno[2];     /* number of line number entries*/
-  unsigned char        s_flags[4];     /* flags                        */
-};
-
-#define        SCNHDR  struct external_scnhdr
-#define        SCNHSZ  sizeof(SCNHDR)
+#define AOUTSZ 56
+#define AOUTHDRSZ 56
 
 /********************** RELOCATION DIRECTIVES **********************/
 
-struct external_reloc {
-  unsigned char r_vaddr[4];
-  unsigned char r_bits[4];
-};
+struct external_reloc
+  {
+    unsigned char r_vaddr[4];
+    unsigned char r_bits[4];
+  };
 
 #define RELOC struct external_reloc
 #define RELSZ 8
@@ -88,10 +78,18 @@ struct external_reloc {
 #define RELOC_BITS2_SYMNDX_SH_LEFT_BIG         0
 #define RELOC_BITS2_SYMNDX_SH_LEFT_LITTLE      16
 
-#define RELOC_BITS3_TYPE_BIG                   0x1E
+/* Originally, ECOFF used four bits for the reloc type and had three
+   reserved bits.  Irix 4 added another bit for the reloc type, which
+   was easy because it was big endian and one of the spare bits became
+   the new most significant bit.  To make this also work for little
+   endian ECOFF, we need to wrap one of the reserved bits around to
+   become the most significant bit of the reloc type.  */
+#define RELOC_BITS3_TYPE_BIG                   0x3E
 #define RELOC_BITS3_TYPE_SH_BIG                        1
 #define RELOC_BITS3_TYPE_LITTLE                        0x78
 #define RELOC_BITS3_TYPE_SH_LITTLE             3
+#define RELOC_BITS3_TYPEHI_LITTLE              0x04
+#define RELOC_BITS3_TYPEHI_SH_LITTLE           2
 
 #define RELOC_BITS3_EXTERN_BIG                 0x01
 #define RELOC_BITS3_EXTERN_LITTLE              0x80
@@ -108,28 +106,10 @@ struct external_reloc {
 #define MIPS_R_GPREL   6
 #define MIPS_R_LITERAL 7
 
-/* This reloc type is a Cygnus extension used when generating position
-   independent code for embedded systems.  */
-#define MIPS_R_PCREL16 8
-
-/* This reloc type is a Cygnus extension used when generating position
-   independent code for embedded systems.  It is used for an entry in
-   a switch table, which looks like this:
-     .switch $L3-$LS12
-   The object file will contain the correct difference, and does not
-   require adjustment.  However, when the linker is relaxing PC
-   relative calls, it is possible for $L3 to move farther away.  This
-   reloc always appears in the .text section, and is always against
-   the .text section.  However, the symbol index is not
-   RELOC_SECTION_TEXT.  It is, instead, the distance between this
-   switch table entry and $LS12.  Thus, the original value of $L12 is
-     vaddr - symndx
-   and the original value of $L3 is
-     vaddr - symndx + addend
-   where addend is the value in the object file.  Knowing this, the
-   linker can know whether the addend in the object file must be
-   adjusted.  */
-#define MIPS_R_SWITCH  9
+/* FIXME: This relocation is used (internally only) to represent branches
+   when assembling.  It should never appear in output files, and  
+   be removed.  (It used to be used for embedded-PIC support.)  */
+#define MIPS_R_PCREL16 12
 
 /********************** STABS **********************/
 
@@ -137,12 +117,6 @@ struct external_reloc {
 #define MIPS_MARK_STAB ECOFF_MARK_STAB
 #define MIPS_UNMARK_STAB ECOFF_UNMARK_STAB
 
-#define DEFAULT_DATA_SECTION_ALIGNMENT 4
-#define DEFAULT_BSS_SECTION_ALIGNMENT 4
-#define DEFAULT_TEXT_SECTION_ALIGNMENT 16
-/* For new sections we havn't heard of before */
-#define DEFAULT_SECTION_ALIGNMENT 4
-
 /********************** SYMBOLIC INFORMATION **********************/
 
 /* Written by John Gilmore.  */
@@ -153,7 +127,8 @@ struct external_reloc {
 
 /* File header as a set of bytes */
 
-struct hdr_ext {
+struct hdr_ext
+{
        unsigned char   h_magic[2];
        unsigned char   h_vstamp[2];
        unsigned char   h_ilineMax[4];
@@ -183,7 +158,8 @@ struct hdr_ext {
 
 /* File descriptor external record */
 
-struct fdr_ext {
+struct fdr_ext
+{
        unsigned char   f_adr[4];
        unsigned char   f_rss[4];
        unsigned char   f_issBase[4];
@@ -229,7 +205,8 @@ struct fdr_ext {
 
 /* Procedure descriptor external record */
 
-struct pdr_ext {
+struct pdr_ext
+{
        unsigned char   p_adr[4];
        unsigned char   p_isym[4];
        unsigned char   p_iline[4];
@@ -246,15 +223,34 @@ struct pdr_ext {
        unsigned char   p_cbLineOffset[4];
 };
 
+/* Runtime procedure table */
+
+struct rpdr_ext
+{
+       unsigned char   p_adr[4];
+       unsigned char   p_regmask[4];
+       unsigned char   p_regoffset[4];
+       unsigned char   p_fregmask[4];
+       unsigned char   p_fregoffset[4];
+       unsigned char   p_frameoffset[4];
+       unsigned char   p_framereg[2];
+       unsigned char   p_pcreg[2];
+       unsigned char   p_irpss[4];
+       unsigned char   p_reserved[4];
+       unsigned char   p_exception_info[4];
+};
+
 /* Line numbers */
 
-struct line_ext {
+struct line_ext
+{
        unsigned char   l_line[4];
 };
 
 /* Symbol external record */
 
-struct sym_ext {
+struct sym_ext
+{
        unsigned char   s_iss[4];
        unsigned char   s_value[4];
        unsigned char   s_bits1[1];
@@ -294,7 +290,8 @@ struct sym_ext {
 
 /* External symbol external record */
 
-struct ext_ext {
+struct ext_ext
+{
        unsigned char   es_bits1[1];
        unsigned char   es_bits2[1];
        unsigned char   es_ifd[2];
@@ -312,20 +309,23 @@ struct ext_ext {
 
 /* Dense numbers external record */
 
-struct dnr_ext {
+struct dnr_ext
+{
        unsigned char   d_rfd[4];
        unsigned char   d_index[4];
 };
 
 /* Relative file descriptor */
 
-struct rfd_ext {
+struct rfd_ext
+{
   unsigned char        rfd[4];
 };
 
 /* Optimizer symbol external record */
 
-struct opt_ext {
+struct opt_ext
+{
   unsigned char o_bits1[1];
   unsigned char o_bits2[1];
   unsigned char o_bits3[1];
This page took 0.027195 seconds and 4 git commands to generate.