xref: /netbsd/external/gpl3/gdb/dist/include/elf/csky.h (revision 1424dfb3)
107163879Schristos /* C-SKY ELF support for BFD.
2*1424dfb3Schristos    Copyright (C) 1998-2020 Free Software Foundation, Inc.
307163879Schristos    Contributed by C-SKY Microsystems and Mentor Graphics.
407163879Schristos 
507163879Schristos    This file is part of BFD, the Binary File Descriptor library.
607163879Schristos 
707163879Schristos    This program is free software; you can redistribute it and/or modify
807163879Schristos    it under the terms of the GNU General Public License as published by
907163879Schristos    the Free Software Foundation; either version 3 of the License, or
1007163879Schristos    (at your option) any later version.
1107163879Schristos 
1207163879Schristos    This program is distributed in the hope that it will be useful,
1307163879Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1407163879Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1507163879Schristos    GNU General Public License for more details.
1607163879Schristos 
1707163879Schristos    You should have received a copy of the GNU General Public License
1807163879Schristos    along with this program; if not, write to the Free Software Foundation,
1907163879Schristos    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
2007163879Schristos 
2107163879Schristos #ifndef _ELF_CSKY_H
2207163879Schristos #define _ELF_CSKY_H
2307163879Schristos 
2407163879Schristos #include "elf/reloc-macros.h"
2507163879Schristos 
2607163879Schristos /* Values of relocation types according to the ABI doc.
2707163879Schristos    The order should be consistent with csky bfd reloc type
2807163879Schristos    table in bfd-in2.h.  */
2907163879Schristos START_RELOC_NUMBERS (elf_csky_reloc_type)
3007163879Schristos     RELOC_NUMBER (R_CKCORE_NONE,0)
3107163879Schristos     RELOC_NUMBER (R_CKCORE_ADDR32,1)
3207163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM8BY4,2)
3307163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM11BY2,3)
3407163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM4BY2,4)
3507163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL32,5)
3607163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_JSR_IMM11BY2,6)
3707163879Schristos     RELOC_NUMBER (R_CKCORE_GNU_VTINHERIT,7)
3807163879Schristos     RELOC_NUMBER (R_CKCORE_GNU_VTENTRY,8)
3907163879Schristos     RELOC_NUMBER (R_CKCORE_RELATIVE,9)
4007163879Schristos     RELOC_NUMBER (R_CKCORE_COPY,10)
4107163879Schristos     RELOC_NUMBER (R_CKCORE_GLOB_DAT,11)
4207163879Schristos     RELOC_NUMBER (R_CKCORE_JUMP_SLOT,12)
4307163879Schristos     RELOC_NUMBER (R_CKCORE_GOTOFF,13)
4407163879Schristos     RELOC_NUMBER (R_CKCORE_GOTPC,14)
4507163879Schristos     RELOC_NUMBER (R_CKCORE_GOT32,15)
4607163879Schristos     RELOC_NUMBER (R_CKCORE_PLT32,16)
4707163879Schristos     RELOC_NUMBER (R_CKCORE_ADDRGOT,17)
4807163879Schristos     RELOC_NUMBER (R_CKCORE_ADDRPLT,18)
4907163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM26BY2,19)
5007163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM16BY2,20)
5107163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM16BY4,21)
5207163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM10BY2,22)
5307163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM10BY4,23)
5407163879Schristos     RELOC_NUMBER (R_CKCORE_ADDR_HI16,24)
5507163879Schristos     RELOC_NUMBER (R_CKCORE_ADDR_LO16,25)
5607163879Schristos     RELOC_NUMBER (R_CKCORE_GOTPC_HI16,26)
5707163879Schristos     RELOC_NUMBER (R_CKCORE_GOTPC_LO16,27)
5807163879Schristos     RELOC_NUMBER (R_CKCORE_GOTOFF_HI16,28)
5907163879Schristos     RELOC_NUMBER (R_CKCORE_GOTOFF_LO16,29)
6007163879Schristos     RELOC_NUMBER (R_CKCORE_GOT12,30)
6107163879Schristos     RELOC_NUMBER (R_CKCORE_GOT_HI16,31)
6207163879Schristos     RELOC_NUMBER (R_CKCORE_GOT_LO16,32)
6307163879Schristos     RELOC_NUMBER (R_CKCORE_PLT12,33)
6407163879Schristos     RELOC_NUMBER (R_CKCORE_PLT_HI16,34)
6507163879Schristos     RELOC_NUMBER (R_CKCORE_PLT_LO16,35)
6607163879Schristos     RELOC_NUMBER (R_CKCORE_ADDRGOT_HI16,36)
6707163879Schristos     RELOC_NUMBER (R_CKCORE_ADDRGOT_LO16,37)
6807163879Schristos     RELOC_NUMBER (R_CKCORE_ADDRPLT_HI16,38)
6907163879Schristos     RELOC_NUMBER (R_CKCORE_ADDRPLT_LO16,39)
7007163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_JSR_IMM26BY2,40)
7107163879Schristos     RELOC_NUMBER (R_CKCORE_TOFFSET_LO16, 41)
7207163879Schristos     RELOC_NUMBER (R_CKCORE_DOFFSET_LO16, 42)
7307163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM18BY2, 43)
7407163879Schristos     RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18, 44)
7507163879Schristos     RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18BY2, 45)
7607163879Schristos     RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18BY4, 46)
7707163879Schristos     RELOC_NUMBER (R_CKCORE_GOTOFF_IMM18, 47)
7807163879Schristos     RELOC_NUMBER (R_CKCORE_GOT_IMM18BY4, 48)
7907163879Schristos     RELOC_NUMBER (R_CKCORE_PLT_IMM18BY4, 49)
8007163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_IMM7BY4, 50)
8107163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_LE32, 51)
8207163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_IE32, 52)
8307163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_GD32, 53)
8407163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_LDM32, 54)
8507163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_LDO32, 55)
8607163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_DTPMOD32, 56)
8707163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_DTPOFF32, 57)
8807163879Schristos     RELOC_NUMBER (R_CKCORE_TLS_TPOFF32, 58)
8907163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_FLRW_IMM8BY4, 59)
9007163879Schristos     RELOC_NUMBER (R_CKCORE_NOJSRI, 60)
9107163879Schristos     RELOC_NUMBER (R_CKCORE_CALLGRAPH, 61)
9207163879Schristos     RELOC_NUMBER (R_CKCORE_IRELATIVE, 62)
9307163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_BLOOP_IMM4BY4, 63)
9407163879Schristos     RELOC_NUMBER (R_CKCORE_PCREL_BLOOP_IMM12BY4, 64)
9507163879Schristos END_RELOC_NUMBERS (R_CKCORE_MAX)
9607163879Schristos 
97*1424dfb3Schristos /* Additional section types.  */
98*1424dfb3Schristos #define SHT_CSKY_ATTRIBUTES       0x70000001 /* Section holds attributes.  */
99*1424dfb3Schristos 
100*1424dfb3Schristos /* Object attribute tags.  */
101*1424dfb3Schristos enum
102*1424dfb3Schristos {
103*1424dfb3Schristos   /* 0-3 are generic. */
104*1424dfb3Schristos   /* Arch name for this object file.  */
105*1424dfb3Schristos   Tag_CSKY_ARCH_NAME = 4,
106*1424dfb3Schristos   Tag_CSKY_CPU_NAME = 5,
107*1424dfb3Schristos 
108*1424dfb3Schristos   /* ISA flags for this object file.  */
109*1424dfb3Schristos   Tag_CSKY_ISA_FLAGS,
110*1424dfb3Schristos   Tag_CSKY_ISA_EXT_FLAGS,
111*1424dfb3Schristos 
112*1424dfb3Schristos   /* CSKY DSP version used by this object file.  */
113*1424dfb3Schristos   Tag_CSKY_DSP_VERSION,
114*1424dfb3Schristos 
115*1424dfb3Schristos   /* CSKY VDSP version used by this object file.  */
116*1424dfb3Schristos   Tag_CSKY_VDSP_VERSION,
117*1424dfb3Schristos 
118*1424dfb3Schristos   /* CSKY FPU version used by this object file.  */
119*1424dfb3Schristos   Tag_CSKY_FPU_VERSION = 0x10,
120*1424dfb3Schristos   /* FPU ABI.  params: Soft GR/Hard GR/Hard FR. */
121*1424dfb3Schristos   Tag_CSKY_FPU_ABI,
122*1424dfb3Schristos   /* Rounding Support.  */
123*1424dfb3Schristos   Tag_CSKY_FPU_ROUNDING,
124*1424dfb3Schristos   /* Denormal Support.  */
125*1424dfb3Schristos   Tag_CSKY_FPU_DENORMAL,
126*1424dfb3Schristos   /* Exeception Support.  */
127*1424dfb3Schristos   Tag_CSKY_FPU_Exception,
128*1424dfb3Schristos   /* Number Module Support("IEEE 754").  */
129*1424dfb3Schristos   Tag_CSKY_FPU_NUMBER_MODULE,
130*1424dfb3Schristos   /* Half/Single/Double.  */
131*1424dfb3Schristos   Tag_CSKY_FPU_HARDFP,
132*1424dfb3Schristos 
133*1424dfb3Schristos   Tag_CSKY_MAX,
134*1424dfb3Schristos };
135*1424dfb3Schristos 
136*1424dfb3Schristos /* Object attribute values.  */
137*1424dfb3Schristos enum
138*1424dfb3Schristos {
139*1424dfb3Schristos   /* Values defined for Tag_CSKY_DSP_VERSION.  */
140*1424dfb3Schristos   VAL_CSKY_DSP_VERSION_EXTENSION = 1,	/* hi-lo DSP extension.  */
141*1424dfb3Schristos   VAL_CSKY_DSP_VERSION_2 = 2,		/* CK803s EDSP.  */
142*1424dfb3Schristos };
143*1424dfb3Schristos 
144*1424dfb3Schristos enum
145*1424dfb3Schristos {
146*1424dfb3Schristos   /* Values defined for Tag_CSKY_VDSP_VERSION.  */
147*1424dfb3Schristos   VAL_CSKY_VDSP_VERSION_1 = 1,	/* VDSP version 1.  */
148*1424dfb3Schristos   VAL_CSKY_VDSP_VERSION_2	/* VDSP version 1.  */
149*1424dfb3Schristos };
150*1424dfb3Schristos 
151*1424dfb3Schristos enum
152*1424dfb3Schristos {
153*1424dfb3Schristos   /* Values defined for Tag_CSKY_FPU_VERSION.  */
154*1424dfb3Schristos   VAL_CSKY_FPU_VERSION_1 = 1,	/* ABIV1 FPU.  */
155*1424dfb3Schristos   VAL_CSKY_FPU_VERSION_2,	/* ABIV2 FPU.  */
156*1424dfb3Schristos };
157*1424dfb3Schristos 
158*1424dfb3Schristos enum
159*1424dfb3Schristos {
160*1424dfb3Schristos   VAL_CSKY_FPU_ABI_SOFT = 1,
161*1424dfb3Schristos   VAL_CSKY_FPU_ABI_SOFTFP,
162*1424dfb3Schristos   VAL_CSKY_FPU_ABI_HARD,
163*1424dfb3Schristos };
164*1424dfb3Schristos 
165*1424dfb3Schristos enum
166*1424dfb3Schristos {
167*1424dfb3Schristos   VAL_CSKY_FPU_HARDFP_HALF = 1,
168*1424dfb3Schristos   VAL_CSKY_FPU_HARDFP_SINGLE = 2,
169*1424dfb3Schristos   VAL_CSKY_FPU_HARDFP_DOUBLE = 4,
170*1424dfb3Schristos };
171*1424dfb3Schristos 
17207163879Schristos #endif /* _ELF_CSKY_H  */
173