arc: Add new ARCv3 ISA to BFD.
[binutils-gdb.git] / bfd / arc-plt.c
1 /* ARC-specific support for PLT relocations.
2 Copyright (C) 2023 Free Software Foundation, Inc.
3 Contributed by Cupertino Miranda (cmiranda@synopsys.com).
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
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22 #include "arc-plt.h"
23
24 #define PLT_TYPE_START(NAME) \
25 const insn_hword NAME##_plt_entry[] = {
26 #define PLT_TYPE_END(NAME) };
27 #define PLT_ENTRY(...) __VA_ARGS__,
28 #define PLT_ELEM(...)
29 #define ENTRY_RELOC(...)
30 #define ELEM_RELOC(...)
31
32 #include "arc-plt.def"
33
34 #undef PLT_TYPE_START
35 #undef PLT_TYPE_END
36 #undef PLT_ENTRY
37 #undef PLT_ELEM
38 #undef ENTRY_RELOC
39 #undef ELEM_RELOC
40
41 #define PLT_TYPE_START(NAME) \
42 const struct plt_reloc NAME##_plt_entry_relocs[] = {
43 #define PLT_TYPE_END(NAME) \
44 {0, 0, 0, LAST_RELOC, 0} \
45 };
46 #define PLT_ENTRY(...)
47 #define PLT_ELEM(...)
48 #define ENTRY_RELOC(...) { __VA_ARGS__ },
49 #define ELEM_RELOC(...)
50
51 #include "arc-plt.def"
52
53 #undef PLT_TYPE_START
54 #undef PLT_TYPE_END
55 #undef PLT_ENTRY
56 #undef PLT_ELEM
57 #undef ENTRY_RELOC
58 #undef ELEM_RELOC
59
60
61 #define PLT_TYPE_START(NAME) \
62 const insn_hword NAME##_plt_elem[] = {
63 #define PLT_TYPE_END(NAME) };
64 #define PLT_ENTRY(...)
65 #define PLT_ELEM(...) __VA_ARGS__,
66 #define ENTRY_RELOC(...)
67 #define ELEM_RELOC(...)
68
69 #include "arc-plt.def"
70
71 #undef PLT_TYPE_START
72 #undef PLT_TYPE_END
73 #undef PLT_ENTRY
74 #undef PLT_ELEM
75 #undef ENTRY_RELOC
76 #undef ELEM_RELOC
77
78 #define PLT_TYPE_START(NAME) \
79 const struct plt_reloc NAME##_plt_elem_relocs[] = {
80 #define PLT_TYPE_END(NAME) \
81 {0, 0, 0, LAST_RELOC, 0} \
82 };
83 #define PLT_ENTRY(...)
84 #define PLT_ELEM(...)
85 #define ENTRY_RELOC(...)
86 #define ELEM_RELOC(...) { __VA_ARGS__ },
87
88 #include "arc-plt.def"
89
90 #undef PLT_TYPE_START
91 #undef PLT_TYPE_END
92 #undef PLT_ENTRY
93 #undef PLT_ELEM
94 #undef ENTRY_RELOC
95 #undef ELEM_RELOC
96
97
98 #define PLT_TYPE_START(NAME) \
99 { \
100 .entry = &NAME##_plt_entry, \
101 .entry_size = sizeof (NAME##_plt_entry), \
102 .elem = &NAME##_plt_elem, \
103 .elem_size = sizeof (NAME##_plt_elem), \
104 .entry_relocs = NAME##_plt_entry_relocs, \
105 .elem_relocs = NAME##_plt_elem_relocs
106 #define PLT_TYPE_END(NAME) },
107 #define PLT_ENTRY(...)
108 #define PLT_ELEM(...)
109 #define ENTRY_RELOC(...)
110 #define ELEM_RELOC(...)
111 struct plt_version_t plt_versions[PLT_MAX] =
112 {
113 #include "arc-plt.def"
114 };
115
116 #undef PLT_TYPE_START
117 #undef PLT_TYPE_END
118 #undef PLT_ENTRY
119 #undef PLT_ELEM
120 #undef ENTRY_RELOC
121 #undef ELEM_RELOC