This is the mail archive of the
mailing list for the glibc project.
Re: *** SPAM LEVEL 4.448 *** Dynamic linker behaviour difference between Linux, Hurd and FreeBSD
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Simon Richter <sjr at debian dot org>
- Cc: libc-help at sourceware dot org, bug-hurd at gnu dot org
- Date: Fri, 03 May 2013 11:17:26 -0400
- Subject: Re: *** SPAM LEVEL 4.448 *** Dynamic linker behaviour difference between Linux, Hurd and FreeBSD
- References: <5183D388 dot 5030201 at debian dot org>
On 05/03/2013 11:11 AM, Simon Richter wrote:
> I'm writing a small preload library to trace pthread_* calls, and am
> running into a bit of a chicken-and-egg problem.
> In order to find the original function, I use dlsym(RTLD_NEXT, ...) to
> look up the symbol on the first invocation. On Linux, this works find,
> however on the Hurd and on FreeBSD, the libdl invokes pthread_once,
> which is then dispatched into my preload library, where I still haven't
> found the real function.
> This could be due to a difference in dlsym() implementation (so it is
> sheer luck that it works on Linux), or a true behavioural difference
> between platforms.
> In any case, I am wondering if it is actually possible to redirect the
> pthread_* functions in this way, or if a different approach is required.
> LD_DEBUG=all output is attached for Linux (good) and FreeBSD (bad).
> Program source is also available.
You need to reduce the problem to something smaller otherwise nobody
is going to look at your code.
Can you produce a small self-contained test case that shows the
expected versus observed behaviour?