This is the mail archive of the libc-alpha@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]

[PATCH][BZ #17250] Static dlopen default library search path fix


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,
   };


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