[File] [PATCH 1/1] magic: recognition SH4A no-FPU ELF objects

cacioandpepe artem122novak at gmail.com
Fri Oct 16 21:40:13 EDT 2026


From: Artem Novak <artem122novak at gmail.com>

---
 magic/Magdir/elf             |   3 +++
 tests/Makefile.am            |  12 ++++++++++++
 tests/sh-other-be.result     |   1 +
 tests/sh-other-be.testfile   | Bin 0 -> 52 bytes
 tests/sh-other-le.result     |   1 +
 tests/sh-other-le.testfile   | Bin 0 -> 52 bytes
 tests/sh4a-extra-be.result   |   1 +
 tests/sh4a-extra-be.testfile | Bin 0 -> 52 bytes
 tests/sh4a-extra-le.result   |   1 +
 tests/sh4a-extra-le.testfile | Bin 0 -> 52 bytes
 tests/sh4a-nofpu-be.result   |   1 +
 tests/sh4a-nofpu-be.testfile | Bin 0 -> 52 bytes
 tests/sh4a-nofpu-le.result   |   1 +
 tests/sh4a-nofpu-le.testfile | Bin 0 -> 52 bytes
 14 files changed, 21 insertions(+)
 create mode 100644 tests/sh-other-be.result
 create mode 100644 tests/sh-other-be.testfile
 create mode 100644 tests/sh-other-le.result
 create mode 100644 tests/sh-other-le.testfile
 create mode 100644 tests/sh4a-extra-be.result
 create mode 100644 tests/sh4a-extra-be.testfile
 create mode 100644 tests/sh4a-extra-le.result
 create mode 100644 tests/sh4a-extra-le.testfile
 create mode 100644 tests/sh4a-nofpu-be.result
 create mode 100644 tests/sh4a-nofpu-be.testfile
 create mode 100644 tests/sh4a-nofpu-le.result
 create mode 100644 tests/sh4a-nofpu-le.testfile

diff --git a/magic/Magdir/elf b/magic/Magdir/elf
index 404a509d..4d2c199f 100644
--- a/magic/Magdir/elf
+++ b/magic/Magdir/elf
@@ -144,7 +144,10 @@
 >>>36	lelong		&0x00800000	BE8
 >>>36	lelong		&0x00400000	LE8
 >18	leshort		41		Alpha,
+# SH4A no-FPU ELF identification contributed by Artem Novak, 2026.
 >18	leshort		42		Renesas SH,
+>>4	byte		1
+>>>36	lelong&0xff	0x11	SH4A no-FPU,
 >18	leshort		43		SPARC V9,
 >>4	byte		2
 >>>48	use		elf-sparc
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 034c63dd..e95131e7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,6 +3,18 @@ test_LDADD = $(top_builddir)/src/libmagic.la
 test_CPPFLAGS = -I$(top_builddir)/src
 
 EXTRA_DIST = \
+sh4a-nofpu-be.result \
+sh4a-nofpu-be.testfile \
+sh4a-nofpu-le.result \
+sh4a-nofpu-le.testfile \
+sh4a-extra-be.result \
+sh4a-extra-be.testfile \
+sh4a-extra-le.result \
+sh4a-extra-le.testfile \
+sh-other-be.result \
+sh-other-be.testfile \
+sh-other-le.result \
+sh-other-le.testfile \
 android-vdex-1.result \
 android-vdex-1.testfile \
 android-vdex-2.result \
diff --git a/tests/sh-other-be.result b/tests/sh-other-be.result
new file mode 100644
index 00000000..36327797
--- /dev/null
+++ b/tests/sh-other-be.result
@@ -0,0 +1 @@
+ELF 32-bit MSB relocatable, Renesas SH, version 1 (SYSV)
diff --git a/tests/sh-other-be.testfile b/tests/sh-other-be.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..dac35daa59d3ad46aa641f23d3a893b14ae0ee3c
GIT binary patch
literal 52
gcmb<-^>JflVq|~=Mg}bg1_mSnunZ at I377^G08JDD!~g&Q

literal 0
HcmV?d00001

diff --git a/tests/sh-other-le.result b/tests/sh-other-le.result
new file mode 100644
index 00000000..617f95bd
--- /dev/null
+++ b/tests/sh-other-le.result
@@ -0,0 +1 @@
+ELF 32-bit LSB relocatable, Renesas SH, version 1 (SYSV)
diff --git a/tests/sh-other-le.testfile b/tests/sh-other-le.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..a1fd8b17f659ccff1299b76f5134eb3c31530a75
GIT binary patch
literal 52
gcmb<-^>JflWMqH=Mg}bg1P>z0$-uy10%3wl08L^6!vFvP

literal 0
HcmV?d00001

diff --git a/tests/sh4a-extra-be.result b/tests/sh4a-extra-be.result
new file mode 100644
index 00000000..31156bde
--- /dev/null
+++ b/tests/sh4a-extra-be.result
@@ -0,0 +1 @@
+ELF 32-bit MSB relocatable, Renesas SH, SH4A no-FPU, version 1 (SYSV)
diff --git a/tests/sh4a-extra-be.testfile b/tests/sh4a-extra-be.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..5ffe32ba138a53b77e49f05018eeae47ed045f3c
GIT binary patch
literal 52
hcmb<-^>JflVq|~=Mg}bg1_mSnkPM?Bg9(U+U;s^u0nGpa

literal 0
HcmV?d00001

diff --git a/tests/sh4a-extra-le.result b/tests/sh4a-extra-le.result
new file mode 100644
index 00000000..24f723a0
--- /dev/null
+++ b/tests/sh4a-extra-le.result
@@ -0,0 +1 @@
+ELF 32-bit LSB relocatable, Renesas SH, SH4A no-FPU, version 1 (SYSV)
diff --git a/tests/sh4a-extra-le.testfile b/tests/sh4a-extra-le.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..1e6f0df51e4af168f4ac8f83b88ac163df157445
GIT binary patch
literal 52
gcmb<-^>JflWMqH=Mg}bg1P>xA$jHE80%3wl08Q}$%m4rY

literal 0
HcmV?d00001

diff --git a/tests/sh4a-nofpu-be.result b/tests/sh4a-nofpu-be.result
new file mode 100644
index 00000000..31156bde
--- /dev/null
+++ b/tests/sh4a-nofpu-be.result
@@ -0,0 +1 @@
+ELF 32-bit MSB relocatable, Renesas SH, SH4A no-FPU, version 1 (SYSV)
diff --git a/tests/sh4a-nofpu-be.testfile b/tests/sh4a-nofpu-be.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..aae53df6cdd05069e8c089006aa001cca445fb58
GIT binary patch
literal 52
gcmb<-^>JflVq|~=Mg}bg1_mSnu#6ys377^G08M-W%m4rY

literal 0
HcmV?d00001

diff --git a/tests/sh4a-nofpu-le.result b/tests/sh4a-nofpu-le.result
new file mode 100644
index 00000000..24f723a0
--- /dev/null
+++ b/tests/sh4a-nofpu-le.result
@@ -0,0 +1 @@
+ELF 32-bit LSB relocatable, Renesas SH, SH4A no-FPU, version 1 (SYSV)
diff --git a/tests/sh4a-nofpu-le.testfile b/tests/sh4a-nofpu-le.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..ce6a2c7e329fd2612e283525c9e688b7604d57df
GIT binary patch
literal 52
gcmb<-^>JflWMqH=Mg}bg1P>xA$iTp00%3wl08Qcn%K!iX

literal 0
HcmV?d00001

-- 
2.56.0



More information about the File mailing list