about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-10 04:01:36 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-10 04:01:36 +0000
commit8e17ea58173d35e2e5dabfeb9fa5abf2609cfc51 (patch)
treede81e2ebf2b5b32510d511caa07c2496e3d540ba /elf/dl-open.c
parentf3863621f617b040c66d635109203c29f35f7331 (diff)
downloadglibc-8e17ea58173d35e2e5dabfeb9fa5abf2609cfc51.tar.gz
glibc-8e17ea58173d35e2e5dabfeb9fa5abf2609cfc51.tar.xz
glibc-8e17ea58173d35e2e5dabfeb9fa5abf2609cfc51.zip
Update.
2000-06-09  Ulrich Drepper  <drepper@redhat.com>

	Rewrite error message handling.
	* elf/dl-deps.c (_dl_map_object_deps): Pass new parameter to
	_dl_catch_error.
	* elf/dl-error (struct catch): Add objname member.
	(_dl_signal_error): Take new parameter with object name.  When
	passing message on simply store object name and duplicate error
	message.
	(_dl_catch_error): Take new parameter.  Store object name in the
	place pointed to.
	* include/dlfcn.h: Adjust _dl_catch_error prototype.
	* sysdeps/generic/ldsodefs.h: Adjust _dl_signal_error prototype.
	* elf/dl-libc.c (dlerror_run): Pass new parameter to _dl_catch_error.
	* elf/dl-open.c (_dl_open): Likewise.
	* elf/rtld.c (dl_main): Likewise.
	* elf/dl-close.c: Mark error messages with N_().
	* elf/dl-deps.c: Likewise.
	* elf/dl-error.c: Likewise.
	* elf/dl-load.c: Likewise.
	* elf/dl-open.c: Likewise.
	* elf/dl-reloc.c: Likewise.
	* elf/dl-support.c: Likewise.
	* elf/dl-sym.c: Likewise.
	* elf/dl-version.c: Likewise.
	* elf/dl-lookup.c: Add comments about problems with error message
	translations.
	* elf/dl-reloc.c: Likewise.
	* elf/dl-version.c: Likewise.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 76c36cffc8..17af8842d6 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -102,7 +102,7 @@ dl_open_worker (void *a)
       if (__libc_enable_secure)
 	/* This is an error.  */
 	_dl_signal_error (0, "dlopen",
-			  "DST not allowed in SUID/SGID programs");
+			  N_("DST not allowed in SUID/SGID programs"));
 
       /* We have to find out from which object the caller is calling.
 	 Find the highest-addressed object that ADDRESS is not below.  */
@@ -136,7 +136,7 @@ dl_open_worker (void *a)
       /* If the substitution failed don't try to load.  */
       if (*new_file == '\0')
 	_dl_signal_error (0, "dlopen",
-			  "empty dynamic string token substitution");
+			  N_("empty dynamic string token substitution"));
 
       /* Now we have a new file name.  */
       file = new_file;
@@ -237,7 +237,7 @@ dl_open_worker (void *a)
 	      _dl_global_scope_alloc = 0;
 	    nomem:
 	      _dl_signal_error (ENOMEM, new->l_libname->name,
-				"cannot extend global scope");
+				N_("cannot extend global scope"));
 	      return;
 	    }
 
@@ -290,12 +290,13 @@ internal_function
 _dl_open (const char *file, int mode, const void *caller)
 {
   struct dl_open_args args;
-  char *errstring;
+  const char *objname;
+  const char *errstring;
   int errcode;
 
   if ((mode & RTLD_BINDING_MASK) == 0)
     /* One of the flags must be set.  */
-    _dl_signal_error (EINVAL, file, _("invalid mode for dlopen()"));
+    _dl_signal_error (EINVAL, file, N_("invalid mode for dlopen()"));
 
   /* Make sure we are alone.  */
   __libc_lock_lock (_dl_load_lock);
@@ -304,7 +305,7 @@ _dl_open (const char *file, int mode, const void *caller)
   args.mode = mode;
   args.caller = caller;
   args.map = NULL;
-  errcode = _dl_catch_error (&errstring, dl_open_worker, &args);
+  errcode = _dl_catch_error (&objname, &errstring, dl_open_worker, &args);
 
 #ifndef MAP_COPY
   /* We must munmap() the cache file.  */
@@ -327,10 +328,10 @@ _dl_open (const char *file, int mode, const void *caller)
       /* Make a local copy of the error string so that we can release the
 	 memory allocated for it.  */
       local_errstring = strdupa (errstring);
-      free (errstring);
+      free ((char *) errstring);
 
       /* Reraise the error.  */
-      _dl_signal_error (errcode, NULL, local_errstring);
+      _dl_signal_error (errcode, objname, local_errstring);
     }
 
   return args.map;