From b3c656629efc042c30ada9aaabb7c034f855f621 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Mon, 19 Aug 2019 19:06:10 +0200 Subject: [PATCH] Whithhold BE ELF loading until BE target support is available --- fesvr/elfloader.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fesvr/elfloader.cc b/fesvr/elfloader.cc index 6e764ef7..610e5204 100644 --- a/fesvr/elfloader.cc +++ b/fesvr/elfloader.cc @@ -31,7 +31,7 @@ std::map 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 zeros; std::map symbols; @@ -81,15 +81,9 @@ std::map 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);