]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
readelf: Handle E_MIPS_MACH_5900
authorMaciej W. Rozycki <macro@imgtec.com>
Thu, 21 Sep 2017 23:54:19 +0000 (00:54 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Thu, 21 Sep 2017 23:54:19 +0000 (00:54 +0100)
Fix commit e407c74b5b60 ("Support for MIPS R5900 (Sony Playstation 2)"),
<https://sourceware.org/ml/binutils/2012-12/msg00240.html>, and add the
handling of E_MIPS_MACH_5900, correctly showing `5900' among `Flags:' in
the output of `-h' rather than `unknown CPU'.

binutils/
* readelf.c (get_machine_flags) <E_MIPS_MACH_5900>: New case.

gas/
* testsuite/gas/mips/elf_mach_5900.d: New test.
* testsuite/gas/mips/mips.exp: Run it.

binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/testsuite/gas/mips/elf_mach_5900.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index 53ac9feb6412c05ab0ebfffb77226c47293a279b..6cf8f77c5f421815d9deac0e6ef177413a2166e7 100644 (file)
@@ -1,3 +1,7 @@
+2017-09-21  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * readelf.c (get_machine_flags) <E_MIPS_MACH_5900>: New case.
+
 2017-09-05  Nick Clifton  <nickc@redhat.com>
 
        PR 21995
index d61417aabb073587cf5fc9ccc88a2b68cdfbc8b9..9a8226fa61100f2c8d7e07d2fc056ffe5e23cf64 100644 (file)
@@ -3325,6 +3325,7 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
            case E_MIPS_MACH_4650: strcat (buf, ", 4650"); break;
            case E_MIPS_MACH_5400: strcat (buf, ", 5400"); break;
            case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break;
+           case E_MIPS_MACH_5900: strcat (buf, ", 5900"); break;
            case E_MIPS_MACH_SB1:  strcat (buf, ", sb1");  break;
            case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break;
            case E_MIPS_MACH_LS2E: strcat (buf, ", loongson-2e"); break;
index 7c9e61fe71c49b01c7f31428bfbaa901566a9799..8554dd5c86bc09a4d5e93adfa98a56645b980d10 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-21  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * testsuite/gas/mips/elf_mach_5900.d: New test.
+       * testsuite/gas/mips/mips.exp: Run it.
+
 2017-09-21  James Cowgill  <James.Cowgill@imgtec.com>
 
        PR gas/21762
diff --git a/gas/testsuite/gas/mips/elf_mach_5900.d b/gas/testsuite/gas/mips/elf_mach_5900.d
new file mode 100644 (file)
index 0000000..1df668e
--- /dev/null
@@ -0,0 +1,22 @@
+#readelf: -Ah
+#name: ELF R5900 markings
+#as: -32 -march=r5900
+#source: empty.s
+
+ELF Header:
+#...
+  Flags: +0x..92...., .*5900.*
+#...
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS3
+GPR size: 32
+CPR1 size: 32
+CPR2 size: 0
+FP ABI: .*
+ISA Extension: Toshiba R5900
+ASEs:
+       None
+FLAGS 1: .*
+FLAGS 2: .*
index 0f259d3adac2fbab9e194cb4681399e861ebb527..94c4506429db80d086223b68e10975315eb99379 100644 (file)
@@ -1149,6 +1149,7 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "elf_ase_micromips-2"
 
     # Verify that machine markings are handled properly.
+    run_dump_test "elf_mach_5900"
     run_dump_test "elf_mach_interaptiv-mr2"
 
     run_dump_test "mips-gp32-fp32-pic"