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

Baojun Wang wangbj@gmail.com
Mon May 20 22:56:00 GMT 2019


Hi libc,

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? I put more
details in a gist:
https://gist.github.com/wangbj/3fb7356286ee38755005cbde26ca84ae

The reason I'm using this is to hope to create a shared object (.so)
without dependencies on any other libraries, but the shared object itself
can use library such as glibc.

Thanks
Baojun



More information about the Libc-help mailing list