handle ET_DYN and ET_CORE object file types

Fixes #1.
This commit is contained in:
David du Colombier 2018-04-02 11:42:47 +02:00
parent 341f974f7a
commit 86484cad93
1 changed files with 2 additions and 2 deletions

4
elf.c
View File

@ -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;
}