binfmt: The program headers are optional.

Fix problems mentioned in:
https://github.com/apache/nuttx/pull/10462

Brief:
rv-virt:knsh64, qemu-7.2.4
qemu-system-riscv64 -semihosting -nographic -cpu rv64 -smp 8 -M virt,aclint=on -bios none -kernel nuttx
```
[    0.006000] _assert: Current Version: NuttX  12.0.0 8a13da322d Sep  4 2023 14:31:15 risc-v
[    0.006000] _assert: Assertion failed : at file: init/nx_bringup.c:302 task: Idle_Task 0x800017fc
```

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2023-09-04 16:55:35 +08:00 committed by Xiang Xiao
parent 96a2196beb
commit 0627b9970e

View File

@ -188,8 +188,8 @@ int elf_loadphdrs(FAR struct elf_loadinfo_s *loadinfo)
if (loadinfo->ehdr.e_phnum < 1)
{
berr("No programs(?)\n");
return -EINVAL;
binfo("No programs(?)\n");
return 0;
}
/* Get the total size of the program header table */