aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorDavid Guillen Fandos <david@davidgf.net>2023-06-15 04:45:03 +0100
committerMaciej W. Rozycki <macro@orcam.me.uk>2023-06-15 04:45:03 +0100
commitdf18f71b565c29f6f1ebd385cb1aed97d00e9660 (patch)
tree9bf1c937007fab248a8c3cbee838326bac497104 /bfd
parent011365bacac6a95dab2a6a96e96503983682be50 (diff)
downloadbinutils-df18f71b565c29f6f1ebd385cb1aed97d00e9660.zip
binutils-df18f71b565c29f6f1ebd385cb1aed97d00e9660.tar.gz
binutils-df18f71b565c29f6f1ebd385cb1aed97d00e9660.tar.bz2
Add MIPS Allegrex CPU as a MIPS2-based CPU
The Allegrex CPU was created by Sony Interactive Entertainment to power their portable console, the PlayStation Portable. The pspdev organization maintains all sorts of tools to create software for said device including documentation. Signed-off-by: David Guillen Fandos <david@davidgf.net>
Diffstat (limited to 'bfd')
-rw-r--r--bfd/archures.c1
-rw-r--r--bfd/bfd-in2.h1
-rw-r--r--bfd/cpu-mips.c2
-rw-r--r--bfd/elfxx-mips.c8
4 files changed, 12 insertions, 0 deletions
diff --git a/bfd/archures.c b/bfd/archures.c
index 6fe8701..5a2a76c 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -173,6 +173,7 @@ DESCRIPTION
.#define bfd_mach_mips16000 16000
.#define bfd_mach_mips16 16
.#define bfd_mach_mips5 5
+.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31. *}
.#define bfd_mach_mips_loongson_2e 3001
.#define bfd_mach_mips_loongson_2f 3002
.#define bfd_mach_mips_gs464 3003
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 6f8a8fd..7399fb0 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1426,6 +1426,7 @@ enum bfd_architecture
#define bfd_mach_mips16000 16000
#define bfd_mach_mips16 16
#define bfd_mach_mips5 5
+#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31. */
#define bfd_mach_mips_loongson_2e 3001
#define bfd_mach_mips_loongson_2f 3002
#define bfd_mach_mips_gs464 3003
diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c
index 5d2a829..8990095 100644
--- a/bfd/cpu-mips.c
+++ b/bfd/cpu-mips.c
@@ -108,6 +108,7 @@ enum
I_mipsocteon3,
I_xlr,
I_interaptiv_mr2,
+ I_allegrex,
I_micromips
};
@@ -163,6 +164,7 @@ static const bfd_arch_info_type arch_info_struct[] =
N (64, 64, bfd_mach_mips_xlr, "mips:xlr", false, NN(I_xlr)),
N (32, 32, bfd_mach_mips_interaptiv_mr2, "mips:interaptiv-mr2", false,
NN(I_interaptiv_mr2)),
+ N (32, 32, bfd_mach_mips_allegrex, "mips:allegrex", false, NN(I_allegrex)),
N (64, 64, bfd_mach_mips_micromips, "mips:micromips", false, NULL)
};
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index a618f6f..4dfd8d0 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -6996,6 +6996,9 @@ _bfd_elf_mips_mach (flagword flags)
case E_MIPS_MACH_4010:
return bfd_mach_mips4010;
+ case E_MIPS_MACH_ALLEGREX:
+ return bfd_mach_mips_allegrex;
+
case E_MIPS_MACH_4100:
return bfd_mach_mips4100;
@@ -12331,6 +12334,10 @@ mips_set_isa_flags (bfd *abfd)
val = E_MIPS_ARCH_2 | E_MIPS_MACH_4010;
break;
+ case bfd_mach_mips_allegrex:
+ val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX;
+ break;
+
case bfd_mach_mips4000:
case bfd_mach_mips4300:
case bfd_mach_mips4400:
@@ -14588,6 +14595,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
{ bfd_mach_mips4000, bfd_mach_mips6000 },
{ bfd_mach_mipsisa32, bfd_mach_mips6000 },
{ bfd_mach_mips4010, bfd_mach_mips6000 },
+ { bfd_mach_mips_allegrex, bfd_mach_mips6000 },
/* MIPS I extensions. */
{ bfd_mach_mips6000, bfd_mach_mips3000 },