X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=elf%2Felftype.c;fp=elf%2Felftype.c;h=146e892be614d5a88c325b6607ebb27c28156b27;hp=7d3365da262463fd1e311cde15cdd435fc1f86a4;hb=e6933c72f5a3ada5dd955bf388f129971727e345;hpb=d17a93e463656f234174c65b1a97b9e4fda7e505 diff --git a/elf/elftype.c b/elf/elftype.c index 7d3365d..146e892 100644 --- a/elf/elftype.c +++ b/elf/elftype.c @@ -62,10 +62,25 @@ int main(int ac, char **av) { if (!want) want = (RELOCATABLE|EXECUTABLE|DYNAMIC|CORE); if (list) { + int type; quiet = 2; perr = 0; while (readline(list, fn)) { - if (checkfile(fn, want,perr,quiet)) { + if ((type = checkfile(fn, want,perr,quiet)) & want) { + if (printtype) { + switch (type) { + case RELOCATABLE: + printf("relocatable "); break; + case EXECUTABLE: + printf("executable "); break; + case DYNAMIC: + printf("dynamic "); break; + case CORE: + printf("core "); break; + default: + printf("notelf "); break; + } + } printf("%s\n", fn); } }