summaryrefslogtreecommitdiff
path: root/elf/rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 3afb997f85..e26b2b9e1b 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -928,8 +928,6 @@ dl_main (const ElfW(Phdr) *phdr,
if (*user_entry == (ElfW(Addr)) ENTRY_POINT)
{
- ElfW(auxv_t) *av;
-
/* Ho ho. We are not the program interpreter! We are the program
itself! This means someone ran ld.so as a command. Well, that
might be convenient to do sometimes. We support it by
@@ -1086,13 +1084,14 @@ of this helper program; chances are you did not intend to run this program.\n\
main_map->l_name = (char *) "";
*user_entry = main_map->l_entry;
+#ifdef HAVE_AUX_VECTOR
/* Adjust the on-stack auxiliary vector so that it looks like the
binary was executed directly. */
- for (av = auxv; av->a_type != AT_NULL; av++)
+ for (ElfW(auxv_t) *av = auxv; av->a_type != AT_NULL; av++)
switch (av->a_type)
{
case AT_PHDR:
- av->a_un.a_val = phdr;
+ av->a_un.a_val = (uintptr_t) phdr;
break;
case AT_PHNUM:
av->a_un.a_val = phnum;
@@ -1101,6 +1100,7 @@ of this helper program; chances are you did not intend to run this program.\n\
av->a_un.a_val = *user_entry;
break;
}
+#endif
}
else
{