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: Possible bug with dlsym and LD_PRELOAD


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


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