This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][BZ #17250] Static dlopen default library search path fix
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Roland McGrath <roland at hack dot frob dot com>, Ondřej Bílka <neleai at seznam dot cz>, Allan McRae <allan at archlinux dot org>, libc-alpha at sourceware dot org
- Date: Tue, 4 Aug 2015 21:52:03 +0100 (BST)
- Subject: [PATCH][BZ #17250] Static dlopen default library search path fix
- Authentication-results: sourceware.org; auth=none
- References: <20131017174710 dot GA4993 at domone dot podge> <20131025210328 dot 39E69746B6 at topped-with-meat dot com> <alpine dot DEB dot 1 dot 10 dot 1310252347350 dot 12843 at tp dot orcam dot me dot uk> <20140116203847 dot GB20838 at domone dot podge> <alpine dot DEB dot 1 dot 10 dot 1401172303320 dot 4268 at tp dot orcam dot me dot uk> <20140117233957 dot 64E307441B at topped-with-meat dot com> <alpine dot DEB dot 1 dot 10 dot 1401271320170 dot 4268 at tp dot orcam dot me dot uk> <alpine dot DEB dot 1 dot 10 dot 1401291054290 dot 4268 at tp dot orcam dot me dot uk> <mvmfv3zxkhk dot fsf at hawking dot suse dot de> <alpine dot LFD dot 2 dot 20 dot 1508041538290 dot 1410 at eddie dot linux-mips dot org> <mvmvbcvvz1b dot fsf at hawking dot suse dot de>
On Tue, 4 Aug 2015, Andreas Schwab wrote:
> > What problem are you seeing or trying to solve?
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=17250
Umm, thanks. Having looked through the patch again it looks to me like I
got confused with the negative `__builtin_expect' expression. My change
was not neutral as intended as it's where DF_1_NODEFLIB is *set* that the
conditional executes.
So the solution is to leave `.l_flags_1' clear in the static link map,
and I can see `__builtin_expect' has been since changed in elf/dl-load.c
to `__glibc_unlikely' already so nothing to do here; obviously I must have
not been the only one getting confused here.
I'm not prepared to properly regression-test a change right away, but
meanwhile can you try the below as a proposed fix? Also I'm not sure
offhand how to make a test case that covers this issue, but I'll be happy
to accept ideas and implement them.
2015-08-04 Maciej W. Rozycki <macro@linux-mips.org>
[BZ #17250]
* elf/dl-support.c (_dl_main_map): Don't initialize l_flags_1
member.
Maciej
glibc-static-dlopen-17250.diff
Index: glibc/elf/dl-support.c
===================================================================
--- glibc.orig/elf/dl-support.c 2015-08-04 20:10:10.297536823 +0100
+++ glibc/elf/dl-support.c 2015-08-04 20:10:33.180771532 +0100
@@ -91,7 +91,6 @@ static struct link_map _dl_main_map =
.l_scope = _dl_main_map.l_scope_mem,
.l_local_scope = { &_dl_main_map.l_searchlist },
.l_used = 1,
- .l_flags_1 = DF_1_NODEFLIB,
.l_tls_offset = NO_TLS_OFFSET,
.l_serial = 1,
};