Subversion Repositories Kolibri OS

Rev

Rev 5191 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5191 Rev 6324
1
/* CR16C ELF support for BFD.
1
/* CR16C ELF support for BFD.
2
   Copyright 2004, 2008, 2010 Free Software Foundation, Inc.
2
   Copyright (C) 2004-2015 Free Software Foundation, Inc.
3
 
3
 
4
   This file is part of BFD, the Binary File Descriptor library.
4
   This file is part of BFD, the Binary File Descriptor library.
5
 
5
 
6
   This program is free software; you can redistribute it and/or modify
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 3 of the License, or
8
   the Free Software Foundation; either version 3 of the License, or
9
   (at your option) any later version.
9
   (at your option) any later version.
10
 
10
 
11
   This program is distributed in the hope that it will be useful,
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
14
   GNU General Public License for more details.
15
 
15
 
16
   You should have received a copy of the GNU General Public License
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software Foundation,
17
   along with this program; if not, write to the Free Software Foundation,
18
   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
18
   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
19
 
19
 
20
#ifndef _ELF_CR16C_H
20
#ifndef _ELF_CR16C_H
21
#define _ELF_CR16C_H
21
#define _ELF_CR16C_H
22
 
22
 
23
#include "bfd.h"
23
#include "bfd.h"
24
#include "elf/reloc-macros.h"
24
#include "elf/reloc-macros.h"
25
 
25
 
26
/* Creating indices for reloc_map_index array.  */
26
/* Creating indices for reloc_map_index array.  */
27
START_RELOC_NUMBERS (elf_cr16c_reloc_type)
27
START_RELOC_NUMBERS (elf_cr16c_reloc_type)
28
     RELOC_NUMBER (RINDEX_16C_NUM08,		0)
28
     RELOC_NUMBER (RINDEX_16C_NUM08,		0)
29
     RELOC_NUMBER (RINDEX_16C_NUM08_C,		1)
29
     RELOC_NUMBER (RINDEX_16C_NUM08_C,		1)
30
     RELOC_NUMBER (RINDEX_16C_NUM16,		2)
30
     RELOC_NUMBER (RINDEX_16C_NUM16,		2)
31
     RELOC_NUMBER (RINDEX_16C_NUM16_C,		3)
31
     RELOC_NUMBER (RINDEX_16C_NUM16_C,		3)
32
     RELOC_NUMBER (RINDEX_16C_NUM32,		4)
32
     RELOC_NUMBER (RINDEX_16C_NUM32,		4)
33
     RELOC_NUMBER (RINDEX_16C_NUM32_C,		5)
33
     RELOC_NUMBER (RINDEX_16C_NUM32_C,		5)
34
     RELOC_NUMBER (RINDEX_16C_DISP04,		6)
34
     RELOC_NUMBER (RINDEX_16C_DISP04,		6)
35
     RELOC_NUMBER (RINDEX_16C_DISP04_C,		7)
35
     RELOC_NUMBER (RINDEX_16C_DISP04_C,		7)
36
     RELOC_NUMBER (RINDEX_16C_DISP08,		8)
36
     RELOC_NUMBER (RINDEX_16C_DISP08,		8)
37
     RELOC_NUMBER (RINDEX_16C_DISP08_C,		9)
37
     RELOC_NUMBER (RINDEX_16C_DISP08_C,		9)
38
     RELOC_NUMBER (RINDEX_16C_DISP16,		10)
38
     RELOC_NUMBER (RINDEX_16C_DISP16,		10)
39
     RELOC_NUMBER (RINDEX_16C_DISP16_C,		11)
39
     RELOC_NUMBER (RINDEX_16C_DISP16_C,		11)
40
     RELOC_NUMBER (RINDEX_16C_DISP24,		12)
40
     RELOC_NUMBER (RINDEX_16C_DISP24,		12)
41
     RELOC_NUMBER (RINDEX_16C_DISP24_C,		13)
41
     RELOC_NUMBER (RINDEX_16C_DISP24_C,		13)
42
     RELOC_NUMBER (RINDEX_16C_DISP24a,		14)
42
     RELOC_NUMBER (RINDEX_16C_DISP24a,		14)
43
     RELOC_NUMBER (RINDEX_16C_DISP24a_C,	15)
43
     RELOC_NUMBER (RINDEX_16C_DISP24a_C,	15)
44
     RELOC_NUMBER (RINDEX_16C_REG04,		16)
44
     RELOC_NUMBER (RINDEX_16C_REG04,		16)
45
     RELOC_NUMBER (RINDEX_16C_REG04_C,		17)
45
     RELOC_NUMBER (RINDEX_16C_REG04_C,		17)
46
     RELOC_NUMBER (RINDEX_16C_REG04a,		18)
46
     RELOC_NUMBER (RINDEX_16C_REG04a,		18)
47
     RELOC_NUMBER (RINDEX_16C_REG04a_C,		19)
47
     RELOC_NUMBER (RINDEX_16C_REG04a_C,		19)
48
     RELOC_NUMBER (RINDEX_16C_REG14,		20)
48
     RELOC_NUMBER (RINDEX_16C_REG14,		20)
49
     RELOC_NUMBER (RINDEX_16C_REG14_C,		21)
49
     RELOC_NUMBER (RINDEX_16C_REG14_C,		21)
50
     RELOC_NUMBER (RINDEX_16C_REG16,		22)
50
     RELOC_NUMBER (RINDEX_16C_REG16,		22)
51
     RELOC_NUMBER (RINDEX_16C_REG16_C,		23)
51
     RELOC_NUMBER (RINDEX_16C_REG16_C,		23)
52
     RELOC_NUMBER (RINDEX_16C_REG20,		24)
52
     RELOC_NUMBER (RINDEX_16C_REG20,		24)
53
     RELOC_NUMBER (RINDEX_16C_REG20_C,		25)
53
     RELOC_NUMBER (RINDEX_16C_REG20_C,		25)
54
     RELOC_NUMBER (RINDEX_16C_ABS20,		26)
54
     RELOC_NUMBER (RINDEX_16C_ABS20,		26)
55
     RELOC_NUMBER (RINDEX_16C_ABS20_C,		27)
55
     RELOC_NUMBER (RINDEX_16C_ABS20_C,		27)
56
     RELOC_NUMBER (RINDEX_16C_ABS24,		28)
56
     RELOC_NUMBER (RINDEX_16C_ABS24,		28)
57
     RELOC_NUMBER (RINDEX_16C_ABS24_C,		29)
57
     RELOC_NUMBER (RINDEX_16C_ABS24_C,		29)
58
     RELOC_NUMBER (RINDEX_16C_IMM04,		30)
58
     RELOC_NUMBER (RINDEX_16C_IMM04,		30)
59
     RELOC_NUMBER (RINDEX_16C_IMM04_C,		31)
59
     RELOC_NUMBER (RINDEX_16C_IMM04_C,		31)
60
     RELOC_NUMBER (RINDEX_16C_IMM16,		32)
60
     RELOC_NUMBER (RINDEX_16C_IMM16,		32)
61
     RELOC_NUMBER (RINDEX_16C_IMM16_C,		33)
61
     RELOC_NUMBER (RINDEX_16C_IMM16_C,		33)
62
     RELOC_NUMBER (RINDEX_16C_IMM20,		34)
62
     RELOC_NUMBER (RINDEX_16C_IMM20,		34)
63
     RELOC_NUMBER (RINDEX_16C_IMM20_C,		35)
63
     RELOC_NUMBER (RINDEX_16C_IMM20_C,		35)
64
     RELOC_NUMBER (RINDEX_16C_IMM24,		36)
64
     RELOC_NUMBER (RINDEX_16C_IMM24,		36)
65
     RELOC_NUMBER (RINDEX_16C_IMM24_C,		37)
65
     RELOC_NUMBER (RINDEX_16C_IMM24_C,		37)
66
     RELOC_NUMBER (RINDEX_16C_IMM32,		38)
66
     RELOC_NUMBER (RINDEX_16C_IMM32,		38)
67
     RELOC_NUMBER (RINDEX_16C_IMM32_C,		39)
67
     RELOC_NUMBER (RINDEX_16C_IMM32_C,		39)
68
END_RELOC_NUMBERS (RINDEX_16C_MAX)
68
END_RELOC_NUMBERS (RINDEX_16C_MAX)
69
 
69
 
70
/* CR16C Relocation Types ('cr_reloc_type' entry in the reloc_map structure).
70
/* CR16C Relocation Types ('cr_reloc_type' entry in the reloc_map structure).
71
   The relocation constant name is determined as follows :
71
   The relocation constant name is determined as follows :
72
 
72
 
73
   R_16C_[_C]
73
   R_16C_[_C]
74
 
74
 
75
   Where :
75
   Where :
76
 
76
 
77
      is one of the following:
77
      is one of the following:
78
	NUM  - R_NUMBER mnemonic,
78
	NUM  - R_NUMBER mnemonic,
79
	DISP - R_16C_DISPL mnemonic,
79
	DISP - R_16C_DISPL mnemonic,
80
	REG  - R_16C_REGREL mnemonic,
80
	REG  - R_16C_REGREL mnemonic,
81
	ABS  - R_16C_ABS mnemonic,
81
	ABS  - R_16C_ABS mnemonic,
82
	IMM  - R_16C_IMMED mnemonic,
82
	IMM  - R_16C_IMMED mnemonic,
83
      stands for R_S_16C_ 
83
      stands for R_S_16C_ 
84
     _C means 'code label' and is only added when R_ADDRTYPE subfield 
84
     _C means 'code label' and is only added when R_ADDRTYPE subfield 
85
     is of type R_CODE_ADDR.  */
85
     is of type R_CODE_ADDR.  */
86
   
86
   
87
/* The table below shows what the hex digits in the definition of the
87
/* The table below shows what the hex digits in the definition of the
88
   relocation type constants correspond to.
88
   relocation type constants correspond to.
89
   ------------------------------------------------------------------
89
   ------------------------------------------------------------------
90
	R_SIZESP	R_FORMAT	R_RELTO	      R_ADDRTYPE
90
	R_SIZESP	R_FORMAT	R_RELTO	      R_ADDRTYPE
91
   ------------------------------------------------------------------  */
91
   ------------------------------------------------------------------  */
92
/*	R_S_16C_08	R_NUMBER 	R_ABS 	      R_ADDRESS */
92
/*	R_S_16C_08	R_NUMBER 	R_ABS 	      R_ADDRESS */
93
#define R_16C_NUM08	0X0001
93
#define R_16C_NUM08	0X0001
94
 
94
 
95
/*	R_S_16C_08	R_NUMBER 	R_ABS 	      R_CODE_ADDR */
95
/*	R_S_16C_08	R_NUMBER 	R_ABS 	      R_CODE_ADDR */
96
#define R_16C_NUM08_C	0X0006
96
#define R_16C_NUM08_C	0X0006
97
 
97
 
98
/*	R_S_16C_16	R_NUMBER 	R_ABS 	      R_ADDRESS */
98
/*	R_S_16C_16	R_NUMBER 	R_ABS 	      R_ADDRESS */
99
#define R_16C_NUM16	0X1001
99
#define R_16C_NUM16	0X1001
100
 
100
 
101
/*	R_S_16C_16	R_NUMBER 	R_ABS 	      R_CODE_ADDR */
101
/*	R_S_16C_16	R_NUMBER 	R_ABS 	      R_CODE_ADDR */
102
#define R_16C_NUM16_C 	0X1006
102
#define R_16C_NUM16_C 	0X1006
103
 
103
 
104
/*      R_S_16C_32      R_NUMBER	R_ABS	      R_ADDRESS */
104
/*      R_S_16C_32      R_NUMBER	R_ABS	      R_ADDRESS */
105
#define R_16C_NUM32     0X2001
105
#define R_16C_NUM32     0X2001
106
 
106
 
107
/*      R_S_16C_32      R_NUMBER	R_ABS	      R_CODE_ADDR */
107
/*      R_S_16C_32      R_NUMBER	R_ABS	      R_CODE_ADDR */
108
#define R_16C_NUM32_C   0X2006
108
#define R_16C_NUM32_C   0X2006
109
 
109
 
110
/*	R_S_16C_04	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
110
/*	R_S_16C_04	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
111
#define R_16C_DISP04	0X5411
111
#define R_16C_DISP04	0X5411
112
 
112
 
113
/*	R_S_16C_04	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
113
/*	R_S_16C_04	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
114
#define R_16C_DISP04_C	0X5416
114
#define R_16C_DISP04_C	0X5416
115
 
115
 
116
/*	R_S_16C_08	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
116
/*	R_S_16C_08	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
117
#define R_16C_DISP08	0X0411
117
#define R_16C_DISP08	0X0411
118
 
118
 
119
/*	R_S_16C_08	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
119
/*	R_S_16C_08	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
120
#define R_16C_DISP08_C	0X0416
120
#define R_16C_DISP08_C	0X0416
121
 
121
 
122
/*	R_S_16C_16	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
122
/*	R_S_16C_16	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
123
#define R_16C_DISP16	0X1411
123
#define R_16C_DISP16	0X1411
124
 
124
 
125
/*	R_S_16C_16	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
125
/*	R_S_16C_16	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
126
#define R_16C_DISP16_C	0X1416
126
#define R_16C_DISP16_C	0X1416
127
 
127
 
128
/*	R_S_16C_24	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
128
/*	R_S_16C_24	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
129
#define R_16C_DISP24	0X7411
129
#define R_16C_DISP24	0X7411
130
 
130
 
131
/*	R_S_16C_24	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
131
/*	R_S_16C_24	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
132
#define R_16C_DISP24_C	0X7416
132
#define R_16C_DISP24_C	0X7416
133
 
133
 
134
/*	R_S_16C_24a	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
134
/*	R_S_16C_24a	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
135
#define R_16C_DISP24a	0X6411
135
#define R_16C_DISP24a	0X6411
136
 
136
 
137
/*	R_S_16C_24a	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
137
/*	R_S_16C_24a	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
138
#define R_16C_DISP24a_C	0X6416
138
#define R_16C_DISP24a_C	0X6416
139
 
139
 
140
/*	R_S_16C_04	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
140
/*	R_S_16C_04	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
141
#define R_16C_REG04	0X5201
141
#define R_16C_REG04	0X5201
142
 
142
 
143
/*	R_S_16C_04	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
143
/*	R_S_16C_04	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
144
#define R_16C_REG04_C	0X5206
144
#define R_16C_REG04_C	0X5206
145
 
145
 
146
/*	R_S_16C_04_a	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
146
/*	R_S_16C_04_a	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
147
#define R_16C_REG04a	0X4201
147
#define R_16C_REG04a	0X4201
148
 
148
 
149
/*	R_S_16C_04_a	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
149
/*	R_S_16C_04_a	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
150
#define R_16C_REG04a_C	0X4206
150
#define R_16C_REG04a_C	0X4206
151
 
151
 
152
/*	R_S_16C_14	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
152
/*	R_S_16C_14	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
153
#define R_16C_REG14	0X3201
153
#define R_16C_REG14	0X3201
154
 
154
 
155
/*	R_S_16C_14	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
155
/*	R_S_16C_14	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
156
#define R_16C_REG14_C	0X3206
156
#define R_16C_REG14_C	0X3206
157
 
157
 
158
/*	R_S_16C_16	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
158
/*	R_S_16C_16	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
159
#define R_16C_REG16	0X1201
159
#define R_16C_REG16	0X1201
160
 
160
 
161
/*	R_S_16C_16	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
161
/*	R_S_16C_16	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
162
#define R_16C_REG16_C	0X1206
162
#define R_16C_REG16_C	0X1206
163
 
163
 
164
/*	R_S_16C_20	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
164
/*	R_S_16C_20	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
165
#define R_16C_REG20	0X8201
165
#define R_16C_REG20	0X8201
166
 
166
 
167
/*	R_S_16C_20	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
167
/*	R_S_16C_20	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
168
#define R_16C_REG20_C	0X8206
168
#define R_16C_REG20_C	0X8206
169
 
169
 
170
/*      R_S_16C_20      R_16C_ABS	R_ABS	      R_ADDRESS */
170
/*      R_S_16C_20      R_16C_ABS	R_ABS	      R_ADDRESS */
171
#define R_16C_ABS20     0X8101
171
#define R_16C_ABS20     0X8101
172
 
172
 
173
/*      R_S_16C_20      R_16C_ABS	R_ABS	      R_CODE_ADDR */
173
/*      R_S_16C_20      R_16C_ABS	R_ABS	      R_CODE_ADDR */
174
#define R_16C_ABS20_C   0X8106
174
#define R_16C_ABS20_C   0X8106
175
 
175
 
176
/*      R_S_16C_24      R_16C_ABS	R_ABS	      R_ADDRESS */
176
/*      R_S_16C_24      R_16C_ABS	R_ABS	      R_ADDRESS */
177
#define R_16C_ABS24     0X7101
177
#define R_16C_ABS24     0X7101
178
 
178
 
179
/*      R_S_16C_24      R_16C_ABS	R_ABS	      R_CODE_ADDR */
179
/*      R_S_16C_24      R_16C_ABS	R_ABS	      R_CODE_ADDR */
180
#define R_16C_ABS24_C   0X7106
180
#define R_16C_ABS24_C   0X7106
181
 
181
 
182
/*      R_S_16C_04      R_16C_IMMED	R_ABS	      R_ADDRESS */
182
/*      R_S_16C_04      R_16C_IMMED	R_ABS	      R_ADDRESS */
183
#define R_16C_IMM04     0X5301
183
#define R_16C_IMM04     0X5301
184
 
184
 
185
/*      R_S_16C_04      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
185
/*      R_S_16C_04      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
186
#define R_16C_IMM04_C   0X5306
186
#define R_16C_IMM04_C   0X5306
187
 
187
 
188
/*      R_S_16C_16      R_16C_IMMED	R_ABS	      R_ADDRESS */
188
/*      R_S_16C_16      R_16C_IMMED	R_ABS	      R_ADDRESS */
189
#define R_16C_IMM16     0X1301
189
#define R_16C_IMM16     0X1301
190
 
190
 
191
/*      R_S_16C_16      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
191
/*      R_S_16C_16      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
192
#define R_16C_IMM16_C   0X1306
192
#define R_16C_IMM16_C   0X1306
193
 
193
 
194
/*      R_S_16C_20      R_16C_IMMED	R_ABS	      R_ADDRESS */
194
/*      R_S_16C_20      R_16C_IMMED	R_ABS	      R_ADDRESS */
195
#define R_16C_IMM20     0X8301
195
#define R_16C_IMM20     0X8301
196
 
196
 
197
/*      R_S_16C_20      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
197
/*      R_S_16C_20      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
198
#define R_16C_IMM20_C   0X8306
198
#define R_16C_IMM20_C   0X8306
199
 
199
 
200
/*      R_S_16C_24      R_16C_IMMED	R_ABS	      R_ADDRESS */
200
/*      R_S_16C_24      R_16C_IMMED	R_ABS	      R_ADDRESS */
201
#define R_16C_IMM24     0X7301
201
#define R_16C_IMM24     0X7301
202
 
202
 
203
/*      R_S_16C_24      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
203
/*      R_S_16C_24      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
204
#define R_16C_IMM24_C   0X7306
204
#define R_16C_IMM24_C   0X7306
205
 
205
 
206
/*      R_S_16C_32      R_16C_IMMED	R_ABS	      R_ADDRESS */
206
/*      R_S_16C_32      R_16C_IMMED	R_ABS	      R_ADDRESS */
207
#define R_16C_IMM32     0X2301
207
#define R_16C_IMM32     0X2301
208
 
208
 
209
/*      R_S_16C_32      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
209
/*      R_S_16C_32      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
210
#define R_16C_IMM32_C   0X2306
210
#define R_16C_IMM32_C   0X2306
211
 
211
 
212
 
212
 
213
/* Relocation item type.  */
213
/* Relocation item type.  */
214
#define   R_ADDRTYPE	 0x000f
214
#define   R_ADDRTYPE	 0x000f
215
#define   R_ADDRESS      0x0001    /* Take address of symbol.  */
215
#define   R_ADDRESS      0x0001    /* Take address of symbol.  */
216
#define   R_CODE_ADDR    0x0006    /* Take address of symbol divided by 2.  */
216
#define   R_CODE_ADDR    0x0006    /* Take address of symbol divided by 2.  */
217
 
217
 
218
/* Relocation action.  */
218
/* Relocation action.  */
219
#define   R_RELTO        0x00f0
219
#define   R_RELTO        0x00f0
220
#define   R_ABS          0x0000    /* Keep symbol's address as such.  */
220
#define   R_ABS          0x0000    /* Keep symbol's address as such.  */
221
#define   R_PCREL        0x0010    /* Subtract the pc address of hole.  */
221
#define   R_PCREL        0x0010    /* Subtract the pc address of hole.  */
222
 
222
 
223
/* Relocation item data format.  */
223
/* Relocation item data format.  */
224
#define   R_FORMAT       0x0f00
224
#define   R_FORMAT       0x0f00
225
#define   R_NUMBER       0x0000    /* Retain as two's complement value.  */
225
#define   R_NUMBER       0x0000    /* Retain as two's complement value.  */
226
#define   R_16C_DISPL    0x0400    /* CR16C displacement type.  */
226
#define   R_16C_DISPL    0x0400    /* CR16C displacement type.  */
227
#define   R_16C_ABS      0x0100    /* CR16C absolute type.  */
227
#define   R_16C_ABS      0x0100    /* CR16C absolute type.  */
228
#define   R_16C_REGREL   0x0200    /* CR16C register-relative type.  */
228
#define   R_16C_REGREL   0x0200    /* CR16C register-relative type.  */
229
#define   R_16C_IMMED    0x0300    /* CR16C immediate type.  */
229
#define   R_16C_IMMED    0x0300    /* CR16C immediate type.  */
230
 
230
 
231
/* Relocation item size. */
231
/* Relocation item size. */
232
#define   R_SIZESP       0xf000
232
#define   R_SIZESP       0xf000
233
#define   R_S_16C_04     0x5000
233
#define   R_S_16C_04     0x5000
234
#define   R_S_16C_04_a   0x4000
234
#define   R_S_16C_04_a   0x4000
235
#define   R_S_16C_08	 0x0000
235
#define   R_S_16C_08	 0x0000
236
#define   R_S_16C_14     0x3000
236
#define   R_S_16C_14     0x3000
237
#define   R_S_16C_16	 0x1000
237
#define   R_S_16C_16	 0x1000
238
#define   R_S_16C_20     0x8000
238
#define   R_S_16C_20     0x8000
239
#define   R_S_16C_24_a   0x6000
239
#define   R_S_16C_24_a   0x6000
240
#define   R_S_16C_24	 0x7000
240
#define   R_S_16C_24	 0x7000
241
#define   R_S_16C_32     0x2000
241
#define   R_S_16C_32     0x2000
242
 
242
 
243
 
243
 
244
/* Processor specific section indices.  These sections do not actually
244
/* Processor specific section indices.  These sections do not actually
245
   exist.  Symbols with a st_shndx field corresponding to one of these
245
   exist.  Symbols with a st_shndx field corresponding to one of these
246
   values have a special meaning.  */
246
   values have a special meaning.  */
247
 
247
 
248
/* Far common symbol.  */
248
/* Far common symbol.  */
249
#define SHN_CR16C_FCOMMON	SHN_LORESERVE
249
#define SHN_CR16C_FCOMMON	SHN_LORESERVE
250
#define SHN_CR16C_NCOMMON	(SHN_LORESERVE + 1)
250
#define SHN_CR16C_NCOMMON	(SHN_LORESERVE + 1)
251
 
251
 
252
typedef struct reloc_map
252
typedef struct reloc_map
253
{
253
{
254
  unsigned short            cr_reloc_type;  /* CR relocation type.  */
254
  unsigned short            cr_reloc_type;  /* CR relocation type.  */
255
  bfd_reloc_code_real_type  bfd_reloc_enum; /* BFD relocation enum.  */
255
  bfd_reloc_code_real_type  bfd_reloc_enum; /* BFD relocation enum.  */
256
} RELOC_MAP;
256
} RELOC_MAP;
257
 
257
 
258
#endif /* _ELF_CR16C_H */
258
#endif /* _ELF_CR16C_H */