From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9068 Path: news.gmane.org!not-for-mail From: Markus Wichmann Newsgroups: gmane.linux.lib.musl.general Subject: Re: dynamic linker command line invocation Date: Fri, 8 Jan 2016 12:09:54 +0100 Message-ID: <20160108110954.GC2016@debian> References: <20160104205920.GW238@brightrain.aerifal.cx> <20160105173200.GZ238@brightrain.aerifal.cx> <20160105182326.GB238@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1452251419 9608 80.91.229.3 (8 Jan 2016 11:10:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jan 2016 11:10:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9081-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jan 08 12:10:19 2016 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 1aHUvs-0005lj-ED for gllmg-musl@m.gmane.org; Fri, 08 Jan 2016 12:10:12 +0100 Original-Received: (qmail 21719 invoked by uid 550); 8 Jan 2016 11:10:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 21696 invoked from network); 8 Jan 2016 11:10:07 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:Vh3LSgGFke5iN9IZ0D7ZGXQ4u2sDxpjY8SxXOhBPu5Hzcw16agi nB8QleATKKjui8WdH5B/oDw7kzxr84IMsM+yitItl6APLUXyPDnJk7fm1zngvY6VBeyD+Vq B5p62E5jvCFIknBJKpsrTSMbuKl5x0NWP1D7WCk6RxavdggRTnOCkXX2kEDIjdgPZbl7dXq kueuZVc+p1FMd33dB5HoQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:UKOtNnIVQbs=:XXLOygtwvZsKAlRyXAhWgo cIPSNDp1fBnvaeOTAP/ppN8U8YUPQXUYxVzMVMNQVCPmA84PrkvV2N/ExwI47tQYadbPiLCM7 1TYhH+3itYylwvuKccJesVkIlOCvdllLPElZH1tNMkDka3EU5AzQqtPcv35MGFrJNxeVafbkU 0eSKn9fjmUtPHK+fu86qUyiO8jkIHUKBSyVHEzmMtNZ91kZ2+lh3Ye+zCfCOf04HWqALSq6pW XSh7XbB9Og44fsKDf405iE2Wwk7LZiTD9zLKPslgI9O2yen3YOVwK6/DAKxORrCDVsysrW9SR LeX5IB54CUr5yuCc8YiHozfRoe2GC3ppqaoSpBw0JtNZ5uNLRo0rPdu3rHWk06VQU6I5Lo3BQ ShwwrUfAzYyk/rHpG4PVJB7q2m+P/Gs+SO3W0EQ4Aeequu5RItAaVD6wfjlykZqQvud8yL76l zDOqPx+OH/DsXSaiHJ+8W4OG8y61FCbdBf7ZbzU8N/P8UkEsWUREcVBs77YDB8VyqMsyLO5nt C0EW5rjkJFkVEDq2D4kOZF3de2Kt69ZGq8TbdHZ2bMhNj1hMlmpbZ8sPUyp6yA98thtTVx4mg RpMRF2OprdOHKiO1GtNlRDKsuEqTHDGMNn1jI/PzHJeGuA62IT5Dn77H3eQVyDviwB4xydZ8y ByrpekA6MGmdFP+x7zho70tx1CavwB0N/O+XqqeQDr9eYbsbhh8cM4WVXmqUxQ1t1bIcMcfMs SKFi69FLq15YvSu1mLsgt2n4fF2ddFUWfwPqBu247ZU2a3gN7OZt1l0dZYk= Xref: news.gmane.org gmane.linux.lib.musl.general:9068 Archived-At: On Thu, Jan 07, 2016 at 06:29:48PM -0500, N Jain wrote: > Hi Rich, > > Thanks I am able to get my dynamic linker loaded into memory but facing > issue during application load at __dls3 function. > I am getting following print from MUSL - > > "musl libc > Version 1.1.10 > Dynamic Program Loader > Usage: hello.elf [options] [--] pathname--2--" > > Not sure why my application is not getting loaded in below code __dls3 > function ? > That's what I was trying to tell you in my first answer: You need to set argv[0] to something (doesn't matter so long as it's not "ldd"), and argv[1] to the program file you want to run. (And argc to 2, obviously). The only alternative to that is to load the program file in the kernel additionally to musl, and then set the following aux vectors: AT_BASE - base address of dynamic linker AT_PHDR - address of main executable's program headers AT_PHNUM, AT_PHENT - number and size of main executable's program headers, respectively. AT_ENTRY - main executable's entry point Ciao, Markus