Coverage Report

Created: 2025-06-24 06:45

/src/binutils-gdb/include/elf/csky.h
Line
Count
Source (jump to first uncovered line)
1
/* C-SKY ELF support for BFD.
2
   Copyright (C) 1998-2025 Free Software Foundation, Inc.
3
   Contributed by C-SKY Microsystems and Mentor Graphics.
4
5
   This file is part of BFD, the Binary File Descriptor library.
6
7
   This program is free software; you can redistribute it and/or modify
8
   it under the terms of the GNU General Public License as published by
9
   the Free Software Foundation; either version 3 of the License, or
10
   (at your option) any later version.
11
12
   This program is distributed in the hope that it will be useful,
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
   GNU General Public License for more details.
16
17
   You should have received a copy of the GNU General Public License
18
   along with this program; if not, write to the Free Software Foundation,
19
   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21
#ifndef _ELF_CSKY_H
22
#define _ELF_CSKY_H
23
24
#include "elf/reloc-macros.h"
25
26
/* Values of relocation types according to the ABI doc.
27
   The order should be consistent with csky bfd reloc type
28
   table in bfd-in2.h.  */
29
9.88k
START_RELOC_NUMBERS (elf_csky_reloc_type)
30
9.88k
    RELOC_NUMBER (R_CKCORE_NONE,0)
31
105
    RELOC_NUMBER (R_CKCORE_ADDR32,1)
32
353
    RELOC_NUMBER (R_CKCORE_PCREL_IMM8BY4,2)
33
36
    RELOC_NUMBER (R_CKCORE_PCREL_IMM11BY2,3)
34
412
    RELOC_NUMBER (R_CKCORE_PCREL_IMM4BY2,4)
35
36
    RELOC_NUMBER (R_CKCORE_PCREL32,5)
36
14
    RELOC_NUMBER (R_CKCORE_PCREL_JSR_IMM11BY2,6)
37
32
    RELOC_NUMBER (R_CKCORE_GNU_VTINHERIT,7)
38
46
    RELOC_NUMBER (R_CKCORE_GNU_VTENTRY,8)
39
90
    RELOC_NUMBER (R_CKCORE_RELATIVE,9)
40
30
    RELOC_NUMBER (R_CKCORE_COPY,10)
41
72
    RELOC_NUMBER (R_CKCORE_GLOB_DAT,11)
42
10
    RELOC_NUMBER (R_CKCORE_JUMP_SLOT,12)
43
0
    RELOC_NUMBER (R_CKCORE_GOTOFF,13)
44
11
    RELOC_NUMBER (R_CKCORE_GOTPC,14)
45
30
    RELOC_NUMBER (R_CKCORE_GOT32,15)
46
35
    RELOC_NUMBER (R_CKCORE_PLT32,16)
47
125
    RELOC_NUMBER (R_CKCORE_ADDRGOT,17)
48
4
    RELOC_NUMBER (R_CKCORE_ADDRPLT,18)
49
3
    RELOC_NUMBER (R_CKCORE_PCREL_IMM26BY2,19)
50
11
    RELOC_NUMBER (R_CKCORE_PCREL_IMM16BY2,20)
51
2
    RELOC_NUMBER (R_CKCORE_PCREL_IMM16BY4,21)
52
3
    RELOC_NUMBER (R_CKCORE_PCREL_IMM10BY2,22)
53
18
    RELOC_NUMBER (R_CKCORE_PCREL_IMM10BY4,23)
54
32
    RELOC_NUMBER (R_CKCORE_ADDR_HI16,24)
55
21
    RELOC_NUMBER (R_CKCORE_ADDR_LO16,25)
56
20
    RELOC_NUMBER (R_CKCORE_GOTPC_HI16,26)
57
11
    RELOC_NUMBER (R_CKCORE_GOTPC_LO16,27)
58
15
    RELOC_NUMBER (R_CKCORE_GOTOFF_HI16,28)
59
9
    RELOC_NUMBER (R_CKCORE_GOTOFF_LO16,29)
60
3
    RELOC_NUMBER (R_CKCORE_GOT12,30)
61
17
    RELOC_NUMBER (R_CKCORE_GOT_HI16,31)
62
109
    RELOC_NUMBER (R_CKCORE_GOT_LO16,32)
63
4
    RELOC_NUMBER (R_CKCORE_PLT12,33)
64
10
    RELOC_NUMBER (R_CKCORE_PLT_HI16,34)
65
15
    RELOC_NUMBER (R_CKCORE_PLT_LO16,35)
66
31
    RELOC_NUMBER (R_CKCORE_ADDRGOT_HI16,36)
67
36
    RELOC_NUMBER (R_CKCORE_ADDRGOT_LO16,37)
68
81
    RELOC_NUMBER (R_CKCORE_ADDRPLT_HI16,38)
69
3
    RELOC_NUMBER (R_CKCORE_ADDRPLT_LO16,39)
70
22
    RELOC_NUMBER (R_CKCORE_PCREL_JSR_IMM26BY2,40)
71
5
    RELOC_NUMBER (R_CKCORE_TOFFSET_LO16, 41)
72
1
    RELOC_NUMBER (R_CKCORE_DOFFSET_LO16, 42)
73
5
    RELOC_NUMBER (R_CKCORE_PCREL_IMM18BY2, 43)
74
21
    RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18, 44)
75
2
    RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18BY2, 45)
76
11
    RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18BY4, 46)
77
2
    RELOC_NUMBER (R_CKCORE_GOTOFF_IMM18, 47)
78
1
    RELOC_NUMBER (R_CKCORE_GOT_IMM18BY4, 48)
79
8
    RELOC_NUMBER (R_CKCORE_PLT_IMM18BY4, 49)
80
1
    RELOC_NUMBER (R_CKCORE_PCREL_IMM7BY4, 50)
81
62
    RELOC_NUMBER (R_CKCORE_TLS_LE32, 51)
82
6
    RELOC_NUMBER (R_CKCORE_TLS_IE32, 52)
83
4
    RELOC_NUMBER (R_CKCORE_TLS_GD32, 53)
84
6
    RELOC_NUMBER (R_CKCORE_TLS_LDM32, 54)
85
23
    RELOC_NUMBER (R_CKCORE_TLS_LDO32, 55)
86
11
    RELOC_NUMBER (R_CKCORE_TLS_DTPMOD32, 56)
87
40
    RELOC_NUMBER (R_CKCORE_TLS_DTPOFF32, 57)
88
16
    RELOC_NUMBER (R_CKCORE_TLS_TPOFF32, 58)
89
4
    RELOC_NUMBER (R_CKCORE_PCREL_FLRW_IMM8BY4, 59)
90
4
    RELOC_NUMBER (R_CKCORE_NOJSRI, 60)
91
3
    RELOC_NUMBER (R_CKCORE_CALLGRAPH, 61)
92
23
    RELOC_NUMBER (R_CKCORE_IRELATIVE, 62)
93
12
    RELOC_NUMBER (R_CKCORE_PCREL_BLOOP_IMM4BY4, 63)
94
83
    RELOC_NUMBER (R_CKCORE_PCREL_BLOOP_IMM12BY4, 64)
95
2.17k
END_RELOC_NUMBERS (R_CKCORE_MAX)
96
97
/* Additional section types.  */
98
967
#define SHT_CSKY_ATTRIBUTES       (SHT_LOPROC + 1) /* Section holds attributes.  */
99
100
/* Object attribute tags.  */
101
enum
102
{
103
  /* 0-3 are generic. */
104
  /* Arch name for this object file.  */
105
  Tag_CSKY_ARCH_NAME = 4,
106
  Tag_CSKY_CPU_NAME = 5,
107
108
  /* ISA flags for this object file.  */
109
  Tag_CSKY_ISA_FLAGS,
110
  Tag_CSKY_ISA_EXT_FLAGS,
111
112
  /* CSKY DSP version used by this object file.  */
113
  Tag_CSKY_DSP_VERSION,
114
115
  /* CSKY VDSP version used by this object file.  */
116
  Tag_CSKY_VDSP_VERSION,
117
118
  /* CSKY FPU version used by this object file.  */
119
  Tag_CSKY_FPU_VERSION = 0x10,
120
  /* FPU ABI.  params: Soft GR/Hard GR/Hard FR. */
121
  Tag_CSKY_FPU_ABI,
122
  /* Rounding Support.  */
123
  Tag_CSKY_FPU_ROUNDING,
124
  /* Denormal Support.  */
125
  Tag_CSKY_FPU_DENORMAL,
126
  /* Exeception Support.  */
127
  Tag_CSKY_FPU_Exception,
128
  /* Number Module Support("IEEE 754").  */
129
  Tag_CSKY_FPU_NUMBER_MODULE,
130
  /* Half/Single/Double.  */
131
  Tag_CSKY_FPU_HARDFP,
132
133
  Tag_CSKY_MAX,
134
};
135
136
/* Object attribute values.  */
137
enum
138
{
139
  /* Values defined for Tag_CSKY_DSP_VERSION.  */
140
  VAL_CSKY_DSP_VERSION_EXTENSION = 1, /* hi-lo DSP extension.  */
141
  VAL_CSKY_DSP_VERSION_2 = 2,   /* CK803s EDSP.  */
142
};
143
144
enum
145
{
146
  /* Values defined for Tag_CSKY_VDSP_VERSION.  */
147
  VAL_CSKY_VDSP_VERSION_1 = 1,  /* VDSP version 1.  */
148
  VAL_CSKY_VDSP_VERSION_2 /* VDSP version 1.  */
149
};
150
151
enum
152
{
153
  /* Values defined for Tag_CSKY_FPU_VERSION.  */
154
  VAL_CSKY_FPU_VERSION_1 = 1, /* ABIV1 FPU.  */
155
  VAL_CSKY_FPU_VERSION_2, /* ABIV2 FPU.  */
156
};
157
158
enum
159
{
160
  VAL_CSKY_FPU_ABI_SOFT = 1,
161
  VAL_CSKY_FPU_ABI_SOFTFP,
162
  VAL_CSKY_FPU_ABI_HARD,
163
};
164
165
enum
166
{
167
  VAL_CSKY_FPU_HARDFP_HALF = 1,
168
  VAL_CSKY_FPU_HARDFP_SINGLE = 2,
169
  VAL_CSKY_FPU_HARDFP_DOUBLE = 4,
170
};
171
172
#endif /* _ELF_CSKY_H  */