This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] RX: bfd - Add RXv3 support.


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

commit c8c89dac38c723a2dcff9beceb9e7c09b0c5f3d4
Author: Yoshinori Sato <ysato@users.sourceforge.jp>
Date:   Tue Dec 25 19:58:54 2018 +0900

    RX: bfd - Add RXv3 support.
    
            * bfd/archures.c: Add bfd_mach_rx_v2 and bfd_mach_rx_v3.
            * bfd/bfd-in2.h: Regenerate.
            * bfd/cpu-rx.c (arch_info_struct): Add RXv2 and RXv3 entry.
            * bfd/elf32-rx.c (elf32_rx_machine): Add RXv2 and RXv3 support.

Diff:
---
 bfd/ChangeLog  |  7 +++++++
 bfd/archures.c |  2 ++
 bfd/bfd-in2.h  |  2 ++
 bfd/cpu-rx.c   | 30 ++++++++++++++++++++++++++++++
 bfd/elf32-rx.c |  7 ++++++-
 5 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 880ee8e..3d619e4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-05  Yoshinori Sato <ysato@users.sourceforge.jp>
+
+	* bfd/archures.c: Add bfd_mach_rx_v2 and bfd_mach_rx_v3.
+	* bfd/bfd-in2.h: Regenerate.
+	* bfd/cpu-rx.c (arch_info_struct): Add RXv2 and RXv3 entry.
+	* bfd/elf32-rx.c (elf32_rx_machine): Add RXv2 and RXv3 support.
+
 2019-01-04  Lifang Xia  <lifang_xia@c-sky.com>
 
 	* config.bfd (csky-*-elf* | csky-*-linux*): Modify the csky
diff --git a/bfd/archures.c b/bfd/archures.c
index ce97059..647cf0d 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -460,6 +460,8 @@ DESCRIPTION
 .#define bfd_mach_rl78		0x75
 .  bfd_arch_rx,	       {* Renesas RX.  *}
 .#define bfd_mach_rx		0x75
+.#define bfd_mach_rx_v2		0x76
+.#define bfd_mach_rx_v3		0x77
 .  bfd_arch_s390,      {* IBM s390.  *}
 .#define bfd_mach_s390_31	31
 .#define bfd_mach_s390_64	64
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 59c48e7..b78d212 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2359,6 +2359,8 @@ enum bfd_architecture
 #define bfd_mach_rl78          0x75
   bfd_arch_rx,        /* Renesas RX.  */
 #define bfd_mach_rx            0x75
+#define bfd_mach_rx_v2         0x76
+#define bfd_mach_rx_v3         0x77
   bfd_arch_s390,      /* IBM s390.  */
 #define bfd_mach_s390_31       31
 #define bfd_mach_s390_64       64
diff --git a/bfd/cpu-rx.c b/bfd/cpu-rx.c
index 448f1e9..821edeb 100644
--- a/bfd/cpu-rx.c
+++ b/bfd/cpu-rx.c
@@ -37,6 +37,36 @@ static const bfd_arch_info_type arch_info_struct[] =
     bfd_default_compatible,	/* Architecture comparison fn.  */
     bfd_default_scan,		/* String to architecture convert fn.  */
     bfd_arch_default_fill,	/* Default fill.  */
+    &arch_info_struct[1]	/* Next in list.  */
+  },
+  {
+    32,				/* Bits per word.  */
+    32,				/* Bits per address.  */
+    8,				/* Bits per byte.  */
+    bfd_arch_rx,		/* Architecture.  */
+    bfd_mach_rx_v2,		/* Machine.  */
+    "rx:v2",			/* Architecture name.  */
+    "rx:v2",			/* Printable name.  */
+    3,				/* Section align power.  */
+    FALSE,			/* The default ?  */
+    bfd_default_compatible,	/* Architecture comparison fn.  */
+    bfd_default_scan,		/* String to architecture convert fn.  */
+    bfd_arch_default_fill,	/* Default fill.  */
+    &arch_info_struct[2]	/* Next in list.  */
+  },
+  {
+    32,				/* Bits per word.  */
+    32,				/* Bits per address.  */
+    8,				/* Bits per byte.  */
+    bfd_arch_rx,		/* Architecture.  */
+    bfd_mach_rx_v3,		/* Machine.  */
+    "rx:v3",			/* Architecture name.  */
+    "rx:v3",			/* Printable name.  */
+    3,				/* Section align power.  */
+    FALSE,			/* The default ?  */
+    bfd_default_compatible,	/* Architecture comparison fn.  */
+    bfd_default_scan,		/* String to architecture convert fn.  */
+    bfd_arch_default_fill,	/* Default fill.  */
     NULL			/* Next in list.  */
   },
 };
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index e28edb6..0b5f983 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -3212,7 +3212,12 @@ elf32_rx_machine (bfd * abfd ATTRIBUTE_UNUSED)
 	 For now we assume that the flags are OK.  */
   if ((elf_elfheader (abfd)->e_flags & EF_RX_CPU_MASK) == EF_RX_CPU_RX)
 #endif
-    return bfd_mach_rx;
+    if ((elf_elfheader (abfd)->e_flags & E_FLAG_RX_V2))
+      return bfd_mach_rx_v2;
+    else if ((elf_elfheader (abfd)->e_flags & E_FLAG_RX_V3))
+      return bfd_mach_rx_v3;
+    else
+      return bfd_mach_rx;
 
   return 0;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]