public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alexey Lapshin <alexey.lapshin@espressif.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: [PATCH] xtensa: use definitions from xtensa-config.h
Date: Tue, 18 Oct 2022 12:12:07 +0000	[thread overview]
Message-ID: <baffaf673f17692b7bcbd604b31800b189988596.camel@espressif.com> (raw)

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(-)

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
*);
 static void xtensa_strip_inconsistent_linkonce_sections
-- 
2.34.1


             reply	other threads:[~2022-10-18 12:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 12:12 Alexey Lapshin [this message]
2022-10-18 14:54 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baffaf673f17692b7bcbd604b31800b189988596.camel@espressif.com \
    --to=alexey.lapshin@espressif.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).