xref: /openbsd/gnu/usr.bin/binutils/include/elf/m32r.h (revision cf2f2c56)
1fddef416Sniklas /* M32R ELF support for BFD.
2*cf2f2c56Smiod    Copyright 1996, 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
3fddef416Sniklas 
4fddef416Sniklas    This file is part of BFD, the Binary File Descriptor library.
5fddef416Sniklas 
6fddef416Sniklas    This program is free software; you can redistribute it and/or modify
7fddef416Sniklas    it under the terms of the GNU General Public License as published by
8fddef416Sniklas    the Free Software Foundation; either version 2 of the License, or
9fddef416Sniklas    (at your option) any later version.
10fddef416Sniklas 
11fddef416Sniklas    This program is distributed in the hope that it will be useful,
12fddef416Sniklas    but WITHOUT ANY WARRANTY; without even the implied warranty of
13fddef416Sniklas    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14fddef416Sniklas    GNU General Public License for more details.
15fddef416Sniklas 
16fddef416Sniklas    You should have received a copy of the GNU General Public License
17fddef416Sniklas    along with this program; if not, write to the Free Software Foundation, Inc.,
18fddef416Sniklas    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19fddef416Sniklas 
20fddef416Sniklas #ifndef _ELF_M32R_H
21fddef416Sniklas #define _ELF_M32R_H
22fddef416Sniklas 
23f7cc78ecSespie #include "elf/reloc-macros.h"
24f7cc78ecSespie 
25f7cc78ecSespie /* Relocations.  */
26f7cc78ecSespie START_RELOC_NUMBERS (elf_m32r_reloc_type)
27f7cc78ecSespie   RELOC_NUMBER (R_M32R_NONE, 0)
28*cf2f2c56Smiod   /* REL relocations */
29*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_16, 1)		 /* For backwards compatibility. */
30*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_32, 2)		 /* For backwards compatibility. */
31*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_24, 3)		 /* For backwards compatibility. */
32*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_10_PCREL, 4)	 /* For backwards compatibility. */
33*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_18_PCREL, 5)	 /* For backwards compatibility. */
34*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_26_PCREL, 6)	 /* For backwards compatibility. */
35*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_HI16_ULO, 7)	 /* For backwards compatibility. */
36*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_HI16_SLO, 8)	 /* For backwards compatibility. */
37*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_LO16, 9)		 /* For backwards compatibility. */
38*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_SDA16, 10)	 /* For backwards compatibility. */
39*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GNU_VTINHERIT, 11)/* For backwards compatibility. */
40*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GNU_VTENTRY, 12)	 /* For backwards compatibility. */
41*cf2f2c56Smiod 
42*cf2f2c56Smiod   /* RELA relocations */
43*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_16_RELA, 33)
44*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_32_RELA, 34)
45*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_24_RELA, 35)
46*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_10_PCREL_RELA, 36)
47*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_18_PCREL_RELA, 37)
48*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_26_PCREL_RELA, 38)
49*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_HI16_ULO_RELA, 39)
50*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_HI16_SLO_RELA, 40)
51*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_LO16_RELA, 41)
52*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_SDA16_RELA, 42)
53*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_RELA_GNU_VTINHERIT, 43)
54*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_RELA_GNU_VTENTRY, 44)
55*cf2f2c56Smiod 
56*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOT24, 48)
57*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_26_PLTREL, 49)
58*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_COPY, 50)
59*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GLOB_DAT, 51)
60*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_JMP_SLOT, 52)
61*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_RELATIVE, 53)
62*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOTOFF, 54)
63*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOTPC24, 55)
64*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOT16_HI_ULO, 56)
65*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOT16_HI_SLO, 57)
66*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOT16_LO, 58)
67*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOTPC_HI_ULO, 59)
68*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOTPC_HI_SLO, 60)
69*cf2f2c56Smiod   RELOC_NUMBER (R_M32R_GOTPC_LO, 61)
705f210c2aSfgsch END_RELOC_NUMBERS (R_M32R_max)
71fddef416Sniklas 
72fddef416Sniklas /* Processor specific section indices.  These sections do not actually
73fddef416Sniklas    exist.  Symbols with a st_shndx field corresponding to one of these
74fddef416Sniklas    values have a special meaning.  */
75fddef416Sniklas 
76fddef416Sniklas /* Small common symbol.  */
77fddef416Sniklas #define SHN_M32R_SCOMMON	0xff00
78fddef416Sniklas 
79fddef416Sniklas /* Processor specific section flags.  */
80fddef416Sniklas 
81fddef416Sniklas /* This section contains sufficient relocs to be relaxed.
82fddef416Sniklas    When relaxing, even relocs of branch instructions the assembler could
83fddef416Sniklas    complete must be present because relaxing may cause the branch target to
84fddef416Sniklas    move.  */
85fddef416Sniklas #define SHF_M32R_CAN_RELAX	0x10000000
86fddef416Sniklas 
87f7cc78ecSespie /* Processor specific flags for the ELF header e_flags field.  */
88f7cc78ecSespie 
89f7cc78ecSespie /* Two bit m32r architecture field.  */
90f7cc78ecSespie #define EF_M32R_ARCH		0x30000000
91f7cc78ecSespie 
92f7cc78ecSespie /* m32r code.  */
93f7cc78ecSespie #define E_M32R_ARCH		0x00000000
94f7cc78ecSespie /* m32rx code.  */
95f7cc78ecSespie #define E_M32RX_ARCH            0x10000000
96*cf2f2c56Smiod /* m32r2 code.  */
97*cf2f2c56Smiod #define E_M32R2_ARCH            0x20000000
98*cf2f2c56Smiod 
99*cf2f2c56Smiod /* 12 bit m32r new instructions field.  */
100*cf2f2c56Smiod #define EF_M32R_INST            0x0FFF0000
101*cf2f2c56Smiod /* Parallel instructions.  */
102*cf2f2c56Smiod #define E_M32R_HAS_PARALLEL     0x00010000
103*cf2f2c56Smiod /* Hidden instructions for m32rx:
104*cf2f2c56Smiod    jc, jnc, macwhi-a, macwlo-a, mulwhi-a, mulwlo-a, sth+, shb+, sat, pcmpbz,
105*cf2f2c56Smiod    sc, snc.  */
106*cf2f2c56Smiod #define E_M32R_HAS_HIDDEN_INST  0x00020000
107*cf2f2c56Smiod /* New bit instructions:
108*cf2f2c56Smiod    clrpsw, setpsw, bset, bclr, btst.  */
109*cf2f2c56Smiod #define E_M32R_HAS_BIT_INST     0x00040000
110*cf2f2c56Smiod /* Floating point instructions.  */
111*cf2f2c56Smiod #define E_M32R_HAS_FLOAT_INST   0x00080000
112*cf2f2c56Smiod 
113*cf2f2c56Smiod /* 4 bit m32r ignore to check field.  */
114*cf2f2c56Smiod #define EF_M32R_IGNORE          0x0000000F
115f7cc78ecSespie 
116fddef416Sniklas #endif
117