aboutsummaryrefslogtreecommitdiff
path: root/fesvr
diff options
context:
space:
mode:
authorMarcus Comstedt <marcus@mc.pp.se>2019-08-19 19:06:10 +0200
committerChih-Min Chao <chihmin.chao@sifive.com>2019-10-29 03:34:17 -0700
commit2df5cf2078c4bdd7e827b3789248d833f1c72750 (patch)
treeee2e388d2e6843c69649c4d1e7b43e4a2aab505d /fesvr
parent65648669c15343cb1aa6b102cf2eae0ed91024cd (diff)
downloadspike-2df5cf2078c4bdd7e827b3789248d833f1c72750.zip
spike-2df5cf2078c4bdd7e827b3789248d833f1c72750.tar.gz
spike-2df5cf2078c4bdd7e827b3789248d833f1c72750.tar.bz2
Whithhold BE ELF loading until BE target support is available
Diffstat (limited to 'fesvr')
-rw-r--r--fesvr/elfloader.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/fesvr/elfloader.cc b/fesvr/elfloader.cc
index 6e764ef..610e520 100644
--- a/fesvr/elfloader.cc
+++ b/fesvr/elfloader.cc
@@ -31,7 +31,7 @@ std::map<std::string, uint64_t> load_elf(const char* fn, memif_t* memif, reg_t*
assert(size >= sizeof(Elf64_Ehdr));
const Elf64_Ehdr* eh64 = (const Elf64_Ehdr*)buf;
assert(IS_ELF32(*eh64) || IS_ELF64(*eh64));
- assert(IS_ELFLE(*eh64) || IS_ELFBE(*eh64));
+ assert(IS_ELFLE(*eh64));
std::vector<uint8_t> zeros;
std::map<std::string, uint64_t> symbols;
@@ -81,15 +81,9 @@ std::map<std::string, uint64_t> load_elf(const char* fn, memif_t* memif, reg_t*
} while(0)
if (IS_ELF32(*eh64))
- if (IS_ELFLE(*eh64))
- LOAD_ELF(Elf32_Ehdr, Elf32_Phdr, Elf32_Shdr, Elf32_Sym, from_le);
- else
- LOAD_ELF(Elf32_Ehdr, Elf32_Phdr, Elf32_Shdr, Elf32_Sym, from_be);
+ LOAD_ELF(Elf32_Ehdr, Elf32_Phdr, Elf32_Shdr, Elf32_Sym, from_le);
else
- if (IS_ELFLE(*eh64))
- LOAD_ELF(Elf64_Ehdr, Elf64_Phdr, Elf64_Shdr, Elf64_Sym, from_le);
- else
- LOAD_ELF(Elf64_Ehdr, Elf64_Phdr, Elf64_Shdr, Elf64_Sym, from_be);
+ LOAD_ELF(Elf64_Ehdr, Elf64_Phdr, Elf64_Shdr, Elf64_Sym, from_le);
munmap(buf, size);