Back to index

cell-binutils  2.17cvs20070401
m68k.h
Go to the documentation of this file.
00001 /* MC68k ELF support for BFD.
00002    Copyright 1998, 1999, 2000, 2002, 2005, 2006 Free Software Foundation, Inc.
00003 
00004    This file is part of BFD, the Binary File Descriptor library.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software Foundation,
00018    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 #ifndef _ELF_M68K_H
00021 #define _ELF_M68K_H
00022 
00023 #include "elf/reloc-macros.h"
00024 
00025 /* Relocation types.  */
00026 START_RELOC_NUMBERS (elf_m68k_reloc_type)
00027   RELOC_NUMBER (R_68K_NONE, 0)            /* No reloc */
00028   RELOC_NUMBER (R_68K_32, 1)              /* Direct 32 bit  */
00029   RELOC_NUMBER (R_68K_16, 2)              /* Direct 16 bit  */
00030   RELOC_NUMBER (R_68K_8, 3)        /* Direct 8 bit  */
00031   RELOC_NUMBER (R_68K_PC32, 4)            /* PC relative 32 bit */
00032   RELOC_NUMBER (R_68K_PC16, 5)            /* PC relative 16 bit */
00033   RELOC_NUMBER (R_68K_PC8, 6)             /* PC relative 8 bit */
00034   RELOC_NUMBER (R_68K_GOT32, 7)           /* 32 bit PC relative GOT entry */
00035   RELOC_NUMBER (R_68K_GOT16, 8)           /* 16 bit PC relative GOT entry */
00036   RELOC_NUMBER (R_68K_GOT8, 9)            /* 8 bit PC relative GOT entry */
00037   RELOC_NUMBER (R_68K_GOT32O, 10)  /* 32 bit GOT offset */
00038   RELOC_NUMBER (R_68K_GOT16O, 11)  /* 16 bit GOT offset */
00039   RELOC_NUMBER (R_68K_GOT8O, 12)   /* 8 bit GOT offset */
00040   RELOC_NUMBER (R_68K_PLT32, 13)   /* 32 bit PC relative PLT address */
00041   RELOC_NUMBER (R_68K_PLT16, 14)   /* 16 bit PC relative PLT address */
00042   RELOC_NUMBER (R_68K_PLT8, 15)           /* 8 bit PC relative PLT address */
00043   RELOC_NUMBER (R_68K_PLT32O, 16)  /* 32 bit PLT offset */
00044   RELOC_NUMBER (R_68K_PLT16O, 17)  /* 16 bit PLT offset */
00045   RELOC_NUMBER (R_68K_PLT8O, 18)   /* 8 bit PLT offset */
00046   RELOC_NUMBER (R_68K_COPY, 19)           /* Copy symbol at runtime */
00047   RELOC_NUMBER (R_68K_GLOB_DAT, 20)       /* Create GOT entry */
00048   RELOC_NUMBER (R_68K_JMP_SLOT, 21)       /* Create PLT entry */
00049   RELOC_NUMBER (R_68K_RELATIVE, 22)       /* Adjust by program base */
00050   /* These are GNU extensions to enable C++ vtable garbage collection.  */
00051   RELOC_NUMBER (R_68K_GNU_VTINHERIT, 23)
00052   RELOC_NUMBER (R_68K_GNU_VTENTRY, 24)
00053 END_RELOC_NUMBERS (R_68K_max)
00054 
00055 /* We use the top 24 bits to encode information about the
00056    architecture variant.  */
00057 #define EF_M68K_CPU32    0x00810000
00058 #define EF_M68K_M68000   0x01000000
00059 #define EF_M68K_CFV4E    0x00008000
00060 #define EF_M68K_FIDO     0x02000000
00061 #define EF_M68K_ARCH_MASK                                      \
00062   (EF_M68K_M68000 | EF_M68K_CPU32 | EF_M68K_CFV4E | EF_M68K_FIDO)
00063 
00064 /* We use the bottom 8 bits to encode information about the
00065    coldfire variant.  If we use any of these bits, the top 24 bits are
00066    either 0 or EF_M68K_CFV4E.  */
00067 #define EF_M68K_CF_ISA_MASK 0x0F  /* Which ISA */
00068 #define EF_M68K_CF_ISA_A_NODIV     0x01  /* ISA A except for div */
00069 #define EF_M68K_CF_ISA_A    0x02
00070 #define EF_M68K_CF_ISA_A_PLUS      0x03
00071 #define EF_M68K_CF_ISA_B_NOUSP     0x04  /* ISA_B except for USP */
00072 #define EF_M68K_CF_ISA_B    0x05
00073 #define EF_M68K_CF_ISA_C    0x06
00074 #define EF_M68K_CF_MAC_MASK 0x30 
00075 #define EF_M68K_CF_MAC             0x10  /* MAC */
00076 #define EF_M68K_CF_EMAC            0x20  /* EMAC */
00077 #define EF_M68K_CF_EMAC_B   0x30  /* EMAC_B */
00078 #define EF_M68K_CF_FLOAT    0x40  /* Has float insns */
00079 #define EF_M68K_CF_MASK            0xFF
00080      
00081 #endif