summaryrefslogtreecommitdiff
path: root/libc/elf/dl-open.c
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-07-02 00:11:45 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-07-02 00:11:45 +0000
commit94ba134cf6431dad0aaece271a16761bc793d490 (patch)
treeb2b77be695fb5add3d132101bf25f2be915f3139 /libc/elf/dl-open.c
parentf42fd2771adb82cb5f34ba9e80a607975111da48 (diff)
downloadeglibc2-94ba134cf6431dad0aaece271a16761bc793d490.tar.gz
Merge changes between r23363 and r23421 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@23422 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/elf/dl-open.c')
-rw-r--r--libc/elf/dl-open.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/libc/elf/dl-open.c b/libc/elf/dl-open.c
index 4a6a89470..356a98ff1 100644
--- a/libc/elf/dl-open.c
+++ b/libc/elf/dl-open.c
@@ -204,11 +204,9 @@ dl_open_worker (void *a)
{
const void *caller_dlopen = args->caller_dlopen;
-#ifdef SHARED
/* We have to find out from which object the caller is calling.
By default we assume this is the main application. */
call_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
-#endif
struct link_map *l = _dl_find_dso_for_object ((ElfW(Addr)) caller_dlopen);
@@ -216,15 +214,7 @@ dl_open_worker (void *a)
call_map = l;
if (args->nsid == __LM_ID_CALLER)
- {
-#ifndef SHARED
- /* In statically linked apps there might be no loaded object. */
- if (call_map == NULL)
- args->nsid = LM_ID_BASE;
- else
-#endif
- args->nsid = call_map->l_ns;
- }
+ args->nsid = call_map->l_ns;
}
assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
@@ -568,6 +558,10 @@ cannot load any more object with static TLS"));
if (relocation_in_progress)
LIBC_PROBE (reloc_complete, 3, args->nsid, r, new);
+#ifndef SHARED
+ DL_STATIC_INIT (new);
+#endif
+
/* Run the initializer functions of new objects. */
_dl_init (new, args->argc, args->argv, args->env);
@@ -638,12 +632,6 @@ no more namespaces available for dlmopen()"));
|| GL(dl_ns)[nsid]._ns_loaded->l_auditing))
_dl_signal_error (EINVAL, file, NULL,
N_("invalid target namespace in dlmopen()"));
-#ifndef SHARED
- else if ((nsid == LM_ID_BASE || nsid == __LM_ID_CALLER)
- && GL(dl_ns)[LM_ID_BASE]._ns_loaded == NULL
- && GL(dl_nns) == 0)
- GL(dl_nns) = 1;
-#endif
struct dl_open_args args;
args.file = file;
@@ -721,10 +709,6 @@ no more namespaces available for dlmopen()"));
/* Release the lock. */
__rtld_lock_unlock_recursive (GL(dl_load_lock));
-#ifndef SHARED
- DL_STATIC_INIT (args.map);
-#endif
-
return args.map;
}