mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: df_elf: ehdr_is_elf_object: add ELF version check
Currently, only the ELF version `1` is defined by the ELF specification. See `man 5 elf` for details. Therefore of course, we do only support this version. 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
922e8cbb2f
commit
1780efae07
@@ -38,7 +38,7 @@ void *ehdr_init(Elf64_Ehdr *ehdr, Elf64_Half phnum)
|
||||
|
||||
bool ehdr_is_elf_object(const Elf64_Ehdr *ehdr)
|
||||
{
|
||||
return (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) == 0);
|
||||
return (ehdr->e_version == ELF_VERSION_1) && (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) == 0);
|
||||
}
|
||||
|
||||
bool ehdr_is_vmcore(const Elf64_Ehdr *ehdr)
|
||||
|
||||
Reference in New Issue
Block a user