From 5e5116071b09e187ee3c6b7e86e86114f6a65ef3 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Mon, 25 Sep 2023 15:00:49 +0300 Subject: [PATCH] arc: Update bfd arc pattern file to allow enable-targets=all The ARC backend uses a BFD pattern file to generate three ARC targets: - an BFD ARC target for ARCv1 and ARCv2 CPU families. It also works for big-endian variants. - an BFD ARC64 target for ARCv3 64bit machines. It also allows working with ARCv3 32bit machines. - an BFD ARC32 target for ARCv4 32bit machines. It also allows working with ARCv3 64bit machines. When configuring with `--enable-targets=all` some patterns are defined multiple times. Fix this issue. Signed-off-by: Claudiu Zissulescu --- bfd/elfnn-arc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bfd/elfnn-arc.c b/bfd/elfnn-arc.c index 04fce7eb6e0..f3ff157f809 100644 --- a/bfd/elfnn-arc.c +++ b/bfd/elfnn-arc.c @@ -32,8 +32,8 @@ #include "arc-plt.h" -#define FEATURE_LIST_NAME bfdNN_feature_list -#define CONFLICT_LIST bfdNN_conflict_list +#define FEATURE_LIST_NAME bfdNN_ARCAA_feature_list +#define CONFLICT_LIST bfdNN_ARCAA_conflict_list #include "opcode/arc-attrs.h" /* Possible ARC architectures. */ @@ -3006,7 +3006,7 @@ arc_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, /* We use this so we can override certain functions (though currently we don't). */ -const struct elf_size_info arc_elfNN_size_info = +const struct elf_size_info ARCAA_elfNN_size_info = { sizeof (ElfNN_External_Ehdr), sizeof (ElfNN_External_Phdr), @@ -3541,7 +3541,11 @@ arc_elf_relax_section (bfd *abfd, asection *sec, #define TARGET_LITTLE_SYM arcAA_elfNN_le_vec #define TARGET_LITTLE_NAME "elfNN-littlearcAA" -#define TARGET_BIG_SYM arc_elfNN_be_vec + +#if (ARCH_TYPE == ARC) && (ARCH_SIZE == 32) +# define TARGET_BIG_SYM arc_elfNN_be_vec +#endif + #define TARGET_BIG_NAME "elfNN-bigarc" #define ELF_ARCH ARC_BFD_ARCH #define ELF_TARGET_ID ARC_ELF_DATA @@ -3567,7 +3571,7 @@ arc_elf_relax_section (bfd *abfd, asection *sec, #define bfd_elfNN_bfd_copy_private_bfd_data arc_elf_copy_private_bfd_data #define bfd_elfNN_bfd_relax_section arc_elf_relax_section -#define elf_backend_size_info arc_elfNN_size_info +#define elf_backend_size_info ARCAA_elfNN_size_info #define elf_info_to_howto_rel arc_info_to_howto_rel #define elf_backend_object_p arc_elf_object_p -- 2.30.2