This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Detecting multiple libcs
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 3 Jun 2016 16:50:13 +0200
- Subject: Detecting multiple libcs
- Authentication-results: sourceware.org; auth=none
ptmalloc_init has this code:
#ifdef SHARED
/* In case this libc copy is in a non-default namespace, never use brk.
Likewise if dlopened from statically linked program. */
Dl_info di;
struct link_map *l;
if (_dl_open_hook != NULL
|| (_dl_addr (ptmalloc_init, &di, &l, NULL) != 0
&& l->l_ns != LM_ID_BASE))
__morecore = __failing_morecore;
#endif
But it does not seem t work because after a static dlopen, _dl_open_hook
is NULL.
Is there a way to actually detect this situation? It does not seem to
be apparent from the way the DT_INIT etc. functions are called.
Thanks,
Florian