diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-02-19 12:09:14 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-02-19 12:09:14 -0800 |
commit | 31ad71b8a4a2ef1b9692a844c3b9a938a22fb9b1 (patch) | |
tree | a0db4f0328e0c69e4c14f44ec7ee3caae2025e68 /pk/elf.c | |
parent | 676c953b798e33022a8a63a55f2c65af43442cb4 (diff) | |
download | riscv-pk-31ad71b8a4a2ef1b9692a844c3b9a938a22fb9b1.zip riscv-pk-31ad71b8a4a2ef1b9692a844c3b9a938a22fb9b1.tar.gz riscv-pk-31ad71b8a4a2ef1b9692a844c3b9a938a22fb9b1.tar.bz2 |
Remove incorrect code supporting ELF32 on RV64 and vice-versa
This is technically possible by running an RV32 supervisor on an
RV64 machine, but the M-mode and S-mode code would need to be
compiled and linked separately.
Diffstat (limited to 'pk/elf.c')
-rw-r--r-- | pk/elf.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -84,15 +84,20 @@ void load_elf(const char* fn, elf_info* info) } \ } while(0) - info->elf64 = IS_ELF64(eh64); - if (info->elf64) + if (IS_ELF64(eh64)) { +#ifndef __riscv64 + panic("can't run 64-bit ELF on 32-bit arch"); +#endif Elf64_Ehdr* eh; Elf64_Phdr* ph; LOAD_ELF; } else if (IS_ELF32(eh64)) { +#ifdef __riscv64 + panic("can't run 32-bit ELF on 64-bit arch"); +#endif Elf32_Ehdr* eh; Elf32_Phdr* ph; LOAD_ELF; |