zdump: dfi_elf: refactor read_elf_(ehdr|phdrs)

Make the function unit testable and easier to reuse - no functional change.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2021-11-15 09:52:20 +01:00
committed by Jan Höppner
parent ff3fe4bf43
commit 8944c2f60d
3 changed files with 51 additions and 16 deletions
+13
View File
@@ -143,6 +143,19 @@ bool ehdr_is_vmcore(const Elf64_Ehdr *ehdr);
*/
bool ehdr_is_s390x(const Elf64_Ehdr *ehdr);
/*
* Read ELF header at current offset
*/
int read_elf_hdr(const struct zg_fh *fh, Elf64_Ehdr *ehdr);
/*
* Read ELF program headers
*
* To read the program headers the offset of @fh is changed.
*/
Elf64_Phdr *read_elf_phdrs(const struct zg_fh *fh, const Elf64_Ehdr *ehdr,
unsigned int *phdr_count);
/*
* Initialize ELF note
*/