From patchwork Fri Jan 10 10:23:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 239381 List-Id: U-Boot discussion From: j-keerthy at ti.com (Keerthy) Date: Fri, 10 Jan 2020 15:53:24 +0530 Subject: [PATCH 01/10] cmd: elf: Export out load_elf_image_phdr In-Reply-To: <20200110102333.22767-1-j-keerthy@ti.com> References: <20200110102333.22767-1-j-keerthy@ti.com> Message-ID: <20200110102333.22767-2-j-keerthy@ti.com> Export out load_elf_image_phdr so that it can be reused to load elf segments outside cmd/elf Signed-off-by: Keerthy --- cmd/elf.c | 4 ++-- include/elf.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/elf.c b/cmd/elf.c index 32f12a72b9..ea76fb42aa 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -33,7 +33,7 @@ * Note if U-Boot is 32-bit, the loader assumes the to segment's * physical address and size is within the lower 32-bit address space. */ -static unsigned long load_elf64_image_phdr(unsigned long addr) +unsigned long load_elf64_image_phdr(unsigned long addr) { Elf64_Ehdr *ehdr; /* Elf header structure pointer */ Elf64_Phdr *phdr; /* Program header structure pointer */ @@ -145,7 +145,7 @@ static unsigned long load_elf64_image_shdr(unsigned long addr) * The loader firstly reads the EFI class to see if it's a 64-bit image. * If yes, call the ELF64 loader. Otherwise continue with the ELF32 loader. */ -static unsigned long load_elf_image_phdr(unsigned long addr) +unsigned long load_elf_image_phdr(unsigned long addr) { Elf32_Ehdr *ehdr; /* Elf header structure pointer */ Elf32_Phdr *phdr; /* Program header structure pointer */ diff --git a/include/elf.h b/include/elf.h index 81f40191d7..a951570686 100644 --- a/include/elf.h +++ b/include/elf.h @@ -692,6 +692,8 @@ unsigned long elf_hash(const unsigned char *name); #ifndef __ASSEMBLER__ int valid_elf_image(unsigned long addr); +unsigned long load_elf_image_phdr(unsigned long addr); +unsigned long load_elf64_image_phdr(unsigned long addr); #endif #endif /* _ELF_H */