From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8109 Path: news.gmane.org!not-for-mail From: Riyad Parvez Newsgroups: gmane.linux.lib.musl.general Subject: Making a shared library that intercepts call to main work with musl compiled binary Date: Mon, 6 Jul 2015 13:00:52 -0400 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d56e67ce6fa051a37dbcf X-Trace: ger.gmane.org 1436203876 29570 80.91.229.3 (6 Jul 2015 17:31:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jul 2015 17:31:16 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8122-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 06 19:31:12 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZCAET-0007Fy-Ns for gllmg-musl@m.gmane.org; Mon, 06 Jul 2015 19:31:05 +0200 Original-Received: (qmail 27840 invoked by uid 550); 6 Jul 2015 17:31:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5656 invoked from network); 6 Jul 2015 17:01:50 -0000 X-Received: by 10.202.91.212 with SMTP id p203mr45989218oib.108.1436202091470; Mon, 06 Jul 2015 10:01:31 -0700 (PDT) X-UUID: 034a3047-67b9-443f-8a65-13bd057348b5 X-Miltered: at mailchk-m01 with ID 559AB46B.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Virus-Scanned: clamav-milter 0.98.6 at mailchk-m01 X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mailchk-m01.uwaterloo.ca [129.97.128.141]); Mon, 06 Jul 2015 13:01:33 -0400 (EDT) X-Spam-Status: No, score=-7.0 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mailchk-r03.uwaterloo.ca Xref: news.gmane.org gmane.linux.lib.musl.general:8109 Archived-At: --001a113d56e67ce6fa051a37dbcf Content-Type: text/plain; charset=UTF-8 Hi All, I've shared library [1] which intercepts loading of a binary and does some pre-processing with the command-line arguments via "LD_PRELOAD" technique. The shared library works fine with glibc compiled binary i.e., it can intercept the call to main and does some preprocessing. But it can't intercept call to "main" in musl-compiled binary. I've compiled my binary in static mode with musl "CC=/musl-gcc -static". How can I make the shared library work with musl-compiled binary? Thanks Riyad [1]: https://github.com/dslab-epfl/s2e/blob/master/guest/init_env/init_env.c --001a113d56e67ce6fa051a37dbcf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi All,

I've shared library [= 1] which intercepts loading of a binary and does some pre-processing with t= he command-line arguments via "LD_PRELOAD" technique. The shared = library works fine with glibc compiled binary i.e., it can intercept the ca= ll to main and does some preprocessing. But it can't intercept call to = "main" in musl-compiled binary. I've compiled my binary in st= atic mode with musl "CC=3D/musl-gcc -static". How can I make the = shared library work with musl-compiled binary?

Thanks
Riyad


--001a113d56e67ce6fa051a37dbcf--