Inspect ELF header and reject any non-FreeBSD shared objects.

MFC after:	2 weeks
This commit is contained in:
Maxim Sobolev 2002-02-08 04:08:57 +00:00
parent a060acb154
commit 97b79abc86

View File

@ -171,7 +171,13 @@ char *argv[];
warnx("%s: not a dynamic executable", *argv);
file_ok = 0;
} else if (hdr.elf.e_type == ET_DYN) {
is_shlib = 1;
if (hdr.elf.e_ident[EI_OSABI] & ELFOSABI_FREEBSD) {
is_shlib = 1;
} else {
warnx("%s: not a FreeBSD ELF shared "
"object", *argv);
file_ok = 0;
}
}
} else {
warnx("%s: not a dynamic executable", *argv);