aboutsummaryrefslogtreecommitdiff
path: root/fesvr/elf.h
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2020-01-25 20:29:50 -0800
committerAndrew Waterman <andrew@sifive.com>2020-01-25 20:29:50 -0800
commit81cf0fae1d749d1828ecf0cba9ae31f5d31b7ece (patch)
tree3c4e6b252976ed14fb6be4e47fe1f22406c9b0c9 /fesvr/elf.h
parent80b5b2f52541bb073fcfb3697651aeca0e8edcad (diff)
downloadspike-81cf0fae1d749d1828ecf0cba9ae31f5d31b7ece.zip
spike-81cf0fae1d749d1828ecf0cba9ae31f5d31b7ece.tar.gz
spike-81cf0fae1d749d1828ecf0cba9ae31f5d31b7ece.tar.bz2
Allow EM_NONE ELFs, too
Diffstat (limited to 'fesvr/elf.h')
-rw-r--r--fesvr/elf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fesvr/elf.h b/fesvr/elf.h
index c791685..a213832 100644
--- a/fesvr/elf.h
+++ b/fesvr/elf.h
@@ -7,6 +7,7 @@
#define ET_EXEC 2
#define EM_RISCV 243
+#define EM_NONE 0
#define EV_CURRENT 1
#define IS_ELF(hdr) \
@@ -19,6 +20,7 @@
#define IS_ELFBE(hdr) (IS_ELF(hdr) && (hdr).e_ident[5] == 2)
#define IS_ELF_EXEC(hdr) (IS_ELF(hdr) && (hdr).e_type == ET_EXEC)
#define IS_ELF_RISCV(hdr) (IS_ELF(hdr) && (hdr).e_machine == EM_RISCV)
+#define IS_ELF_EM_NONE(hdr) (IS_ELF(hdr) && (hdr).e_machine == EM_NONE)
#define IS_ELF_VCURRENT(hdr) (IS_ELF(hdr) && (hdr).e_version == EV_CURRENT)
#define PT_LOAD 1