This is the mail archive of the binutils@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]

[committed] readelf: Handle E_MIPS_MACH_5900


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.
---

 Committed to master and backported to 2.29.

  Maciej

---
 binutils/readelf.c                     |    1 +
 gas/testsuite/gas/mips/elf_mach_5900.d |   22 ++++++++++++++++++++++
 gas/testsuite/gas/mips/mips.exp        |    1 +
 3 files changed, 24 insertions(+)

binutils-readelf-mips-mach-5900.diff
Index: binutils/binutils/readelf.c
===================================================================
--- binutils.orig/binutils/readelf.c	2017-09-15 13:53:58.000000000 +0100
+++ binutils/binutils/readelf.c	2017-09-20 17:15:24.344511360 +0100
@@ -3325,6 +3325,7 @@ get_machine_flags (unsigned e_flags, uns
 	    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: binutils/gas/testsuite/gas/mips/elf_mach_5900.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/elf_mach_5900.d	2017-09-22 00:24:03.786851341 +0100
@@ -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: binutils/gas/testsuite/gas/mips/mips.exp
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/mips.exp	2017-09-22 00:24:00.173949954 +0100
+++ binutils/gas/testsuite/gas/mips/mips.exp	2017-09-22 00:24:03.799032822 +0100
@@ -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"


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