mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: df_elf: read_elf_hdr: return Elf64_Ehdr struct
This makes the API of `read_elf_hdr` consistent with `read_elf_phdrs`. Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
4e6d43e2ac
commit
f93f437f8b
+5
-3
@@ -52,15 +52,17 @@ bool ehdr_is_s390x(const Elf64_Ehdr *ehdr)
|
||||
ehdr->e_ident[EI_CLASS] == ELFCLASS64;
|
||||
}
|
||||
|
||||
int read_elf_hdr(const struct zg_fh *fh, Elf64_Ehdr *ehdr)
|
||||
Elf64_Ehdr *read_elf_hdr(const struct zg_fh *fh)
|
||||
{
|
||||
Elf64_Ehdr *ehdr;
|
||||
const size_t ehdr_size = sizeof(*ehdr);
|
||||
|
||||
if (zg_size(fh) < ehdr_size)
|
||||
return -1;
|
||||
return NULL;
|
||||
|
||||
ehdr = util_malloc(ehdr_size);
|
||||
zg_read(fh, ehdr, ehdr_size, ZG_CHECK);
|
||||
return 0;
|
||||
return ehdr;
|
||||
}
|
||||
|
||||
Elf64_Phdr *read_elf_phdrs(const struct zg_fh *fh, const Elf64_Ehdr *ehdr, unsigned int *phdr_count)
|
||||
|
||||
Reference in New Issue
Block a user