mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: dfi_elf: factor out some ELF functionalities
This makes them reuseable and testable. 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:
committed by
Jan Höppner
parent
8d7e8a87b5
commit
776e5d41d7
@@ -34,6 +34,22 @@ void *ehdr_init(Elf64_Ehdr *ehdr, Elf64_Half phnum)
|
||||
return ehdr + 1;
|
||||
}
|
||||
|
||||
bool ehdr_is_elf_object(const Elf64_Ehdr *ehdr)
|
||||
{
|
||||
return (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) == 0);
|
||||
}
|
||||
|
||||
bool ehdr_is_vmcore(const Elf64_Ehdr *ehdr)
|
||||
{
|
||||
return ehdr->e_type == ET_CORE;
|
||||
}
|
||||
|
||||
bool ehdr_is_s390x(const Elf64_Ehdr *ehdr)
|
||||
{
|
||||
return ehdr->e_machine == EM_S390 &&
|
||||
ehdr->e_ident[EI_CLASS] == ELFCLASS64;
|
||||
}
|
||||
|
||||
void *nt_init(void *buf, Elf64_Word type, const void *desc, int d_len,
|
||||
const char *name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user