1 1.1 christos /* Toshiba MeP ELF support for BFD. 2 1.10 christos Copyright (C) 2001-2025 Free Software Foundation, Inc. 3 1.1 christos 4 1.1 christos This file is part of BFD, the Binary File Descriptor library. 5 1.1 christos 6 1.1 christos This program is free software; you can redistribute it and/or modify 7 1.1 christos it under the terms of the GNU General Public License as published by 8 1.1 christos the Free Software Foundation; either version 3 of the License, or 9 1.1 christos (at your option) any later version. 10 1.1 christos 11 1.1 christos This program is distributed in the hope that it will be useful, 12 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of 13 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 1.1 christos GNU General Public License for more details. 15 1.1 christos 16 1.1 christos You should have received a copy of the GNU General Public License 17 1.1 christos along with this program; if not, write to the Free Software Foundation, 18 1.1 christos Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 19 1.1 christos 20 1.1 christos #ifndef _ELF_MEP_H 21 1.1 christos #define _ELF_MEP_H 22 1.1 christos 23 1.1 christos /* Bits in the sh_flags field of Elf32_Shdr: */ 24 1.1 christos 25 1.1 christos #define SHF_MEP_VLIW 0x10000000 /* contains vliw code */ 26 1.1 christos 27 1.1 christos #include "elf/reloc-macros.h" 28 1.1 christos 29 1.1 christos /* Note: The comments in this file are used by bfd/mep-relocs.pl to 30 1.1 christos build parts of bfd/elf32-mep.c. */ 31 1.1 christos 32 1.1 christos /* Relocations. */ 33 1.1 christos START_RELOC_NUMBERS (elf_mep_reloc_type) 34 1.1 christos 35 1.1 christos /* These two must appear first so that they are not processed by bfd/mep-relocs.pl. */ 36 1.1 christos RELOC_NUMBER (R_MEP_NONE, 0) 37 1.1 christos RELOC_NUMBER (R_RELC, 1) 38 1.1 christos 39 1.1 christos RELOC_NUMBER (R_MEP_8, 2) /* 7654 3210 U */ 40 1.1 christos RELOC_NUMBER (R_MEP_16, 3) /* fedc ba98 7654 3210 U */ 41 1.1 christos RELOC_NUMBER (R_MEP_32, 4) /* vuts rqpo nmlk jihg fedc ba98 7654 3210 U */ 42 1.1 christos 43 1.1 christos RELOC_NUMBER (R_MEP_PCREL8A2, 5) /* ---- ---- 7654 321- S PC-REL */ 44 1.1 christos RELOC_NUMBER (R_MEP_PCREL12A2, 6) /* ---- ba98 7654 321- S PC-REL */ 45 1.1 christos RELOC_NUMBER (R_MEP_PCREL17A2, 7) /* ---- ---- ---- ---- gfed cba9 8765 4321 S PC-REL */ 46 1.1 christos RELOC_NUMBER (R_MEP_PCREL24A2, 8) /* ---- -765 4321 ---- nmlk jihg fedc ba98 S PC-REL */ 47 1.1 christos RELOC_NUMBER (R_MEP_PCABS24A2, 9) /* ---- -765 4321 ---- nmlk jihg fedc ba98 U */ 48 1.1 christos 49 1.1 christos RELOC_NUMBER (R_MEP_LOW16, 10) /* ---- ---- ---- ---- fedc ba98 7654 3210 U no-overflow */ 50 1.1 christos RELOC_NUMBER (R_MEP_HI16U, 11) /* ---- ---- ---- ---- vuts rqpo nmlk jihg U no-overflow */ 51 1.1 christos RELOC_NUMBER (R_MEP_HI16S, 12) /* ---- ---- ---- ---- vuts rqpo nmlk jihg S no-overflow */ 52 1.1 christos RELOC_NUMBER (R_MEP_GPREL, 13) /* ---- ---- ---- ---- fedc ba98 7654 3210 S GP-REL*/ 53 1.1 christos RELOC_NUMBER (R_MEP_TPREL, 14) /* ---- ---- ---- ---- fedc ba98 7654 3210 S TP-REL*/ 54 1.1 christos 55 1.1 christos RELOC_NUMBER (R_MEP_TPREL7, 15) /* ---- ---- -654 3210 U TP-REL */ 56 1.1 christos RELOC_NUMBER (R_MEP_TPREL7A2, 16) /* ---- ---- -654 321- U TP-REL */ 57 1.1 christos RELOC_NUMBER (R_MEP_TPREL7A4, 17) /* ---- ---- -654 32-- U TP-REL */ 58 1.1 christos 59 1.1 christos RELOC_NUMBER (R_MEP_UIMM24, 18) /* ---- ---- 7654 3210 nmlk jihg fedc ba98 U */ 60 1.1 christos RELOC_NUMBER (R_MEP_ADDR24A4, 19) /* ---- ---- 7654 32-- nmlk jihg fedc ba98 U */ 61 1.1 christos 62 1.1 christos RELOC_NUMBER (R_MEP_GNU_VTINHERIT, 20) /* ---- ---- ---- ---- U no-overflow */ 63 1.1 christos RELOC_NUMBER (R_MEP_GNU_VTENTRY, 21) /* ---- ---- ---- ---- U no-overflow */ 64 1.1 christos 65 1.1 christos END_RELOC_NUMBERS(R_MEP_max) 66 1.1 christos 67 1.1 christos #define EF_MEP_CPU_MASK 0xff000000 /* specific cpu bits */ 68 1.1 christos #define EF_MEP_CPU_MEP 0x00000000 /* generic MEP */ 69 1.1 christos #define EF_MEP_CPU_C2 0x01000000 /* MEP c2 */ 70 1.1 christos #define EF_MEP_CPU_C3 0x02000000 /* MEP c3 */ 71 1.1 christos #define EF_MEP_CPU_C4 0x04000000 /* MEP c4 */ 72 1.1 christos /* 5..7 are reseved */ 73 1.1 christos #define EF_MEP_CPU_C5 0x08000000 /* MEP c5 */ 74 1.1 christos #define EF_MEP_CPU_H1 0x10000000 /* MEP h1 */ 75 1.1 christos 76 1.1 christos #define EF_MEP_COP_MASK 0x00ff0000 77 1.1 christos #define EF_MEP_COP_NONE 0x00000000 78 1.1 christos #define EF_MEP_COP_AVC 0x00010000 79 1.1 christos #define EF_MEP_COP_AVC2 0x00020000 80 1.1 christos #define EF_MEP_COP_FMAX 0x00030000 81 1.1 christos /* 4..5 are reserved. */ 82 1.1 christos #define EF_MEP_COP_IVC2 0x00060000 83 1.1 christos 84 1.1 christos #define EF_MEP_LIBRARY 0x00000100 /* Built as a library */ 85 1.1 christos 86 1.1 christos #define EF_MEP_INDEX_MASK 0x000000ff /* Configuration index */ 87 1.1 christos 88 1.1 christos #define EF_MEP_ALL_FLAGS 0xffff01ff 89 1.1 christos 90 1.1 christos #endif /* _ELF_MEP_H */ 91