diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2012-08-22 00:43:21 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2012-09-19 21:28:13 +0000 |
commit | f3fd569c365ca5149fedbbc6c7a902aa1f8e5b60 (patch) | |
tree | 89dbb8ca66ab59f6e35855283a0fda11203f96ce /elf/rtld.c | |
parent | ae30640a32b8f4057ab32ec7a3f48f77c344b79e (diff) | |
download | glibc-f3fd569c365ca5149fedbbc6c7a902aa1f8e5b60.tar.gz |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/rtld.c b/elf/rtld.c index fc221ace25..ed0a86bb3d 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, |