mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: dynamic linker command line invocation
Date: Fri, 8 Jan 2016 12:09:54 +0100	[thread overview]
Message-ID: <20160108110954.GC2016@debian> (raw)
In-Reply-To: <CAOkOUeczurT6FTPf5-d52LuVcu9f3ZC25+cusgoc4hAZz6aSnw@mail.gmail.com>

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


  reply	other threads:[~2016-01-08 11:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 16:59 N Jain
2016-01-04 19:22 ` Markus Wichmann
2016-01-04 20:52   ` Rich Felker
2016-01-04 20:59 ` Rich Felker
2016-01-05 16:45   ` N Jain
2016-01-05 17:32     ` Rich Felker
2016-01-05 18:00       ` N Jain
2016-01-05 18:23         ` Rich Felker
2016-01-07 23:29           ` N Jain
2016-01-08 11:09             ` Markus Wichmann [this message]
2016-01-11 17:03               ` N Jain
2016-01-12 16:24                 ` Markus Wichmann
2016-01-14 22:30                   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160108110954.GC2016@debian \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).