This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]