about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/arm/dl-machine.h7
-rw-r--r--sysdeps/generic/dl-environ.c23
-rw-r--r--sysdeps/unix/sysv/linux/dl-librecon.h4
-rw-r--r--sysdeps/unix/sysv/linux/i386/dl-librecon.h8
4 files changed, 23 insertions, 19 deletions
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index ba515ebec4..24fe366784 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -103,8 +103,11 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
       if (profile)
 	{
 	  got[2] = (Elf32_Addr) &_dl_runtime_profile;
-	  /* Say that we really want profiling and the timers are started.  */
-	  _dl_profile_map = l;
+
+	  if (_dl_name_match_p (_dl_profile, l))
+	    /* Say that we really want profiling and the timers are
+	       started.  */
+	    _dl_profile_map = l;
 	}
       else
 	/* This function will get called to fix up the GOT entry indicated by
diff --git a/sysdeps/generic/dl-environ.c b/sysdeps/generic/dl-environ.c
index 26ddf922f3..9b317548ec 100644
--- a/sysdeps/generic/dl-environ.c
+++ b/sysdeps/generic/dl-environ.c
@@ -1,5 +1,5 @@
 /* Environment handling for dynamic loader.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -32,21 +32,22 @@ _dl_next_ld_env_entry (char ***position)
   char **current = *position;
   char *result = NULL;
 
-  if (current == NULL)
-    /* We start over.  */
-    current = _environ;
-
-  while (result == NULL && *current != NULL)
+  while (*current != NULL)
     {
-      if ((*current)[0] == 'L' && (*current)[1] == 'D' && (*current)[2] == '_')
-	result = *current;
+      if (__builtin_expect ((*current)[0] == 'L', 0)
+	  && (*current)[1] == 'D' && (*current)[2] == '_')
+	{
+	  result = &(*current)[3];
+
+	  /* Save current position for next visit.  */
+	  *position = ++current;
+
+	  break;
+	}
 
       ++current;
     }
 
-  /* Save current position for next visit.  */
-  *position = current;
-
   return result;
 }
 
diff --git a/sysdeps/unix/sysv/linux/dl-librecon.h b/sysdeps/unix/sysv/linux/dl-librecon.h
index b1052972f3..5c34d00edb 100644
--- a/sysdeps/unix/sysv/linux/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/dl-librecon.h
@@ -24,10 +24,10 @@
 /* Recognizing extra environment variables.  */
 #define EXTRA_LD_ENVVARS \
   case 13:								      \
-    if (memcmp (&envline[3], "ASSUME_KERNEL", 13) == 0)			      \
+    if (memcmp (envline, "ASSUME_KERNEL", 13) == 0)			      \
       {									      \
 	unsigned long int i, j, osversion = 0;				      \
-	char *p = &envline[17], *q;					      \
+	char *p = &envline[14], *q;					      \
 									      \
 	for (i = 0; i < 3; i++, p = q + 1)				      \
 	  {								      \
diff --git a/sysdeps/unix/sysv/linux/i386/dl-librecon.h b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
index 627eecf62d..acff7fc14f 100644
--- a/sysdeps/unix/sysv/linux/i386/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
@@ -49,10 +49,10 @@
 /* Recognizing extra environment variables.  */
 #define EXTRA_LD_ENVVARS \
   case 13:								      \
-    if (memcmp (&envline[3], "ASSUME_KERNEL", 13) == 0)			      \
+    if (memcmp (envline, "ASSUME_KERNEL", 13) == 0)			      \
       {									      \
 	unsigned long int i, j, osversion = 0;				      \
-	char *p = &envline[17], *q;					      \
+	char *p = &envline[14], *q;					      \
 									      \
 	for (i = 0; i < 3; i++, p = q + 1)				      \
 	  {								      \
@@ -72,9 +72,9 @@
       }									      \
 									      \
   case 15:								      \
-    if (memcmp (&envline[3], "LIBRARY_VERSION", 15) == 0)		      \
+    if (memcmp (envline, "LIBRARY_VERSION", 15) == 0)		      \
       {									      \
-	_dl_correct_cache_id = envline[19] == '5' ? 2 : 3;		      \
+	_dl_correct_cache_id = envline[16] == '5' ? 2 : 3;		      \
 	break;								      \
       }