Possible bug with dlsym and LD_PRELOAD
Ángel González
keisial@gmail.com
Mon Aug 27 13:19:00 GMT 2012
On 27/08/12 10:58, Paul Millar wrote:
> Hi Ãngel,
>
> On 08/22/2012 12:20 AM, Ãngel González wrote:
>> Have you tried simply replacing dlsym() ?
>> There you could place yourself in front of any call.
>
> No, I hadn't thought of that.
>
> Although this solves the immediate problem of intercepting these
> calls, it introduces a new problem; specifically, the code now can't
> call dlsym(RTLD_NEXT, ...) in the wrapping library. Any attempt to
> call this function is mapping (by LD_PRELOAD) to the intercepting
> implementation in the wrapping library.
(...)
> So, although this solves the problem, I think I'll carry on looking
> for alternatives.
>
> Cheers,
>
> Paul.
I'm sure there's a way to still do that. Maybe with some ld trickery.
Worst case, by copying the symbol-seeking code.
Cheers
More information about the Libc-help
mailing list