1*a9fa9459Szrj /* m68hc11 & m68hc12 ELF support for BFD. 2*a9fa9459Szrj Copyright (C) 1999-2016 Free Software Foundation, Inc. 3*a9fa9459Szrj 4*a9fa9459Szrj This file is part of BFD, the Binary File Descriptor library. 5*a9fa9459Szrj 6*a9fa9459Szrj This program is free software; you can redistribute it and/or modify 7*a9fa9459Szrj it under the terms of the GNU General Public License as published by 8*a9fa9459Szrj the Free Software Foundation; either version 3 of the License, or 9*a9fa9459Szrj (at your option) any later version. 10*a9fa9459Szrj 11*a9fa9459Szrj This program is distributed in the hope that it will be useful, 12*a9fa9459Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of 13*a9fa9459Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*a9fa9459Szrj GNU General Public License for more details. 15*a9fa9459Szrj 16*a9fa9459Szrj You should have received a copy of the GNU General Public License 17*a9fa9459Szrj along with this program; if not, write to the Free Software Foundation, 18*a9fa9459Szrj Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 19*a9fa9459Szrj 20*a9fa9459Szrj #ifndef _ELF_M68HC11_H 21*a9fa9459Szrj #define _ELF_M68HC11_H 22*a9fa9459Szrj 23*a9fa9459Szrj #include "elf/reloc-macros.h" 24*a9fa9459Szrj 25*a9fa9459Szrj /* Relocation types. */ 26*a9fa9459Szrj START_RELOC_NUMBERS (elf_m68hc11_reloc_type) 27*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_NONE, 0) 28*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_8, 1) 29*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_HI8, 2) 30*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_LO8, 3) 31*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_PCREL_8, 4) 32*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_16, 5) 33*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_32, 6) 34*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_3B, 7) 35*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_PCREL_16, 8) 36*a9fa9459Szrj 37*a9fa9459Szrj /* These are GNU extensions to enable C++ vtable garbage collection. */ 38*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_GNU_VTINHERIT, 9) 39*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_GNU_VTENTRY, 10) 40*a9fa9459Szrj 41*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_24, 11) 42*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_LO16, 12) 43*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_PAGE, 13) 44*a9fa9459Szrj 45*a9fa9459Szrj RELOC_NUMBER (R_M68HC12_16B, 15) 46*a9fa9459Szrj RELOC_NUMBER (R_M68HC12_PCREL_9, 16) 47*a9fa9459Szrj RELOC_NUMBER (R_M68HC12_PCREL_10, 17) 48*a9fa9459Szrj RELOC_NUMBER (R_M68HC12_HI8XG, 18) 49*a9fa9459Szrj RELOC_NUMBER (R_M68HC12_LO8XG, 19) 50*a9fa9459Szrj 51*a9fa9459Szrj /* GNU extension for linker relaxation. 52*a9fa9459Szrj Mark beginning of a jump instruction (any form). */ 53*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_RL_JUMP, 20) 54*a9fa9459Szrj 55*a9fa9459Szrj /* Mark beginning of Gcc relaxation group instruction. */ 56*a9fa9459Szrj RELOC_NUMBER (R_M68HC11_RL_GROUP, 21) 57*a9fa9459Szrj END_RELOC_NUMBERS (R_M68HC11_max) 58*a9fa9459Szrj 59*a9fa9459Szrj /* Processor specific flags for the ELF header e_flags field. */ 60*a9fa9459Szrj 61*a9fa9459Szrj /* ABI identification. */ 62*a9fa9459Szrj #define EF_M68HC11_ABI 0x00000000F 63*a9fa9459Szrj 64*a9fa9459Szrj /* Integers are 32-bit long. */ 65*a9fa9459Szrj #define E_M68HC11_I32 0x000000001 66*a9fa9459Szrj 67*a9fa9459Szrj /* Doubles are 64-bit long. */ 68*a9fa9459Szrj #define E_M68HC11_F64 0x000000002 69*a9fa9459Szrj 70*a9fa9459Szrj /* Uses 68HC12 memory banks. */ 71*a9fa9459Szrj #define E_M68HC12_BANKS 0x000000004 72*a9fa9459Szrj 73*a9fa9459Szrj /* XGATE ram offsetting. */ 74*a9fa9459Szrj #define E_M68HC11_XGATE_RAMOFFSET 0x000000100 75*a9fa9459Szrj 76*a9fa9459Szrj /* Suppress warnings */ 77*a9fa9459Szrj #define E_M68HC11_NO_BANK_WARNING 0x000000200 78*a9fa9459Szrj 79*a9fa9459Szrj #define EF_M68HC11_MACH_MASK 0xF0 80*a9fa9459Szrj #define EF_M68HC11_GENERIC 0x00 /* Generic 68HC12/backward compatibility. */ 81*a9fa9459Szrj #define EF_M68HC12_MACH 0x10 /* 68HC12 microcontroller. */ 82*a9fa9459Szrj #define EF_M68HCS12_MACH 0x20 /* 68HCS12 microcontroller. */ 83*a9fa9459Szrj #define EF_M68HC11_MACH(mach) ((mach) & EF_M68HC11_MACH_MASK) 84*a9fa9459Szrj 85*a9fa9459Szrj /* True if we can merge machines. A generic HC12 can work on any proc 86*a9fa9459Szrj but once we have specific code, merge is not possible. */ 87*a9fa9459Szrj #define EF_M68HC11_CAN_MERGE_MACH(mach1, mach2) \ 88*a9fa9459Szrj ((EF_M68HC11_MACH (mach1) == EF_M68HC11_MACH (mach2)) \ 89*a9fa9459Szrj || (EF_M68HC11_MACH (mach1) == EF_M68HC11_GENERIC) \ 90*a9fa9459Szrj || (EF_M68HC11_MACH (mach2) == EF_M68HC11_GENERIC)) 91*a9fa9459Szrj 92*a9fa9459Szrj #define EF_M68HC11_MERGE_MACH(mach1, mach2) \ 93*a9fa9459Szrj (((EF_M68HC11_MACH (mach1) == EF_M68HC11_MACH (mach2)) \ 94*a9fa9459Szrj || (EF_M68HC11_MACH (mach1) == EF_M68HC11_GENERIC)) ? \ 95*a9fa9459Szrj EF_M68HC11_MACH (mach2) : EF_M68HC11_MACH (mach1)) 96*a9fa9459Szrj 97*a9fa9459Szrj 98*a9fa9459Szrj /* Special values for the st_other field in the symbol table. These 99*a9fa9459Szrj are used for 68HC12 to identify far functions (must be called with 100*a9fa9459Szrj 'call' and returns with 'rtc'). */ 101*a9fa9459Szrj #define STO_M68HC12_FAR 0x80 102*a9fa9459Szrj 103*a9fa9459Szrj /* Identify interrupt handlers. This is used by the debugger to 104*a9fa9459Szrj correctly compute the stack frame. */ 105*a9fa9459Szrj #define STO_M68HC12_INTERRUPT 0x40 106*a9fa9459Szrj 107*a9fa9459Szrj #endif 108