public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] Add support for an ARMMAGIC value of 0xa00 to the PE dumper.
Date: Tue, 30 May 2023 10:42:45 +0000 (GMT)	[thread overview]
Message-ID: <20230530104245.058FB3858D28@sourceware.org> (raw)

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

commit 7b9e7db08340cb3934a5fa95503fda523e0917b7
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue May 30 11:42:16 2023 +0100

    Add support for an ARMMAGIC value of 0xa00 to the PE dumper.

Diff:
---
 binutils/ChangeLog |  5 +++++
 binutils/od-pe.c   | 22 ++++++++++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b041050dc95..883163198ad 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2023-05-30  Nick Clifton  <nickc@redhat.com>
+
+	* od-pe.c (decode_machine_number): Add ARMMAGIC value of 0xa00.
+	(is_pe_object_magic): Likewise.
+
 2023-05-26  Nick Clifton  <nickc@redhat.com>
 
 	* od-pe.c: New file: Dumps fields in PE format headers.
diff --git a/binutils/od-pe.c b/binutils/od-pe.c
index 5a57a6e7486..28a64ff5736 100644
--- a/binutils/od-pe.c
+++ b/binutils/od-pe.c
@@ -202,15 +202,21 @@ decode_machine_number (unsigned int machine)
     case IMAGE_FILE_MACHINE_AMD64:       return "AMD64";
     case IMAGE_FILE_MACHINE_ARM:         return "ARM";
     case IMAGE_FILE_MACHINE_ARM64:       return "ARM64";
+    case IMAGE_FILE_MACHINE_ARMNT:       return "ARM NT";
     case IMAGE_FILE_MACHINE_I386:        return "I386";
     case IMAGE_FILE_MACHINE_IA64:        return "IA64";
     case IMAGE_FILE_MACHINE_LOONGARCH64: return "LOONGARCH64";
     case IMAGE_FILE_MACHINE_POWERPC:     return "POWERPC";
+      
+      /* Note - when adding numbers here, also add them to
+	 is_pe_object_magic() below.  */
+    case 0x0093:                         return "TI C4X";
     case 0x0500:                         return "SH (big endian)";
     case 0x0550:                         return "SH (little endian)";
+    case 0x0a00:                         return "ARM";
     case 0x0b00:                         return "MCore";
-    case 0x0093:                         return "TI C4X";
       // FIXME: Add more machine numbers.
+
     default: return N_("unknown");
     }
 }
@@ -448,22 +454,26 @@ is_pe_object_magic (unsigned short magic)
   switch (magic)
     {
     case IMAGE_FILE_MACHINE_ALPHA:
-    case IMAGE_FILE_MACHINE_ARM:
+    case IMAGE_FILE_MACHINE_AMD64:
     case IMAGE_FILE_MACHINE_ARM64:
+    case IMAGE_FILE_MACHINE_ARM:
     case IMAGE_FILE_MACHINE_ARMNT:
     case IMAGE_FILE_MACHINE_I386:
     case IMAGE_FILE_MACHINE_IA64:
-    case IMAGE_FILE_MACHINE_POWERPC:
     case IMAGE_FILE_MACHINE_LOONGARCH64:
-    case IMAGE_FILE_MACHINE_AMD64:
+    case IMAGE_FILE_MACHINE_POWERPC:
       // FIXME: Add more machine numbers.
       return true;
-    case 0x0a00: /* ARMMAGIC */
+
+      /* Note - when adding numbers here, also add them to
+	 decode_machine_number() above.  */
+    case 0x0093: /* TI C4x */
     case 0x0500: /* SH_ARCH_MAGIC_BIG */
     case 0x0550: /* SH_ARCH_MAGIC_LITTLE */
+    case 0x0a00: /* ARMMAGIC */
     case 0x0b00: /* MCore */
-    case 0x0093: /* TI C4x */
       return true;
+
     default:
       return false;
     }

                 reply	other threads:[~2023-05-30 10:42 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=20230530104245.058FB3858D28@sourceware.org \
    --to=nickc@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).