Browse Source
Use kassert in load_elf (#327)
Signed-off-by: Zixian Cai <2891235+caizixian@users.noreply.github.com>
pull/328/head
Zixian Cai
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
3 deletions
-
pk/elf.c
|
|
|
@ -38,13 +38,13 @@ void load_elf(const char* fn, elf_info* info) |
|
|
|
goto fail; |
|
|
|
|
|
|
|
#if __riscv_xlen == 64 |
|
|
|
assert(IS_ELF64(eh)); |
|
|
|
kassert(IS_ELF64(eh)); |
|
|
|
#else |
|
|
|
assert(IS_ELF32(eh)); |
|
|
|
kassert(IS_ELF32(eh)); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifndef __riscv_compressed |
|
|
|
assert(!(eh.e_flags & EF_RISCV_RVC)); |
|
|
|
kassert(!(eh.e_flags & EF_RISCV_RVC)); |
|
|
|
#endif |
|
|
|
|
|
|
|
size_t phdr_size = eh.e_phnum * sizeof(Elf_Phdr); |
|
|
|
|