zdump: df_elf: add missing endianness check

A s390x ELF file must use big-endian encoding.

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:
Marc Hartmayer
2021-11-15 10:58:44 +01:00
committed by Jan Höppner
parent f93f437f8b
commit eef0dd4fa4

View File

@@ -48,7 +48,7 @@ bool ehdr_is_vmcore(const Elf64_Ehdr *ehdr)
bool ehdr_is_s390x(const Elf64_Ehdr *ehdr)
{
return ehdr->e_machine == EM_S390 &&
return ehdr->e_machine == EM_S390 && ehdr->e_ident[EI_DATA] == ELFDATA2MSB &&
ehdr->e_ident[EI_CLASS] == ELFCLASS64;
}