aboutsummaryrefslogtreecommitdiff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2012-08-22 00:43:21 +0000
committerDmitry V. Levin <ldv@altlinux.org>2012-09-19 21:28:13 +0000
commitf3fd569c365ca5149fedbbc6c7a902aa1f8e5b60 (patch)
tree89dbb8ca66ab59f6e35855283a0fda11203f96ce /elf/rtld.c
parentae30640a32b8f4057ab32ec7a3f48f77c344b79e (diff)
downloadglibc-f3fd569c365ca5149fedbbc6c7a902aa1f8e5b60.zip
glibc-f3fd569c365ca5149fedbbc6c7a902aa1f8e5b60.tar.gz
glibc-f3fd569c365ca5149fedbbc6c7a902aa1f8e5b60.tar.bz2
rtld: limit self loading check to normal mode only
Commit glibc-2.14~10 disallowed rtld self loading to avoid a segfault that used to happen when rtld was loading itself in normal mode. Unfortunately, that commit disallowed all modes of self loading, including those that used to work before. This change limits the check for self loading to normal mode only, so that instruments like ldd could handle rtld properly.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index fc221ac..ed0a86b 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1093,7 +1093,8 @@ of this helper program; chances are you did not intend to run this program.\n\
/* Now the map for the main executable is available. */
main_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
- if (GL(dl_rtld_map).l_info[DT_SONAME] != NULL
+ if (__builtin_expect (mode, normal) == normal
+ && GL(dl_rtld_map).l_info[DT_SONAME] != NULL
&& main_map->l_info[DT_SONAME] != NULL
&& strcmp ((const char *) D_PTR (&GL(dl_rtld_map), l_info[DT_STRTAB])
+ GL(dl_rtld_map).l_info[DT_SONAME]->d_un.d_val,