]> sourceware.org Git - glibc.git/commitdiff
* sysdeps/unix/sysv/linux/dl-origin.c (_dl_get_origin): Undo all
authorUlrich Drepper <drepper@redhat.com>
Thu, 14 Aug 2008 17:11:07 +0000 (17:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 14 Aug 2008 17:11:07 +0000 (17:11 +0000)
change related to AT_EXECFN.  We cannot use that string.
* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
_dl_execfn member.
* elf/dl-support.c: Remove _dl_execfn variable.
(_dl_aux_init): Remove handling of AT_EXECFN.
* elf/dl-sysdep.c (_dl_sysdep_start): Remove handling of AT_EXECFN.
* elf/rtld.c (process_envvars): Remove use of __ASSUME_AT_EXECFN.

ChangeLog
elf/dl-support.c
elf/dl-sysdep.c
elf/rtld.c
sysdeps/generic/ldsodefs.h
sysdeps/unix/sysv/linux/dl-origin.c

index 2415c65541421a564a2f97701bb08e2b514989ab..d69e8e7c6d9d4e815f1cee15922fc950353a0ad1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-08-14  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/dl-origin.c (_dl_get_origin): Undo all
+       change related to AT_EXECFN.  We cannot use that string.
+       * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
+       _dl_execfn member.
+       * elf/dl-support.c: Remove _dl_execfn variable.
+       (_dl_aux_init): Remove handling of AT_EXECFN.
+       * elf/dl-sysdep.c (_dl_sysdep_start): Remove handling of AT_EXECFN.
+       * elf/rtld.c (process_envvars): Remove use of __ASSUME_AT_EXECFN.
+
 2008-08-13  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #6544]
index e5b74fb4d6ba275a03d757d4adc9cc7c7959459a..6bd573ec57ef92051623894c440a6154da175521 100644 (file)
@@ -62,12 +62,8 @@ struct link_map *_dl_profile_map;
 /* This is the address of the last stack address ever used.  */
 void *__libc_stack_end;
 
-#ifndef __ASSUME_AT_EXECFN
 /* Path where the binary is found.  */
 const char *_dl_origin_path;
-#endif
-/* File Name of the executable.  */
-const char *_dl_execfn;
 
 /* Nonzero if runtime lookup should not update the .got/.plt.  */
 int _dl_bind_not;
@@ -220,9 +216,6 @@ _dl_aux_init (ElfW(auxv_t) *av)
        __libc_enable_secure = av->a_un.a_val;
        __libc_enable_secure_decided = 1;
        break;
-      case AT_EXECFN:
-       GLRO(dl_execfn) = (void *) av->a_un.a_val;
-       break;
 # ifdef DL_PLATFORM_AUXV
       DL_PLATFORM_AUXV
 # endif
index 622eeb626b1b3cdc639e7546c02c2cc86848f916..e6f4272a63d70a6191ee0e68656c2a780caf103c 100644 (file)
@@ -173,9 +173,6 @@ _dl_sysdep_start (void **start_argptr,
        GLRO(dl_sysinfo_dso) = (void *) av->a_un.a_val;
        break;
 #endif
-      case AT_EXECFN:
-       GLRO(dl_execfn) = (void *) av->a_un.a_val;
-       break;
 #ifdef DL_PLATFORM_AUXV
       DL_PLATFORM_AUXV
 #endif
index 3f2267af0eacf728b8ae51a4e1c06cbb7474d341..46bece7fa328bde6ef1b2fac8a016e3e13bb2fc0 100644 (file)
@@ -2579,12 +2579,10 @@ process_envvars (enum mode *modep)
          break;
 
        case 11:
-#ifndef __ASSUME_AT_EXECFN
          /* Path where the binary is found.  */
          if (!INTUSE(__libc_enable_secure)
              && memcmp (envline, "ORIGIN_PATH", 11) == 0)
            GLRO(dl_origin_path) = &envline[12];
-#endif
          break;
 
        case 12:
index 27c8fb620d47555246004aeedd5ae87ad5ee79be..4d857404a310936639c02c7d8f81343947d138c2 100644 (file)
@@ -593,13 +593,8 @@ struct rtld_global_ro
   /* Names of shared object for which the RPATH should be ignored.  */
   EXTERN const char *_dl_inhibit_rpath;
 
-#ifndef __ASSUME_AT_EXECFN
   /* Location of the binary.  */
   EXTERN const char *_dl_origin_path;
-#endif
-
-  /* If set, points to the file name of the executable.  */
-  EXTERN const char *_dl_execfn;
 
   /* -1 if the dynamic linker should honor library load bias,
      0 if not, -2 use the default (honor biases for normal
index 64e865b92af46f099a128b7c4d5d7cad4b8499c2..a7fa53ea1d88230d89c00b42fe6e14b1e14244a1 100644 (file)
@@ -1,5 +1,5 @@
 /* Find path of executable.
-   Copyright (C) 1998-2000, 2002, 2004, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -36,28 +36,29 @@ const char *
 _dl_get_origin (void)
 {
   char linkval[PATH_MAX];
-  const char *str;
-  char *result = (char *) -1l;
+  char *result;
   int len;
+  INTERNAL_SYSCALL_DECL (err);
 
-  str = GLRO(dl_execfn);
-  if (str == NULL || str[0] != '/')
+  len = INTERNAL_SYSCALL (readlink, err, 3, "/proc/self/exe", linkval,
+                         sizeof (linkval));
+  if (! INTERNAL_SYSCALL_ERROR_P (len, err) && len > 0 && linkval[0] != '[')
     {
-      INTERNAL_SYSCALL_DECL (err);
-
-      len = INTERNAL_SYSCALL (readlink, err, 3, "/proc/self/exe", linkval,
-                             sizeof (linkval));
-      if (! INTERNAL_SYSCALL_ERROR_P (len, err)
-         && len > 0 && linkval[0] != '[')
-       str = linkval;
+      /* We can use this value.  */
+      assert (linkval[0] == '/');
+      while (len > 1 && linkval[len - 1] != '/')
+       --len;
+      result = (char *) malloc (len + 1);
+      if (result == NULL)
+       result = (char *) -1;
+      else if (len == 1)
+       memcpy (result, "/", 2);
       else
-       str = NULL;
+       *((char *) __mempcpy (result, linkval, len - 1)) = '\0';
     }
   else
-    len = strlen (str);
-
-  if (str == NULL)
     {
+      result = (char *) -1;
       /* We use the environment variable LD_ORIGIN_PATH.  If it is set make
         a copy and strip out trailing slashes.  */
       if (GLRO(dl_origin_path) != NULL)
@@ -75,20 +76,6 @@ _dl_get_origin (void)
            }
        }
     }
-  else
-    {
-      /* We can use this value.  */
-      assert (str[0] == '/');
-      while (len > 1 && str[len - 1] != '/')
-       --len;
-      result = (char *) malloc (len + 1);
-      if (result == NULL)
-       result = (char *) -1;
-      else if (len == 1)
-       memcpy (result, "/", 2);
-      else
-       *((char *) __mempcpy (result, str, len - 1)) = '\0';
-    }
 
   return result;
 }
This page took 0.066705 seconds and 5 git commands to generate.