summaryrefslogtreecommitdiff
path: root/elf/dl-iteratephdr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-11-12 01:49:14 -0500
committerUlrich Drepper <drepper@gmail.com>2011-11-12 01:49:14 -0500
commit3a2edc79edb6c802679ac930f82ce1e261a2aabd (patch)
tree34ec838e88c095504957889dec2de3a0a76240ba /elf/dl-iteratephdr.c
parentf3c2577fdc5755c0c70e72df57d4c25b77552bce (diff)
Fix warning in __dl_iterate_phdr
Diffstat (limited to 'elf/dl-iteratephdr.c')
-rw-r--r--elf/dl-iteratephdr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/dl-iteratephdr.c b/elf/dl-iteratephdr.c
index 45107a9b6c..33b56c9627 100644
--- a/elf/dl-iteratephdr.c
+++ b/elf/dl-iteratephdr.c
@@ -44,9 +44,10 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
/* We have to determine the namespace of the caller since this determines
which namespace is reported. */
- const void *caller = RETURN_ADDRESS (0);
size_t nloaded = GL(dl_ns)[0]._ns_nloaded;
Lmid_t ns = 0;
+#ifdef SHARED
+ const void *caller = RETURN_ADDRESS (0);
for (Lmid_t cnt = GL(dl_nns) - 1; cnt > 0; --cnt)
for (struct link_map *l = GL(dl_ns)[cnt]._ns_loaded; l; l = l->l_next)
{
@@ -59,6 +60,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
|| _dl_addr_inside_object (l, (ElfW(Addr)) caller)))
ns = cnt;
}
+#endif
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
{