summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/dl-minimal.c12
-rw-r--r--elf/rtld.c4
3 files changed, 10 insertions, 8 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 8ad8d98f10..9ce3ac51e2 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -146,7 +146,7 @@ $(objpfx)trusted-dirs.h: Makefile $(..)Makeconfig
 	mv -f $@T $@
 $(objpfx)rtldtbl.h: Makefile $(..)Makeconfig genrtldtbl.awk
 	$(make-target-directory)
-	echo "$(default-rpath)" | awk -f genrtldtbl.awk > $@T
+	echo "$(default-rpath)" | $(AWK) -f genrtldtbl.awk > $@T
 	mv -f $@T $@
 CPPFLAGS-dl-load.c = -I$(objpfx).
 CFLAGS-dl-load.c += -Wno-uninitialized
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 70b5aeeeac..249ff71225 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -233,6 +233,7 @@ __strtol_internal (const char *nptr, char **endptr, int base, int group)
     }
 
   assert (base == 0);
+  base = 10;
   if (*nptr == '0')
     {
       if (nptr[1] == 'x' || nptr[1] == 'X')
@@ -243,8 +244,6 @@ __strtol_internal (const char *nptr, char **endptr, int base, int group)
       else
 	base = 8;
     }
-  else
-    base = 10;
 
   while (*nptr >= '0' && *nptr <= '9')
     {
@@ -257,8 +256,9 @@ __strtol_internal (const char *nptr, char **endptr, int base, int group)
 	  errno = ERANGE;
 	  return sign > 0 ? LONG_MAX : LONG_MIN;
 	}
-      result *= 10;
+      result *= base;
       result += digval;
+      ++nptr;
     }
 
   return (long int) result * sign;
@@ -295,6 +295,7 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group)
     }
 
   assert (base == 0);
+  base = 10;
   if (*nptr == '0')
     {
       if (nptr[1] == 'x' || nptr[1] == 'X')
@@ -305,8 +306,6 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group)
       else
 	base = 8;
     }
-  else
-    base = 10;
 
   while (*nptr >= '0' && *nptr <= '9')
     {
@@ -317,8 +316,9 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group)
 	  errno = ERANGE;
 	  return ULONG_MAX;
 	}
-      result *= 10;
+      result *= base;
       result += digval;
+      ++nptr;
     }
 
   return result * sign;
diff --git a/elf/rtld.c b/elf/rtld.c
index b07a076b69..6b1a5c2b73 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -287,6 +287,7 @@ dl_main (const ElfW(Phdr) *phdr,
   char *file;
   int has_interp = 0;
   unsigned int i;
+  int paths_initialized = 0;
 
   /* Process the environment variable which control the behaviour.  */
   process_envvars (&mode, &lazy);
@@ -376,6 +377,7 @@ of this helper program; chances are you did not intend to run this program.\n\
       /* Initialize the data structures for the search paths for shared
 	 objects.  */
       _dl_init_paths (library_path);
+      paths_initialized = 1;
 
       if (mode == verify)
 	{
@@ -493,7 +495,7 @@ of this helper program; chances are you did not intend to run this program.\n\
       _exit (0);
     }
 
-  if (*user_entry != (ElfW(Addr)) &ENTRY_POINT)
+  if (! paths_initialized)
     /* Initialize the data structures for the search paths for shared
        objects.  */
     _dl_init_paths (library_path);