mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user