Hi tech@,
The following check can only know whether the file is ELF or not, can't
know whether it is shared object or executable. So I think the error
message should be more accurate.
Thanks!
Best Regards
Nan Xiao
Index: ldd.c
===================================================================
RCS file: /cvs/src/libexec/ld.so/ldd/ldd.c,v
retrieving revision 1.21
diff -u -p -r1.21 ldd.c
--- ldd.c 2 Jul 2017 19:06:12 -0000 1.21
+++ ldd.c 5 Oct 2017 02:02:31 -0000
@@ -125,7 +125,7 @@ doit(char *name)
if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) ||
ehdr.e_machine != ELF_TARG_MACH) {
- warnx("%s: not an ELF executable", name);
+ warnx("%s: not an ELF file", name);
close(fd);
return 1;
}