Back to index

cell-binutils  2.17cvs20070401
m68hc11.h
Go to the documentation of this file.
00001 /* m68hc11 & m68hc12 ELF support for BFD.
00002    Copyright 1999, 2000, 2001, 2002 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_M68HC11_H
00021 #define _ELF_M68HC11_H
00022 
00023 #include "elf/reloc-macros.h"
00024 
00025 /* Relocation types.  */
00026 START_RELOC_NUMBERS (elf_m68hc11_reloc_type)
00027   RELOC_NUMBER (R_M68HC11_NONE, 0)
00028   RELOC_NUMBER (R_M68HC11_8, 1)
00029   RELOC_NUMBER (R_M68HC11_HI8, 2)
00030   RELOC_NUMBER (R_M68HC11_LO8, 3)
00031   RELOC_NUMBER (R_M68HC11_PCREL_8, 4)
00032   RELOC_NUMBER (R_M68HC11_16, 5)
00033   RELOC_NUMBER (R_M68HC11_32, 6)
00034   RELOC_NUMBER (R_M68HC11_3B, 7)
00035   RELOC_NUMBER (R_M68HC11_PCREL_16, 8)
00036 
00037      /* These are GNU extensions to enable C++ vtable garbage collection.  */
00038   RELOC_NUMBER (R_M68HC11_GNU_VTINHERIT, 9)
00039   RELOC_NUMBER (R_M68HC11_GNU_VTENTRY, 10)
00040 
00041   RELOC_NUMBER (R_M68HC11_24, 11)
00042   RELOC_NUMBER (R_M68HC11_LO16, 12)
00043   RELOC_NUMBER (R_M68HC11_PAGE, 13)
00044 
00045      /* GNU extension for linker relaxation.
00046         Mark beginning of a jump instruction (any form).  */
00047   RELOC_NUMBER (R_M68HC11_RL_JUMP, 20)
00048 
00049      /* Mark beginning of Gcc relaxation group instruction.  */
00050   RELOC_NUMBER (R_M68HC11_RL_GROUP, 21)
00051 END_RELOC_NUMBERS (R_M68HC11_max)
00052 
00053 /* Processor specific flags for the ELF header e_flags field.  */
00054 
00055 /* ABI identification.  */
00056 #define EF_M68HC11_ABI  0x00000000F
00057 
00058 /* Integers are 32-bit long.  */
00059 #define E_M68HC11_I32   0x000000001
00060 
00061 /* Doubles are 64-bit long.  */
00062 #define E_M68HC11_F64   0x000000002
00063 
00064 /* Uses 68HC12 memory banks.  */
00065 #define E_M68HC12_BANKS 0x000000004
00066 
00067 #define EF_M68HC11_MACH_MASK 0xF0
00068 #define EF_M68HC11_GENERIC   0x00 /* Generic 68HC12/backward compatibility.  */
00069 #define EF_M68HC12_MACH      0x10 /* 68HC12 microcontroller.  */
00070 #define EF_M68HCS12_MACH     0x20 /* 68HCS12 microcontroller.  */
00071 #define EF_M68HC11_MACH(mach) ((mach) & EF_M68HC11_MACH_MASK)
00072 
00073 /* True if we can merge machines.  A generic HC12 can work on any proc
00074    but once we have specific code, merge is not possible.  */
00075 #define EF_M68HC11_CAN_MERGE_MACH(mach1, mach2) \
00076   ((EF_M68HC11_MACH (mach1) == EF_M68HC11_MACH (mach2)) \
00077    || (EF_M68HC11_MACH (mach1) == EF_M68HC11_GENERIC) \
00078    || (EF_M68HC11_MACH (mach2) == EF_M68HC11_GENERIC))
00079 
00080 #define EF_M68HC11_MERGE_MACH(mach1, mach2) \
00081   (((EF_M68HC11_MACH (mach1) == EF_M68HC11_MACH (mach2)) \
00082     || (EF_M68HC11_MACH (mach1) == EF_M68HC11_GENERIC)) ? \
00083       EF_M68HC11_MACH (mach2) : EF_M68HC11_MACH (mach1))
00084 
00085 
00086 /* Special values for the st_other field in the symbol table.  These
00087    are used for 68HC12 to identify far functions (must be called with
00088    'call' and returns with 'rtc').  */
00089 #define STO_M68HC12_FAR 0x80
00090 
00091 /* Identify interrupt handlers.  This is used by the debugger to
00092    correctly compute the stack frame.  */
00093 #define STO_M68HC12_INTERRUPT 0x40
00094      
00095 #endif