Date: Wed, 17 May 2017 23:10:18 +0200 From: u-uy74@...ey.se To: musl@...ts.openwall.com Subject: Re: Question about setting argv when manually using dynamic linker On Wed, May 17, 2017 at 02:16:09PM -0500, John Regan wrote: > On Wed, May 17, 2017 at 2:07 PM, <u-uy74@...ey.se> wrote: > > We do deploy dynamic linked apps without any dependencies on the libraries > > on the host. It works just fine with musl-as-it-is, including the > > questionably designed applications like busybox and gcc who > > analyze argv. > I wrote and compiled a short program that just dumps the elements in argv, > then a wrapper program that figures out the needed paths for libc, real > binary, etc, but it seems like argv gets reset by the dynamic loader. Oh, here you caught me. Apologies. Indeed the program does not see argv because the linker shifts the arguments. Please disregard my statement above. It is "correct" to the point that it works but yes we have to do unpleasant tricks for the programs analyzing argv, I just happened to have repressed that pain. (We do also reset argv but for an unrelated purpose, I confused the two cases and posted without verifying). Rich is right, there is indeed no good alternative to --argv0=foo. It would be welcome. Sorry for the noise! Rune
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.