[PATCH] ld.so: command argument "--preload"

Florian Weimer fweimer@redhat.com
Wed Oct 24 10:55:00 GMT 2018


* David Newall:

> I worked around a deficiency in a 3rd party binary, via LD_PRELOAD,
> however any sub-process invoked by that binary tried (as advertised) to
> load the library, too.  When I needed to run the (32-bit) binary under a
> 64-bit OS, I found that the sub-processes worked, but elicited an ugly
> error about wrong ELF class.  What I needed was a way of preloading a
> library for only the binary that I was executing, and not for any
> sub-process (e.g. executed via system(3)).
>
> I feel that a --preload argument is a minor change on top of which the
> LD_PRELOAD environment variable should be built.  That is, there should
> be a way to preload a library without it propagating to all
> sub-processes.

For some reason, the patch as posted does not apply to master.

I think the general approach of the patch is fine.  Could you write a
test case for it?

Thanks,
Florian



More information about the Libc-alpha mailing list