about summary refs log tree commit diff
path: root/elf/dl-libc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /elf/dl-libc.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'elf/dl-libc.c')
-rw-r--r--elf/dl-libc.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/elf/dl-libc.c b/elf/dl-libc.c
index 1b995eda92..8a3f542e01 100644
--- a/elf/dl-libc.c
+++ b/elf/dl-libc.c
@@ -1,5 +1,5 @@
 /* Handle loading and unloading shared objects for internal libc purposes.
-   Copyright (C) 1999,2000,2001,2002,2004,2005 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
 
@@ -22,11 +22,6 @@
 #include <stdlib.h>
 #include <ldsodefs.h>
 
-extern int __libc_argc attribute_hidden;
-extern char **__libc_argv attribute_hidden;
-
-extern char **__environ;
-
 /* The purpose of this file is to provide wrappers around the dynamic
    linker error mechanism (similar to dlopen() et al in libdl) which
    are usable from within libc.  Generally we want to throw away the
@@ -42,13 +37,12 @@ dlerror_run (void (*operate) (void *), void *args)
 {
   const char *objname;
   const char *last_errstring = NULL;
-  bool malloced;
+  int result;
 
-  (void) GLRO(dl_catch_error) (&objname, &last_errstring, &malloced,
-			       operate, args);
+  (void) GLRO(dl_catch_error) (&objname, &last_errstring, operate, args);
 
-  int result = last_errstring != NULL;
-  if (result && malloced)
+  result = last_errstring != NULL;
+  if (result && last_errstring != _dl_out_of_memory)
     free ((char *) last_errstring);
 
   return result;
@@ -83,8 +77,7 @@ do_dlopen (void *ptr)
 {
   struct do_dlopen_args *args = (struct do_dlopen_args *) ptr;
   /* Open and relocate the shared object.  */
-  args->map = GLRO(dl_open) (args->name, args->mode, NULL, __LM_ID_CALLER,
-			     __libc_argc, __libc_argv, __environ);
+  args->map = _dl_open (args->name, args->mode, NULL, __LM_ID_CALLER);
 }
 
 static void
@@ -100,7 +93,7 @@ do_dlsym (void *ptr)
 static void
 do_dlclose (void *ptr)
 {
-  GLRO(dl_close) ((struct link_map *) ptr);
+  _dl_close ((struct link_map *) ptr);
 }
 
 /* This code is to support __libc_dlopen from __libc_dlopen'ed shared
@@ -116,7 +109,7 @@ struct dl_open_hook
 #ifdef SHARED
 extern struct dl_open_hook *_dl_open_hook;
 libc_hidden_proto (_dl_open_hook);
-struct dl_open_hook *_dl_open_hook __attribute__ ((nocommon));
+struct dl_open_hook *_dl_open_hook __attribute__((nocommon));
 libc_hidden_data_def (_dl_open_hook);
 #else
 static void
@@ -126,7 +119,7 @@ do_dlsym_private (void *ptr)
   struct r_found_version vers;
   vers.name = "GLIBC_PRIVATE";
   vers.hidden = 1;
-  /* vers.hash = _dl_elf_hash (vers.name);  */
+  /* vers.hash = _dl_elf_hash (version);  */
   vers.hash = 0x0963cf85;
   vers.filename = NULL;