[PATCH] ld.so: add an --argv0 option

Florian Weimer fweimer@redhat.com
Mon Jul 27 05:54:05 GMT 2020


* Vincent Mihalkovic:

> Sorry, I forgot to CC the libc-alpha mailing-list on my reply.

And I think this won't make it to the list due to the HTML filters, so
here's a full quote:

> We do not need the option for shell scripting, where it is indeed not
> needed, as you say.  We are developing a tool for running dynamic
> analysis tools on RPM packages fully automatically.  The tool appends
> custom linker flags while executing the %build section of RPMs to make
> the binaries use our custom ELF interpreter.  While running the %check
> section, the interpreter takes care of running the binaries built in
> %build through the selected dynamic analyzer in a way that does not
> break the testing framework.  For this to work, we need to run dynamic
> linker explicitly.  There is currently no way to preserve the original
> argv[0], which some programs are sensitive to.  This unnecessarily
> breaks the tests running in %check of some RPM packages.
>
> An experimental implementation of the custom ELF interpreter is available
> here:
>
>     https://github.com/kdudka/cswrap/pull/2
>
> thanks for considering this idea,
> vincent mihalkovic

I was wrong about this, and it is not possible to get the desired
behavior using “exec -a”.  The question remains if just updating the
pointer is sufficient in this context, or if a more elaborate copying
operation is needed to preserve the expected semantics of the argument
vector.

I guest we could add --argv0 now (well, after the 2.32 release), and if
it's incompatible with some applications, we can perhaps tweak it later.

Thanks,
Florian



More information about the Libc-alpha mailing list