From ef272caa7482bd9031e82a2e6f1b81870fe2129e Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Fri, 22 Sep 2017 00:54:19 +0100 Subject: [PATCH] readelf: Handle E_MIPS_MACH_5900 Fix commit e407c74b5b60 ("Support for MIPS R5900 (Sony Playstation 2)"), , 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) : New case. gas/ * testsuite/gas/mips/elf_mach_5900.d: New test. * testsuite/gas/mips/mips.exp: Run it. --- binutils/ChangeLog | 4 ++++ binutils/readelf.c | 1 + gas/ChangeLog | 5 +++++ gas/testsuite/gas/mips/elf_mach_5900.d | 22 ++++++++++++++++++++++ gas/testsuite/gas/mips/mips.exp | 1 + 5 files changed, 33 insertions(+) create mode 100644 gas/testsuite/gas/mips/elf_mach_5900.d diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 53ac9feb641..6cf8f77c5f4 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2017-09-21 Maciej W. Rozycki + + * readelf.c (get_machine_flags) : New case. + 2017-09-05 Nick Clifton PR 21995 diff --git a/binutils/readelf.c b/binutils/readelf.c index d61417aabb0..9a8226fa611 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -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; diff --git a/gas/ChangeLog b/gas/ChangeLog index 7c9e61fe71c..8554dd5c86b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2017-09-21 Maciej W. Rozycki + + * testsuite/gas/mips/elf_mach_5900.d: New test. + * testsuite/gas/mips/mips.exp: Run it. + 2017-09-21 James Cowgill 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 index 00000000000..1df668e7e5b --- /dev/null +++ b/gas/testsuite/gas/mips/elf_mach_5900.d @@ -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: .* diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index 0f259d3adac..94c4506429d 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -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" -- 2.30.2