Back to index

cell-binutils  2.17cvs20070401
m32c.h
Go to the documentation of this file.
00001 /* M32C ELF support for BFD.
00002    Copyright (C) 2004 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, Inc.,
00018 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00019 
00020 #ifndef _ELF_M32C_H
00021 #define _ELF_M32C_H
00022 
00023 #include "elf/reloc-macros.h"
00024 
00025   /* Relocations.  */
00026   START_RELOC_NUMBERS (elf_m32c_reloc_type)
00027      RELOC_NUMBER (R_M32C_NONE, 0)
00028      RELOC_NUMBER (R_M32C_16, 1)
00029      RELOC_NUMBER (R_M32C_24, 2)
00030      RELOC_NUMBER (R_M32C_32, 3)
00031      RELOC_NUMBER (R_M32C_8_PCREL, 4)
00032      RELOC_NUMBER (R_M32C_16_PCREL, 5)
00033 
00034     /* 8 bit unsigned address, used for dsp8[a0] etc */
00035      RELOC_NUMBER (R_M32C_8, 6)
00036     /* Bits 0..15 of an address, for SMOVF's A0, A1A0, etc. */
00037      RELOC_NUMBER (R_M32C_LO16, 7)
00038     /* Bits 16..23 of an address, for SMOVF's R1H etc. */
00039      RELOC_NUMBER (R_M32C_HI8, 8)
00040     /* Bits 16..31 of an address, for LDE's A1A0 etc. */
00041      RELOC_NUMBER (R_M32C_HI16, 9)
00042 
00043     /* These are relocs we need when relaxing.  */
00044     /* Marks various jump opcodes.  */
00045      RELOC_NUMBER (R_M32C_RL_JUMP, 10)
00046     /* Marks standard one-address form.  */
00047      RELOC_NUMBER (R_M32C_RL_1ADDR, 11)
00048     /* Marks standard two-address form.  */
00049      RELOC_NUMBER (R_M32C_RL_2ADDR, 12)
00050 
00051      END_RELOC_NUMBERS (R_M32C_max)
00052 
00053 #define EF_M32C_CPU_M16C    0x00000075      /* default */
00054 #define EF_M32C_CPU_M32C        0x00000078      /* m32c */
00055 #define EF_M32C_CPU_MASK    0x0000007F    /* specific cpu bits */
00056 #define EF_M32C_ALL_FLAGS   (EF_M32C_CPU_MASK)
00057 
00058 /* Define the data & instruction memory discriminator.  In a linked
00059    executable, an symbol should be deemed to point to an instruction
00060    if ((address & M16C_INSN_MASK) == M16C_INSN_VALUE), and similarly
00061    for the data space.  See also `ld/emulparams/elf32m32c.sh'.  */
00062 #define M32C_DATA_MASK   0xffc00000
00063 #define M32C_DATA_VALUE  0x00000000
00064 #define M32C_INSN_MASK   0xffc00000
00065 #define M32C_INSN_VALUE  0x00400000
00066 
00067 #endif /* _ELF_M32C_H */