LD_PRELOAD doesn't work with dynamic object built with `-static-pie`

Baojun Wang wangbj@gmail.com
Mon Jun 17 18:08:00 GMT 2019

Thank you for the clarification. I did turn on `LD_DEBUG` and was surprised
it didn't work.

On Tue, May 21, 2019 at 2:02 AM Florian Weimer <fweimer@redhat.com> wrote:

> * Baojun Wang:
> > I tried to build a shared object with `-static-pie`, and then used it as
> > `LD_PRELOAD`, but it didn't work, do you know why it failed?
> This will not work for multiple reasons.  The static PIE object will not
> have a dynamic symbol table, so no interposition takes place.  It also
> uses relocations which are not supported in ELF shared objects.
> glibc 2.30 will provide a clearer diagnostic for this, rejecting loading
> the object outright.
> Thanks,
> Florian

More information about the Libc-help mailing list