From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109058 invoked by alias); 19 Jul 2019 13:43:46 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 109047 invoked by uid 89); 19 Jul 2019 13:43:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=ldv X-Spam-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: vmicros1.altlinux.org Received: from vmicros1.altlinux.org (HELO vmicros1.altlinux.org) (194.107.17.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jul 2019 13:43:44 +0000 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 0650472CA65; Fri, 19 Jul 2019 16:43:42 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id EB0047CC774; Fri, 19 Jul 2019 16:43:41 +0300 (MSK) Date: Fri, 19 Jul 2019 13:43:00 -0000 From: "Dmitry V. Levin" To: elfutils-devel@sourceware.org Cc: Mark Wielaard , Florian Weimer , Panu Matilainen Subject: Re: [PATCH] elfclassify tool Message-ID: <20190719134341.GA26346@altlinux.org> References: <87k1fz8c9q.fsf@oldenburg2.str.redhat.com> <2e6a27c552ae5e365db54ca6b432c77c9ad5b041.camel@klomp.org> <871s22yybt.fsf@oldenburg2.str.redhat.com> <8736mfzhob.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2019-q3/txt/msg00064.txt.bz2 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 782 On Fri, Jul 19, 2019 at 02:47:09PM +0200, Mark Wielaard wrote: [...] > +static bool > +is_shared (void) > +{ > + if (!is_loadable ()) > + return false; > + > + /* The ELF type is very clear: this is an executable. */ > + if (elf_type =3D=3D ET_EXEC) > + return false; > + > + /* If the object is marked as PIE, it is definitely an executable, > + and not a loadlable shared object. */ > + if (has_pie_flag) > + return false; > + > + /* Treat a DT_SONAME tag as a strong indicator that this is a shared > + object. */ > + if (has_soname) > + return true; I'm not sure DT_SONAME is a reliable indicator. I've seen many cases of DT_SONAME being erroneously applied to=20 non-libraries, e.g. lib.so was used as soname in openjdk executables. --=20 ldv --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature; name="signature.asc" Content-length: 801 -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJdMckNAAoJEAVFT+BVnCUIRXsP/2keB6lJIoMPDxxNuqCqgjNc ojVx4c1dm3tSjiK+IkoNrL81xYddkoT4fHPq8v2WnfqY3G6QcOynxXKkXDW4xmP8 JRaKOGjTDZ7PbSVv5qp+WANmrYlVs8YhLitegRvV9hSF7mWaro0yd9P3ZvVNrItT TU5mavT9RgeyTERdpYgz8RE8hsqodiT+LemiZQNl1F8WOK2YWNPPuMhHYSELR3uX hK/9/jPzjbaFnkfUHfsCW7IxBHnJEbI02qmaQnLSLqvtfo6/PymFeEQMNFUUmzNW DHiay+GWyGY4H3UY0H+vItygO+YwK791XiXb7pBiXmRA+pd4dvsXs9OUdGV1NObV ddMd0GaRug7QqH8f4cZEDsFI2WgdR6z4a1BmJFHgo/U1+Z9+Hi4BMiGRe88nYFZC RtlY7BPMKXLGfHrNUIiPe8saIhK+wl/OWf8i46ELC3aiRzdozmkWqE2x9JyTxX8/ H0Xh5WhZMz6lp1TLNytaJbU7joqGE1q++1MHww/GOr37AeFosoyuHQOGykuOywyR QVFwMkS6SNgSvVfWVNkJ8ccqrssaoVybDd8aZQPdNY1Op712aduP/oyoWuLrgItH uiX2a85f4EfAkJYvOLruyP6js5EmxsaN8uiukowYyBw3VxbbdumNsx/oVSJPe4uQ dxuAeKghEr+rKi5diEvA =fDVV -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--