xtensa: use definitions from xtensa-config.h

Message ID baffaf673f17692b7bcbd604b31800b189988596.camel@espressif.com
State Corrupt patch
Headers
Series xtensa: use definitions from xtensa-config.h |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Alexey Lapshin Oct. 18, 2022, 12:12 p.m. UTC
  From 08677e05abb4b9df0819907eac0b25323539089c Mon Sep 17 00:00:00 2001
From: Alexey Lapshin <alexey.lapshin@espressif.com>
Date: Tue, 18 Oct 2022 14:03:37 +0400
Subject: [PATCH] xtensa: use definitions from xtensa-config.h


These changes are just refactored xtensa config macro definitions to
declare them in one place.


---
 bfd/elf32-xtensa.c        | 16 ----------------
 gas/config/tc-xtensa.c    |  8 --------
 gas/config/xtensa-relax.c |  4 ----
 gdb/xtensa-tdep.h         |  8 --------
 include/xtensa-config.h   | 20 +++++++++++++++++---
 ld/emultempl/xtensaelf.em | 13 -------------
 6 files changed, 17 insertions(+), 52 deletions(-)

*);
 static void xtensa_strip_inconsistent_linkonce_sections
-- 
2.34.1
  

Comments

Nick Clifton Oct. 18, 2022, 2:54 p.m. UTC | #1
Hi Alexey,

> These changes are just refactored xtensa config macro definitions to
> declare them in one place.

Approved - please apply.

Cheers
   Nick
  

Patch

diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index cb658483ca6..0dd551a1a3a 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -37,22 +37,6 @@ 
 
 #define XTENSA_NO_NOP_REMOVAL 0
 
-#ifndef XSHAL_ABI
-#define XSHAL_ABI 0
-#endif
-
-#ifndef XTHAL_ABI_UNDEFINED
-#define XTHAL_ABI_UNDEFINED -1
-#endif
-
-#ifndef XTHAL_ABI_WINDOWED
-#define XTHAL_ABI_WINDOWED 0
-#endif
-
-#ifndef XTHAL_ABI_CALL0
-#define XTHAL_ABI_CALL0 1
-#endif
-
 /* Local helper functions.  */
 
 static bool add_extra_plt_sections (struct bfd_link_info *, int);
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 98c2c663994..03d6714e916 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -31,14 +31,6 @@ 
 #include "elf/xtensa.h"
 
 /* Provide default values for new configuration settings.  */
-#ifndef XTHAL_ABI_WINDOWED
-#define XTHAL_ABI_WINDOWED 0
-#endif
-
-#ifndef XTHAL_ABI_CALL0
-#define XTHAL_ABI_CALL0 1
-#endif
-
 #ifndef XTENSA_MARCH_EARLIEST
 #define XTENSA_MARCH_EARLIEST 0
 #endif
diff --git a/gas/config/xtensa-relax.c b/gas/config/xtensa-relax.c
index aad9ae7d348..351c79e83d7 100644
--- a/gas/config/xtensa-relax.c
+++ b/gas/config/xtensa-relax.c
@@ -95,10 +95,6 @@ 
 #include <stddef.h>
 #include "xtensa-config.h"
 
-#ifndef XCHAL_HAVE_WIDE_BRANCHES
-#define XCHAL_HAVE_WIDE_BRANCHES 0
-#endif
-
 /* Imported from bfd.  */
 extern xtensa_isa xtensa_default_isa;
 
diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h
index 1840ef98b49..a705ac72c39 100644
--- a/gdb/xtensa-tdep.h
+++ b/gdb/xtensa-tdep.h
@@ -157,14 +157,6 @@  struct ctype_cache
   struct type *virtual_type;
 };
 
-#ifndef XCHAL_NUM_CONTEXTS
-# define XCHAL_NUM_CONTEXTS	0
-#endif
-
-#ifndef XCHAL_HAVE_EXCEPTIONS
-# define XCHAL_HAVE_EXCEPTIONS	1
-#endif
-
 /*  Xtensa-specific target dependencies.  */
 
 struct xtensa_gdbarch_tdep : gdbarch_tdep
diff --git a/include/xtensa-config.h b/include/xtensa-config.h
index 03963da6c7f..41e766508d0 100644
--- a/include/xtensa-config.h
+++ b/include/xtensa-config.h
@@ -166,11 +166,25 @@ 
 #define XCHAL_INST_FETCH_WIDTH		4
 
 
-#undef XSHAL_ABI
+
 #undef XTHAL_ABI_WINDOWED
-#undef XTHAL_ABI_CALL0
-#define XSHAL_ABI			XTHAL_ABI_WINDOWED
 #define XTHAL_ABI_WINDOWED		0
+
+#undef XTHAL_ABI_CALL0
 #define XTHAL_ABI_CALL0			1
 
+#undef XSHAL_ABI
+#define XSHAL_ABI			XTHAL_ABI_WINDOWED
+
+#undef XTHAL_ABI_UNDEFINED
+#define XTHAL_ABI_UNDEFINED		-1
+
+
+
+#undef XCHAL_NUM_CONTEXTS
+#define XCHAL_NUM_CONTEXTS      0
+
+#undef XCHAL_HAVE_EXCEPTIONS
+#define XCHAL_HAVE_EXCEPTIONS   1
+
 #endif /* !XTENSA_CONFIG_H */
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
index 756e33cbff0..9d82b11d2bb 100644
--- a/ld/emultempl/xtensaelf.em
+++ b/ld/emultempl/xtensaelf.em
@@ -29,19 +29,6 @@  fragment <<EOF
 #include "elf/xtensa.h"
 #include "bfd.h"
 
-/* Provide default values for new configuration settings.  */
-#ifndef XTHAL_ABI_UNDEFINED
-#define XTHAL_ABI_UNDEFINED -1
-#endif
-
-#ifndef XTHAL_ABI_WINDOWED
-#define XTHAL_ABI_WINDOWED 0
-#endif
-
-#ifndef XTHAL_ABI_CALL0
-#define XTHAL_ABI_CALL0 1
-#endif
-
 static void xtensa_wild_group_interleave (lang_statement_union_type
*);
 static void xtensa_colocate_output_literals (lang_statement_union_type