From 86484cad93800305965391a7a2713a0fee7ef09d Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 2 Apr 2018 11:42:47 +0200 Subject: [PATCH] handle ET_DYN and ET_CORE object file types Fixes #1. --- elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf.c b/elf.c index 74b69c5..112a9d1 100644 --- a/elf.c +++ b/elf.c @@ -145,7 +145,7 @@ readelf32ehdr(FILE *f, Fhdr *fp) if (verbose) printelf32ehdr(&e, fp); - if (e.type != ET_REL && e.type != ET_EXEC) { + if (e.type != ET_REL && e.type != ET_EXEC && e.type != ET_DYN && e.type != ET_CORE) { fprintf(stderr, "unsupported file type %d\n", e.type); return -1; } @@ -216,7 +216,7 @@ readelf64ehdr(FILE *f, Fhdr *fp) if (verbose) printelf64ehdr(&e, fp); - if (e.type != ET_REL && e.type != ET_EXEC) { + if (e.type != ET_REL && e.type != ET_EXEC && e.type != ET_DYN && e.type != ET_CORE) { fprintf(stderr, "unsupported file type %d\n", e.type); return -1; }