common: elf: load elf directly from file
Currently, elf file must be loaded into a buffer and then passed to
elf_load_image. This requires to copy the whole elf file before booting
it. This commit allows to pass the filename directly and will allocate
data only for the elf header (elf header + program headers). This will
then be used to load the elf data from the file without copying it in an
intermediate buffer. Elf segments are first parsed into a list and are
then loaded from the file in a second time.

Signed-off-by: Clement Leger <cleger@kalray.eu>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 860fbba commit 7a7cc824c7d748eb6b6821c2fcdb04074cede97b
@Clement Leger Clement Leger authored on 12 Jun 2020
Sascha Hauer committed on 15 Jun 2020
Showing 3 changed files
View
arch/mips/lib/bootm.c
View
common/elf.c
View
include/elf.h