aboutsummaryrefslogtreecommitdiff
path: root/bfd/arc-plt.h
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2023-09-25 10:55:51 +0300
committerClaudiu Zissulescu <claziss@gmail.com>2023-09-25 10:55:51 +0300
commit06e8d9861d16c5b7e6920ad0e89889ccf45c575a (patch)
tree86a19fa0a0cbead51ad1207536763fa854732d40 /bfd/arc-plt.h
parent6e467e9a94c1135bd11d985e9263d43204a9258b (diff)
downloadgdb-06e8d9861d16c5b7e6920ad0e89889ccf45c575a.zip
gdb-06e8d9861d16c5b7e6920ad0e89889ccf45c575a.tar.gz
gdb-06e8d9861d16c5b7e6920ad0e89889ccf45c575a.tar.bz2
arc: Add new ARCv3 ISA to BFD.
The new Synopsys's ARCv3 ISA is capable to run either 64-bit or 32-bit ISA. The new 32-bit ISA is not compatible with the old Synopsys ARCv1/ARCv2 ISA, however, it retains a lot of common concepts. Thus, this patch is reusing the old ARC BFD backend and adds the necessary bits for the new architecture in a similar way as it is done for RISCV backend. bfd/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> Cupertino Miranda <cupertinomiranda@gmail.com> * bfd/Makefile.am: Add ARC64 files. * bfd/Makefile.in: Regerate. * bfd/arc-got.h (TCB_SIZE): Depends on the target architecture. (GOT_ENTRY_SIZE): New define. (write_in_got): Likewise. (read_from_got): Likewise. (align_power): Likewise. (arc_got_entry_type_for_reloc): Use RELA_SIZE and GOT_ENTRY_SIZE. (arc_fill_got_info_for_reloc): Update formating. (relocate_fix_got_relocs_for_got_info): Likewise. (arc_static_sym_data): Deleted structure. (get_static_sym_data): Deleted function. (relocate_fix_got_relocs_for_got_info): Use symbol static data. (create_got_dynrelocs_for_single_entry): Update formating. (create_got_dynrelocs_for_got_info): Likewise. * bfd/arc-plt.c: New file. * bfd/arc-plt.def: Add ARC64 PLT entry. * bfd/arc-plt.h: Clean it up, move functionality to arc-plt.c file. * bfd/archures.c: Add ARC64 target. * bfd/config.bfd: Likewise. * bfd/configure.ac: Likewise. * bfd/bfd-in2.h: Regenerate. * bfd/configure: Likewise. * bfd/libbfd.h: Likewise. * bfd/cpu-arc.c: Clean it up. * bfd/cpu-arc64.c: New file. * bfd/elf32-arc.c: Renamed to elfnn-arc.c. * bfd/elfnn-arc.c: New file. * bfd/reloc.c: Add new ARC64 relocs. * bfd/targets.c: Add ARC64 target. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Diffstat (limited to 'bfd/arc-plt.h')
-rw-r--r--bfd/arc-plt.h93
1 files changed, 10 insertions, 83 deletions
diff --git a/bfd/arc-plt.h b/bfd/arc-plt.h
index e11b72e..ad1b86f 100644
--- a/bfd/arc-plt.h
+++ b/bfd/arc-plt.h
@@ -22,6 +22,9 @@
#ifndef ARC_PLT_H
#define ARC_PLT_H
+#include "sysdep.h"
+#include "bfd.h"
+
/* Instructions appear in memory as a sequence of half-words (16 bit);
individual half-words are represented on the target in target byte order.
We use 'unsigned short' on the host to represent the PLT templates,
@@ -92,97 +95,20 @@ struct plt_version_t
};
#define PLT_TYPE_START(NAME) \
- const insn_hword NAME##_plt_entry[] = {
-#define PLT_TYPE_END(NAME) };
-#define PLT_ENTRY(...) __VA_ARGS__,
-#define PLT_ELEM(...)
-#define ENTRY_RELOC(...)
-#define ELEM_RELOC(...)
-
-#include "arc-plt.def"
-
-#undef PLT_TYPE_START
-#undef PLT_TYPE_END
-#undef PLT_ENTRY
-#undef PLT_ELEM
-#undef ENTRY_RELOC
-#undef ELEM_RELOC
-
-#define PLT_TYPE_START(NAME) \
- const struct plt_reloc NAME##_plt_entry_relocs[] = {
-#define PLT_TYPE_END(NAME) \
- {0, 0, 0, LAST_RELOC, 0} \
- };
-#define PLT_ENTRY(...)
-#define PLT_ELEM(...)
-#define ENTRY_RELOC(...) { __VA_ARGS__ },
-#define ELEM_RELOC(...)
+ extern const insn_hword NAME##_plt_entry[]; \
+ extern const struct plt_reloc NAME##_plt_entry_relocs[]; \
+ extern const insn_hword NAME##_plt_elem[]; \
+ extern const struct plt_reloc NAME##_plt_elem_relocs[];
-#include "arc-plt.def"
-#undef PLT_TYPE_START
-#undef PLT_TYPE_END
-#undef PLT_ENTRY
-#undef PLT_ELEM
-#undef ENTRY_RELOC
-#undef ELEM_RELOC
-
-
-#define PLT_TYPE_START(NAME) \
- const insn_hword NAME##_plt_elem[] = {
-#define PLT_TYPE_END(NAME) };
-#define PLT_ENTRY(...)
-#define PLT_ELEM(...) __VA_ARGS__,
-#define ENTRY_RELOC(...)
-#define ELEM_RELOC(...)
-
-#include "arc-plt.def"
-
-#undef PLT_TYPE_START
-#undef PLT_TYPE_END
-#undef PLT_ENTRY
-#undef PLT_ELEM
-#undef ENTRY_RELOC
-#undef ELEM_RELOC
-
-#define PLT_TYPE_START(NAME) \
- const struct plt_reloc NAME##_plt_elem_relocs[] = {
-#define PLT_TYPE_END(NAME) \
- {0, 0, 0, LAST_RELOC, 0} \
- };
-#define PLT_ENTRY(...)
-#define PLT_ELEM(...)
-#define ENTRY_RELOC(...)
-#define ELEM_RELOC(...) { __VA_ARGS__ },
-
-#include "arc-plt.def"
-
-#undef PLT_TYPE_START
-#undef PLT_TYPE_END
-#undef PLT_ENTRY
-#undef PLT_ELEM
-#undef ENTRY_RELOC
-#undef ELEM_RELOC
-
-
-#define PLT_TYPE_START(NAME) \
- { \
- .entry = &NAME##_plt_entry, \
- .entry_size = sizeof (NAME##_plt_entry), \
- .elem = &NAME##_plt_elem, \
- .elem_size = sizeof (NAME##_plt_elem), \
- .entry_relocs = NAME##_plt_entry_relocs, \
- .elem_relocs = NAME##_plt_elem_relocs
-#define PLT_TYPE_END(NAME) },
+#define PLT_TYPE_END(NAME)
#define PLT_ENTRY(...)
#define PLT_ELEM(...)
#define ENTRY_RELOC(...)
#define ELEM_RELOC(...)
-const struct plt_version_t plt_versions[PLT_MAX] = {
#include "arc-plt.def"
-};
#undef PLT_TYPE_START
#undef PLT_TYPE_END
#undef PLT_ENTRY
@@ -190,5 +116,6 @@ const struct plt_version_t plt_versions[PLT_MAX] = {
#undef ENTRY_RELOC
#undef ELEM_RELOC
+extern struct plt_version_t plt_versions[PLT_MAX];
-#endif /* ARC_PLT_H */
+#endif