xref: /netbsd-src/external/gpl3/gdb/dist/include/elf/epiphany.h (revision 02f41505626a9ceb584d30d0789203495760ac88)
1a2e2270fSchristos /* Adapteva EPIPHANY ELF support for BFD.
2*02f41505Schristos    Copyright (C) 2009-2024 Free Software Foundation, Inc.
3a2e2270fSchristos    Contributed by Embecosm on behalf of Adapteva, Inc.
4a2e2270fSchristos 
5a2e2270fSchristos    This file is part of BFD, the Binary File Descriptor library.
6a2e2270fSchristos 
7a2e2270fSchristos    This program is free software; you can redistribute it and/or modify
8a2e2270fSchristos    it under the terms of the GNU General Public License as published by
9a2e2270fSchristos    the Free Software Foundation; either version 3 of the License, or
10a2e2270fSchristos    (at your option) any later version.
11a2e2270fSchristos 
12a2e2270fSchristos    This program is distributed in the hope that it will be useful,
13a2e2270fSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
14a2e2270fSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15a2e2270fSchristos    GNU General Public License for more details.
16a2e2270fSchristos 
17a2e2270fSchristos    You should have received a copy of the GNU General Public License
18a2e2270fSchristos    along with this program; if not, write to the Free Software Foundation,
19a2e2270fSchristos    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
20a2e2270fSchristos 
21a2e2270fSchristos #ifndef _ELF_EPIPHANY_H
22a2e2270fSchristos #define _ELF_EPIPHANY_H
23a2e2270fSchristos 
24a2e2270fSchristos #include "elf/reloc-macros.h"
25a2e2270fSchristos 
26a2e2270fSchristos /* Relocations.  */
27a2e2270fSchristos START_RELOC_NUMBERS (elf_epiphany_reloc_type)
28a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_NONE,    0)
29a2e2270fSchristos 
30a2e2270fSchristos   /* Absolute address relocations.  */
31a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_8,       1)
32a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_16,      2)
33a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_32,      3)
34a2e2270fSchristos 
35a2e2270fSchristos   /* PC-relative relocations.  */
36a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_8_PCREL, 4)
37a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_16_PCREL,5)
38a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_32_PCREL,6)
39a2e2270fSchristos 
40a2e2270fSchristos   /* special forms for 8/24 bit branch displacements.  */
41a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_SIMM8,   7)
42a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_SIMM24,  8)
43a2e2270fSchristos 
44a2e2270fSchristos   /* HIGH and LOW relocations taking part of a 32 bit address and
45a2e2270fSchristos      depositing it into the IMM16 field of a destination.  */
46a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_HIGH, 9)
47a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_LOW,10)
48a2e2270fSchristos 
49a2e2270fSchristos   /* 11 bit signed immediate value.  */
50a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_SIMM11, 11)
51a2e2270fSchristos   /* 11 bit magnitude addressing displacement.  */
52a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_IMM11, 12)
53a2e2270fSchristos 
54a2e2270fSchristos   /* 8 bit immediate for MOV.S R,IMM8.  */
55a2e2270fSchristos   RELOC_NUMBER (R_EPIPHANY_IMM8, 13)
56a2e2270fSchristos 
57a2e2270fSchristos END_RELOC_NUMBERS(R_EPIPHANY_max)
58a2e2270fSchristos 
59a2e2270fSchristos #endif /* _ELF_EPIPHANY_H */
60