This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Add bfd_mach_rx_v2
- From: Yoshinori Sato <ysato at users dot sourceforge dot jp>
- To: 1450759966-5135-1-git-send-email-ysato at users dot sourceforge dot jp, binutils at sourceware dot org
- Cc: Yoshinori Sato <ysato at users dot sourceforge dot jp>
- Date: Tue, 22 Dec 2015 14:08:57 +0900
- Subject: [PATCH] Add bfd_mach_rx_v2
- Authentication-results: sourceware.org; auth=none
- References: <1450759966-5135-1-git-send-email-ysato at users dot sourceforge dot jp>
bfd/ChangeLog
* archures.c: Add bfd_mach_rx_v2.
* bfd-in2.h: Regenerate.
* cpu-rx.c (arch_info_struct): Add v2 information.
* elf32-rx.c (elf32_rx_machine): Add v2 support.
---
bfd/archures.c | 1 +
bfd/bfd-in2.h | 1 +
bfd/cpu-rx.c | 15 +++++++++++++++
bfd/elf32-rx.c | 3 +++
4 files changed, 20 insertions(+)
diff --git a/bfd/archures.c b/bfd/archures.c
index 51068b9..3f7314c 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -445,6 +445,7 @@ DESCRIPTION
.#define bfd_mach_rl78 0x75
. bfd_arch_rx, {* Renesas RX. *}
.#define bfd_mach_rx 0x75
+.#define bfd_mach_rx_v2 0x76
. 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 39eb19a..1add349 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2257,6 +2257,7 @@ enum bfd_architecture
#define bfd_mach_rl78 0x75
bfd_arch_rx, /* Renesas RX. */
#define bfd_mach_rx 0x75
+#define bfd_mach_rx_v2 0x76
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 f929a9b..1a2e623 100644
--- a/bfd/cpu-rx.c
+++ b/bfd/cpu-rx.c
@@ -37,6 +37,21 @@ 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. */
NULL /* Next in list. */
},
};
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index 0fe853d..3b5d8ef 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -3183,6 +3183,9 @@ 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
+ if ((elf_elfheader (abfd)->e_flags & E_FLAG_RX_V2))
+ return bfd_mach_rx_v2;
+ else
return bfd_mach_rx;
return 0;
--
2.6.1