xref: /netbsd-src/external/gpl3/gdb/dist/include/elf/mep.h (revision 02f41505626a9ceb584d30d0789203495760ac88)
198b9484cSchristos /* Toshiba MeP ELF support for BFD.
2*02f41505Schristos    Copyright (C) 2001-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This file is part of BFD, the Binary File Descriptor library.
598b9484cSchristos 
698b9484cSchristos    This program is free software; you can redistribute it and/or modify
798b9484cSchristos    it under the terms of the GNU General Public License as published by
898b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
998b9484cSchristos    (at your option) any later version.
1098b9484cSchristos 
1198b9484cSchristos    This program is distributed in the hope that it will be useful,
1298b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1398b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1498b9484cSchristos    GNU General Public License for more details.
1598b9484cSchristos 
1698b9484cSchristos    You should have received a copy of the GNU General Public License
1798b9484cSchristos    along with this program; if not, write to the Free Software Foundation,
1898b9484cSchristos    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
1998b9484cSchristos 
2098b9484cSchristos #ifndef _ELF_MEP_H
2198b9484cSchristos #define _ELF_MEP_H
2298b9484cSchristos 
2398b9484cSchristos /* Bits in the sh_flags field of Elf32_Shdr:  */
2498b9484cSchristos 
2598b9484cSchristos #define SHF_MEP_VLIW		0x10000000	/* contains vliw code */
2698b9484cSchristos 
2798b9484cSchristos #include "elf/reloc-macros.h"
2898b9484cSchristos 
2998b9484cSchristos /* Note: The comments in this file are used by bfd/mep-relocs.pl to
3098b9484cSchristos    build parts of bfd/elf32-mep.c.  */
3198b9484cSchristos 
3298b9484cSchristos /* Relocations.  */
3398b9484cSchristos START_RELOC_NUMBERS (elf_mep_reloc_type)
3498b9484cSchristos 
3598b9484cSchristos   /* These two must appear first so that they are not processed by bfd/mep-relocs.pl.  */
3698b9484cSchristos   RELOC_NUMBER (R_MEP_NONE, 0)
3798b9484cSchristos   RELOC_NUMBER (R_RELC, 1)
3898b9484cSchristos 
3998b9484cSchristos   RELOC_NUMBER (R_MEP_8, 2)		/* 7654 3210                               U */
4098b9484cSchristos   RELOC_NUMBER (R_MEP_16, 3)		/* fedc ba98 7654 3210                     U */
4198b9484cSchristos   RELOC_NUMBER (R_MEP_32, 4)		/* vuts rqpo nmlk jihg fedc ba98 7654 3210 U */
4298b9484cSchristos 
4398b9484cSchristos   RELOC_NUMBER (R_MEP_PCREL8A2, 5)	/* ---- ---- 7654 321-                     S PC-REL */
4498b9484cSchristos   RELOC_NUMBER (R_MEP_PCREL12A2, 6)	/* ---- ba98 7654 321-                     S PC-REL */
4598b9484cSchristos   RELOC_NUMBER (R_MEP_PCREL17A2, 7)	/* ---- ---- ---- ---- gfed cba9 8765 4321 S PC-REL */
4698b9484cSchristos   RELOC_NUMBER (R_MEP_PCREL24A2, 8)	/* ---- -765 4321 ---- nmlk jihg fedc ba98 S PC-REL */
4798b9484cSchristos   RELOC_NUMBER (R_MEP_PCABS24A2, 9)	/* ---- -765 4321 ---- nmlk jihg fedc ba98 U */
4898b9484cSchristos 
4998b9484cSchristos   RELOC_NUMBER (R_MEP_LOW16, 10)	/* ---- ---- ---- ---- fedc ba98 7654 3210 U no-overflow */
5098b9484cSchristos   RELOC_NUMBER (R_MEP_HI16U, 11)	/* ---- ---- ---- ---- vuts rqpo nmlk jihg U no-overflow */
5198b9484cSchristos   RELOC_NUMBER (R_MEP_HI16S, 12)	/* ---- ---- ---- ---- vuts rqpo nmlk jihg S no-overflow */
5298b9484cSchristos   RELOC_NUMBER (R_MEP_GPREL, 13)	/* ---- ---- ---- ---- fedc ba98 7654 3210 S GP-REL*/
5398b9484cSchristos   RELOC_NUMBER (R_MEP_TPREL, 14)	/* ---- ---- ---- ---- fedc ba98 7654 3210 S TP-REL*/
5498b9484cSchristos 
5598b9484cSchristos   RELOC_NUMBER (R_MEP_TPREL7, 15)	/* ---- ---- -654 3210                     U TP-REL */
5698b9484cSchristos   RELOC_NUMBER (R_MEP_TPREL7A2, 16)	/* ---- ---- -654 321-                     U TP-REL */
5798b9484cSchristos   RELOC_NUMBER (R_MEP_TPREL7A4, 17)	/* ---- ---- -654 32--                     U TP-REL */
5898b9484cSchristos 
5998b9484cSchristos   RELOC_NUMBER (R_MEP_UIMM24, 18)	/* ---- ---- 7654 3210 nmlk jihg fedc ba98 U */
6098b9484cSchristos   RELOC_NUMBER (R_MEP_ADDR24A4, 19)	/* ---- ---- 7654 32-- nmlk jihg fedc ba98 U */
6198b9484cSchristos 
6298b9484cSchristos   RELOC_NUMBER (R_MEP_GNU_VTINHERIT, 20) /* ---- ---- ---- ----                     U no-overflow */
6398b9484cSchristos   RELOC_NUMBER (R_MEP_GNU_VTENTRY, 21)   /* ---- ---- ---- ----                     U no-overflow */
6498b9484cSchristos 
6598b9484cSchristos END_RELOC_NUMBERS(R_MEP_max)
6698b9484cSchristos 
6798b9484cSchristos #define	EF_MEP_CPU_MASK		0xff000000	/* specific cpu bits */
6898b9484cSchristos #define EF_MEP_CPU_MEP          0x00000000	/* generic MEP */
6998b9484cSchristos #define EF_MEP_CPU_C2   	0x01000000	/* MEP c2 */
7098b9484cSchristos #define EF_MEP_CPU_C3   	0x02000000	/* MEP c3 */
7198b9484cSchristos #define EF_MEP_CPU_C4   	0x04000000	/* MEP c4 */
7298b9484cSchristos /* 5..7 are reseved */
7398b9484cSchristos #define EF_MEP_CPU_C5   	0x08000000	/* MEP c5 */
7498b9484cSchristos #define EF_MEP_CPU_H1   	0x10000000	/* MEP h1 */
7598b9484cSchristos 
7698b9484cSchristos #define EF_MEP_COP_MASK		0x00ff0000
7798b9484cSchristos #define EF_MEP_COP_NONE		0x00000000
7898b9484cSchristos #define EF_MEP_COP_AVC		0x00010000
7998b9484cSchristos #define EF_MEP_COP_AVC2		0x00020000
8098b9484cSchristos #define EF_MEP_COP_FMAX		0x00030000
8198b9484cSchristos /* 4..5 are reserved.  */
8298b9484cSchristos #define EF_MEP_COP_IVC2		0x00060000
8398b9484cSchristos 
8498b9484cSchristos #define EF_MEP_LIBRARY		0x00000100	/* Built as a library */
8598b9484cSchristos 
8698b9484cSchristos #define EF_MEP_INDEX_MASK       0x000000ff      /* Configuration index */
8798b9484cSchristos 
8898b9484cSchristos #define EF_MEP_ALL_FLAGS	0xffff01ff
8998b9484cSchristos 
9098b9484cSchristos #endif /* _ELF_MEP_H */
91