summaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@codesourcery.com>2013-06-28 16:20:26 +0100
committerMaciej W. Rozycki <macro@codesourcery.com>2013-06-28 16:22:20 +0100
commitf91f1c0fb89056995f1c9c6a06c361efdf5139e7 (patch)
tree67db98c499e8dbd72bc5b49e654706d375384c0f /elf/dl-load.c
parented0257f7d3378ec4a72e297f0dcba5159f2dd138 (diff)
[BZ #15022] Correct global-scope dlopen issues in static executables.
This change creates a link map in static executables to serve as the global search list for dlopen. It fixes a problem with the inability to access the global symbol object and a crash on an attempt to map a DSO into the global scope. Some code that has become dead after the addition of this link map is removed too and test cases are provided.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 757b6ec56b..d53ead4db3 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -342,13 +342,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
if ((len = is_dst (start, name, "ORIGIN", is_path,
INTUSE(__libc_enable_secure))) != 0)
{
-#ifndef SHARED
- if (l == NULL)
- repl = _dl_get_origin ();
- else
-#endif
- repl = l->l_origin;
-
+ repl = l->l_origin;
check_for_trusted = (INTUSE(__libc_enable_secure)
&& l->l_type == lt_executable);
}