Back to index

cell-binutils  2.17cvs20070401
apollo.h
Go to the documentation of this file.
00001 /* coff information for Apollo M68K
00002 
00003    Copyright 2001 Free Software Foundation, Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009    
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014    
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 #define DO_NOT_DEFINE_AOUTHDR
00020 #define L_LNNO_SIZE 2
00021 #include "coff/external.h"
00022 
00023 /* Motorola 68000/68008/68010/68020 */
00024 #define       MC68MAGIC     0520
00025 #define MC68KWRMAGIC 0520   /* writeable text segments */
00026 #define       MC68TVMAGIC   0521
00027 #define MC68KROMAGIC 0521   /* readonly shareable text segments */
00028 #define MC68KPGMAGIC 0522   /* demand paged text segments */
00029 #define       M68MAGIC      0210
00030 #define       M68TVMAGIC    0211
00031 
00032 /* Apollo 68000-based machines have a different magic number. This comes
00033  * from /usr/include/apollo/filehdr.h
00034  */
00035 #define APOLLOM68KMAGIC 0627
00036 
00037 #define OMAGIC M68MAGIC
00038 #define M68KBADMAG(x) (((x).f_magic!=MC68MAGIC) && ((x).f_magic!=MC68KWRMAGIC) && ((x).f_magic!=MC68TVMAGIC) && \
00039   ((x).f_magic!=MC68KROMAGIC) && ((x).f_magic!=MC68KPGMAGIC) && ((x).f_magic!=M68MAGIC) && ((x).f_magic!=M68TVMAGIC)  && \
00040   ((x).f_magic!=APOLLOM68KMAGIC) )
00041 
00042 /********************** AOUT "OPTIONAL HEADER" **********************/
00043 
00044 typedef struct 
00045 {
00046   char        magic[2];            /* type of file                           */
00047   char vstamp[2];           /* version stamp                   */
00048   char tsize[4];            /* text size in bytes, padded to FW bdry*/
00049   char dsize[4];            /* initialized data "  "           */
00050   char bsize[4];            /* uninitialized data "   "        */
00051   char entry[4];            /* entry pt.                       */
00052   char        text_start[4];              /* base of text used for this file */
00053   char        data_start[4];              /* base of data used for this file */
00054   char o_sri[4];            /* Apollo specific - .sri data pointer */
00055   char  o_inlib[4];         /* Apollo specific - .inlib data pointer */
00056   char vid[8];                     /* Apollo specific - 64 bit version ID */
00057 }
00058 AOUTHDR;
00059 
00060 #define       APOLLO_COFF_VERSION_NUMBER 1 /* the value of the aouthdr magic */
00061 #define       AOUTHDRSZ 44
00062 #define AOUTSZ 44
00063 
00064 /* Apollo allowa for larger section names by allowing
00065    them to be in the string table.  */
00066 
00067 /* If s_zeores is all zeroes, s_offset gives the real
00068    location of the name in the string table.  */
00069 
00070 #define       s_zeroes section_name.s_name
00071 #define       s_offset (section_name.s_name+4)
00072 
00073 /* More names of "special" sections.  */
00074 #define _TV   ".tv"
00075 #define _INIT ".init"
00076 #define _FINI ".fini"
00077 #define       _LINES ".lines"
00078 #define       _BLOCKS       ".blocks"
00079 #define _SRI    ".sri"                  /* Static Resource Information (systype,
00080  et al.) */
00081 #define _MIR    ".mir"                  /* Module Information Records  */
00082 #define _APTV   ".aptv"                 /* Apollo-style transfer vectors. */
00083 #define _INLIB  ".inlib"                /* Shared Library information */
00084 #define _RWDI   ".rwdi"         /* Read/write data initialization directives for
00085  compressed sections */
00086 #define _UNWIND ".unwind"               /* Stack unwind information */
00087 
00088 /********************** RELOCATION DIRECTIVES **********************/
00089 
00090 struct external_reloc
00091 {
00092   char r_vaddr[4];
00093   char r_symndx[4];
00094   char r_type[2];
00095 #ifdef M68K_COFF_OFFSET
00096   char r_offset[4];
00097 #endif
00098 
00099 };
00100 
00101 #define RELOC struct external_reloc
00102 
00103 #ifdef M68K_COFF_OFFSET
00104 #define RELSZ 14
00105 #else
00106 #define RELSZ 10
00107 #endif
00108 
00109 /* Apollo specific STYP flags */
00110 
00111 #define STYP_RELOCATED_NOT_LOADED 0x00010000     /* Section is relocated normally during linking, but need
00112                                                     not be loaded during program execution */
00113 #define STYP_DEBUG              0x00020000       /* debug section */
00114 #define STYP_OVERLAY        0x00040000    /* Section is overlayed */
00115 #define STYP_INSTRUCTION           0x00200000    /* Section contains executable code */
00116 
00117 #define STYP_ZERO           0x00800000    /* Section is initialized to zero */
00118 #define STYP_INSTALLED             0x02000000    /* Section should be installable in KGT */
00119 #define STYP_LOOK_INSTALLED 0x04000000    /* Look for section in KGT */
00120 #define STYP_SECALIGN1             0x08000000    /* Specially aligned section */
00121 #define STYP_SECALIGN2             0x10000000    /*      "       "       "    */
00122 #define STYP_COMPRESSED            0x20000000    /* No section data per se (s_scnptr = 0), but there are
00123                                              initialization directives for it in .rwdi section
00124                                              (used in conjunction with STYP_BSS) */