public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] x86: use IS_ELF
Date: Fri, 17 Nov 2023 10:21:41 +0000 (GMT)	[thread overview]
Message-ID: <20231117102141.5815E3858021@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ed049bd6d8108f0e762c58b9c90334ea1f2cb0e9

commit ed049bd6d8108f0e762c58b9c90334ea1f2cb0e9
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Nov 17 11:21:13 2023 +0100

    x86: use IS_ELF
    
    ... instead of (inefficiently) open-coding it.

Diff:
---
 gas/config/tc-i386.c | 5 ++---
 gas/config/tc-i386.h | 6 ++----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 1076d51bc7d..96065ae3b71 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3063,8 +3063,7 @@ i386_arch (void)
 {
   if (cpu_arch_isa == PROCESSOR_IAMCU)
     {
-      if (OUTPUT_FLAVOR != bfd_target_elf_flavour
-	  || flag_code == CODE_64BIT)
+      if (!IS_ELF || flag_code == CODE_64BIT)
 	as_fatal (_("Intel MCU is 32bit ELF only"));
       return bfd_arch_iamcu;
     }
@@ -3087,7 +3086,7 @@ i386_mach (void)
     {
       if (cpu_arch_isa == PROCESSOR_IAMCU)
 	{
-	  if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
+	  if (!IS_ELF)
 	    as_fatal (_("Intel MCU is 32bit ELF only"));
 	  return bfd_mach_i386_iamcu;
 	}
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 31f2f015c74..5db25087290 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -154,11 +154,9 @@ extern int tc_i386_fix_adjustable (struct fix *);
 /* ELF wants external syms kept, as does PE COFF.  */
 #if defined (TE_PE) && defined (STRICT_PE_FORMAT)
 #define EXTERN_FORCE_RELOC				\
-  (OUTPUT_FLAVOR == bfd_target_elf_flavour		\
-   || OUTPUT_FLAVOR == bfd_target_coff_flavour)
+  (IS_ELF || OUTPUT_FLAVOR == bfd_target_coff_flavour)
 #else
-#define EXTERN_FORCE_RELOC				\
-  (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+#define EXTERN_FORCE_RELOC	IS_ELF
 #endif
 
 /* This expression evaluates to true if the relocation is for a local

                 reply	other threads:[~2023-11-17 10:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231117102141.5815E3858021@sourceware.org \
    --to=jbeulich@sourceware.org \
    --cc=bfd-cvs@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).