1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
* elf/dl-version.c (_dl_check_map_versions): New argument trace_mode.
	Before testing versions check that we actually loaded the object
	and whether we are in trace mode.  If not loaded during tracing don't
	test versions in this object.
	(_dl_check_all_versions): Take new parameter and pass to
	_dl_check_map_versions.
	* sysdeps/generic/ldsodefs.h: Update prototypes for
	_dl_check_all_versions and _dl_check_map_versions.
	* elf/rtld.c (struct version_check_args): Add dotrace.
	(version_check_doit): Pass args->dotrace to _dl_check_all_versions.
	(dl_main): Pass info about trace mode to version_check_doit.
	* elf/dl-open.c (dl_open_worker): Pass zero as new argument to
	_dl_check_all_versions.

	* manual/users.texi (XPG Functions): Document utmpxname, getutmp,
	and getutmpx.
	Patch by Bryan Henderson <bryanh@giraffe-data.com>.
This commit is contained in:
Ulrich Drepper
2000-04-15 22:26:34 +00:00
parent 29094e4880
commit 145b84138f
11 changed files with 106 additions and 38 deletions

View File

@ -1,5 +1,23 @@
2000-04-15 Ulrich Drepper <drepper@redhat.com> 2000-04-15 Ulrich Drepper <drepper@redhat.com>
* elf/dl-version.c (_dl_check_map_versions): New argument trace_mode.
Before testing versions check that we actually loaded the object
and whether we are in trace mode. If not loaded during tracing don't
test versions in this object.
(_dl_check_all_versions): Take new parameter and pass to
_dl_check_map_versions.
* sysdeps/generic/ldsodefs.h: Update prototypes for
_dl_check_all_versions and _dl_check_map_versions.
* elf/rtld.c (struct version_check_args): Add dotrace.
(version_check_doit): Pass args->dotrace to _dl_check_all_versions.
(dl_main): Pass info about trace mode to version_check_doit.
* elf/dl-open.c (dl_open_worker): Pass zero as new argument to
_dl_check_all_versions.
* manual/users.texi (XPG Functions): Document utmpxname, getutmp,
and getutmpx.
Patch by Bryan Henderson <bryanh@giraffe-data.com>.
* manual/argp.texi: Document index parameter of argp_parse. * manual/argp.texi: Document index parameter of argp_parse.
Fix typo. Fix typo.
Reported by Andrew Schulman <SCHULMAN.ANDREW@epamail.epa.gov>. Reported by Andrew Schulman <SCHULMAN.ANDREW@epamail.epa.gov>.

View File

@ -147,7 +147,7 @@ dl_open_worker (void *a)
_dl_map_object_deps (new, NULL, 0, 0); _dl_map_object_deps (new, NULL, 0, 0);
/* So far, so good. Now check the versions. */ /* So far, so good. Now check the versions. */
(void) _dl_check_all_versions (new, 0); (void) _dl_check_all_versions (new, 0, 0);
#ifdef SCOPE_DEBUG #ifdef SCOPE_DEBUG
show_scope (new); show_scope (new);

View File

@ -160,7 +160,7 @@ no version information available (required by ",
int int
internal_function internal_function
_dl_check_map_versions (struct link_map *map, int verbose) _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
{ {
int result = 0; int result = 0;
const char *strtab; const char *strtab;
@ -209,29 +209,34 @@ _dl_check_map_versions (struct link_map *map, int verbose)
and no stub entry was created. This should never happen. */ and no stub entry was created. This should never happen. */
assert (needed != NULL); assert (needed != NULL);
/* NEEDED is the map for the file we need. Now look for the /* Make sure this is no stub we created because of a missing
dependency symbols. */ dependency. */
aux = (ElfW(Vernaux) *) ((char *) ent + ent->vn_aux); if (! trace_mode || needed->l_opencount != 0)
while (1)
{ {
/* Match the symbol. */ /* NEEDED is the map for the file we need. Now look for the
result |= match_symbol ((*map->l_name dependency symbols. */
? map->l_name : _dl_argv[0]), aux = (ElfW(Vernaux) *) ((char *) ent + ent->vn_aux);
aux->vna_hash, while (1)
strtab + aux->vna_name, {
needed, verbose, /* Match the symbol. */
aux->vna_flags & VER_FLG_WEAK); result |= match_symbol ((*map->l_name
? map->l_name : _dl_argv[0]),
aux->vna_hash,
strtab + aux->vna_name,
needed, verbose,
aux->vna_flags & VER_FLG_WEAK);
/* Compare the version index. */ /* Compare the version index. */
if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high) if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high)
ndx_high = aux->vna_other & 0x7fff; ndx_high = aux->vna_other & 0x7fff;
if (aux->vna_next == 0) if (aux->vna_next == 0)
/* No more symbols. */ /* No more symbols. */
break; break;
/* Next symbol. */ /* Next symbol. */
aux = (ElfW(Vernaux) *) ((char *) aux + aux->vna_next); aux = (ElfW(Vernaux) *) ((char *) aux + aux->vna_next);
}
} }
if (ent->vn_next == 0) if (ent->vn_next == 0)
@ -356,13 +361,14 @@ _dl_check_map_versions (struct link_map *map, int verbose)
int int
internal_function internal_function
_dl_check_all_versions (struct link_map *map, int verbose) _dl_check_all_versions (struct link_map *map, int verbose, int trace_mode)
{ {
struct link_map *l; struct link_map *l;
int result = 0; int result = 0;
for (l = map; l != NULL; l = l->l_next) for (l = map; l != NULL; l = l->l_next)
result |= l->l_opencount != 0 && _dl_check_map_versions (l, verbose); result |= (l->l_opencount != 0
&& _dl_check_map_versions (l, verbose, trace_mode));
return result; return result;
} }

View File

@ -283,6 +283,7 @@ struct map_args
struct version_check_args struct version_check_args
{ {
int doexit; int doexit;
int dotrace;
}; };
static void static void
@ -305,7 +306,7 @@ static void
version_check_doit (void *a) version_check_doit (void *a)
{ {
struct version_check_args *args = (struct version_check_args *) a; struct version_check_args *args = (struct version_check_args *) a;
if (_dl_check_all_versions (_dl_loaded, 1) && args->doexit) if (_dl_check_all_versions (_dl_loaded, 1, args->dotrace) && args->doexit)
/* We cannot start the application. Abort now. */ /* We cannot start the application. Abort now. */
_exit (1); _exit (1);
} }
@ -842,6 +843,7 @@ of this helper program; chances are you did not intend to run this program.\n\
{ {
struct version_check_args args; struct version_check_args args;
args.doexit = mode == normal; args.doexit = mode == normal;
args.dotrace = mode == trace;
_dl_receive_error (print_missing_version, version_check_doit, &args); _dl_receive_error (print_missing_version, version_check_doit, &args);
} }

View File

@ -1,5 +1,8 @@
2000-04-15 Ulrich Drepper <drepper@redhat.com> 2000-04-15 Ulrich Drepper <drepper@redhat.com>
* pthread.c (pthread_initialize): Avoid a bit more code if
realtime signals are known to exist.
* pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code * pthread.c: Is __ASSUME_REALTIME_SIGNALS then avoid generating code
to dynamically detect RT signals and avoid generating compatibility to dynamically detect RT signals and avoid generating compatibility
functions with old kernel. functions with old kernel.

View File

@ -369,10 +369,12 @@ static void pthread_initialize(void)
#ifndef __i386__ #ifndef __i386__
sa.sa_handler = pthread_handle_sigrestart; sa.sa_handler = pthread_handle_sigrestart;
#else #else
if (__pthread_sig_restart >= SIGRTMIN) # if !__ASSUME_REALTIME_SIGNALS
sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_rt; if (__pthread_sig_restart < SIGRTMIN)
else
sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_nonrt; sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_nonrt;
else
# endif
sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_rt;
#endif #endif
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = 0; sa.sa_flags = 0;
@ -380,10 +382,12 @@ static void pthread_initialize(void)
#ifndef __i386__ #ifndef __i386__
sa.sa_handler = pthread_handle_sigcancel; sa.sa_handler = pthread_handle_sigcancel;
#else #else
if (__pthread_sig_restart >= SIGRTMIN) # if !__ASSUME_REALTIME_SIGNALS
sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_rt; if (__pthread_sig_restart < SIGRTMIN)
else
sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_nonrt; sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_nonrt;
else
# endif
sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_rt;
#endif #endif
sa.sa_flags = 0; sa.sa_flags = 0;
__sigaction(__pthread_sig_cancel, &sa, NULL); __sigaction(__pthread_sig_cancel, &sa, NULL);
@ -664,11 +668,13 @@ static void pthread_handle_sigrestart(int sig)
} }
#ifdef __i386__ #ifdef __i386__
# if !__ASSUME_REALTIME_SIGNALS
static void pthread_handle_sigrestart_nonrt(int sig, struct sigcontext ctx) static void pthread_handle_sigrestart_nonrt(int sig, struct sigcontext ctx)
{ {
asm volatile ("movw %w0,%%gs" : : "r" (ctx.gs)); asm volatile ("movw %w0,%%gs" : : "r" (ctx.gs));
pthread_handle_sigrestart(sig); pthread_handle_sigrestart(sig);
} }
# endif
static void pthread_handle_sigrestart_rt(int sig, struct siginfo *si, static void pthread_handle_sigrestart_rt(int sig, struct siginfo *si,
struct ucontext *uc) struct ucontext *uc)
@ -713,11 +719,13 @@ static void pthread_handle_sigcancel(int sig)
} }
#ifdef __i386__ #ifdef __i386__
# if !__ASSUME_REALTIME_SIGNALS
static void pthread_handle_sigcancel_nonrt(int sig, struct sigcontext ctx) static void pthread_handle_sigcancel_nonrt(int sig, struct sigcontext ctx)
{ {
asm volatile ("movw %w0,%%gs" : : "r" (ctx.gs)); asm volatile ("movw %w0,%%gs" : : "r" (ctx.gs));
pthread_handle_sigcancel(sig); pthread_handle_sigcancel(sig);
} }
# endif
static void pthread_handle_sigcancel_rt(int sig, struct siginfo *si, static void pthread_handle_sigcancel_rt(int sig, struct siginfo *si,
struct ucontext *uc) struct ucontext *uc)

View File

@ -56,7 +56,7 @@ void internal_function __pthread_lock(pthread_spinlock_t * lock,
THREAD_SETMEM(self, p_nextlock, (pthread_descr) oldstatus); THREAD_SETMEM(self, p_nextlock, (pthread_descr) oldstatus);
/* Make sure the store in p_nextlock completes before performing /* Make sure the store in p_nextlock completes before performing
the compare-and-swap */ the compare-and-swap */
WRITE_MEMORY_BARRIER(); MEMORY_BARRIER();
} }
} while(! compare_and_swap(&lock->__status, oldstatus, newstatus, } while(! compare_and_swap(&lock->__status, oldstatus, newstatus,
&lock->__spinlock)); &lock->__spinlock));
@ -144,7 +144,7 @@ again:
} }
/* Prevent reordering of store to *maxptr above and store to thr->p_nextlock /* Prevent reordering of store to *maxptr above and store to thr->p_nextlock
below */ below */
MEMORY_BARRIER(); WRITE_MEMORY_BARRIER();
/* Wake up the selected waiting thread */ /* Wake up the selected waiting thread */
thr->p_nextlock = NULL; thr->p_nextlock = NULL;
restart(thr); restart(thr);

View File

@ -1322,12 +1322,41 @@ for @code{getutline}.
@comment utmpx.h @comment utmpx.h
@comment XPG4.2 @comment XPG4.2
@deftypefun {struct utmpx *} pututxline (const struct utmpx *@var{utmp}) @deftypefun {struct utmpx *} pututxline (const struct utmpx *@var{utmp})
The @code{pututxline} function provides functionality identical to The @code{pututxline} function is functionally identical to
@code{pututline}, but uses @code{struct utmpx} instead of @code{struct @code{pututline}, but uses @code{struct utmpx} instead of @code{struct
utmp}. On the GNU system @code{pututxline} is simply an alias for utmp}. On the GNU system, @code{pututxline} is simply an alias for
@code{pututline}. @code{pututline}.
@end deftypefun @end deftypefun
@comment utmpx.h
@comment XPG4.2
@deftypefun int utmpxname (const char *@var{file})
The @code{utmpxname} function is functionally identical to
@code{utmpname}. On the GNU system, @code{utmpxname} is simply an
alias for @code{utmpname}.
@end deftypefun
You can translate between a traditional @code{struct utmp} and an XPG
@code{struct utmpx} with the following functions. On the GNU system,
these functions are merely copies, since the two structures are
identical.
@comment utmpx.h
@comment utmp.h
@comment GNU
@deftypefun int getutmp (const struct utmpx *utmpx, struct utmp *utmp)
@code{getutmp} copies the information, insofar as the structures are
compatible, from @var{utmpx} to @var{utmp}.
@end deftypefun
@comment utmpx.h
@comment utmp.h
@comment GNU
@deftypefun int getutmpx (const struct utmp *utmp, struct utmpx *utmpx)
@code{getutmpx} copies the information, insofar as the structures are
compatible, from @var{utmp} to @var{utmpx}.
@end deftypefun
@node Logging In and Out @node Logging In and Out
@subsection Logging In and Out @subsection Logging In and Out

View File

@ -59,7 +59,7 @@ typedef __pid_t pid_t;
the actual function definitions. */ the actual function definitions. */
# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
# define __WAIT_STATUS void * # define __WAIT_STATUS void *
# define __WAIT_STATUS_DEFN void * # define __WAIT_STATUS_DEFN void *
# else # else
/* This works in GCC 2.6.1 and later. */ /* This works in GCC 2.6.1 and later. */

View File

@ -76,7 +76,7 @@ typedef union
# else /* Don't use BSD. */ # else /* Don't use BSD. */
# define __WAIT_INT(status) (status) # define __WAIT_INT(status) (status)
# define __WAIT_STATUS int * # define __WAIT_STATUS int *
# define __WAIT_STATUS_DEFN int * # define __WAIT_STATUS_DEFN int *
# endif /* Use BSD. */ # endif /* Use BSD. */

View File

@ -346,12 +346,14 @@ extern void _dl_reloc_bad_type (struct link_map *map,
/* Check the version dependencies of all objects available through /* Check the version dependencies of all objects available through
MAP. If VERBOSE print some more diagnostics. */ MAP. If VERBOSE print some more diagnostics. */
extern int _dl_check_all_versions (struct link_map *map, int verbose) extern int _dl_check_all_versions (struct link_map *map, int verbose,
int trace_mode)
internal_function; internal_function;
/* Check the version dependencies for MAP. If VERBOSE print some more /* Check the version dependencies for MAP. If VERBOSE print some more
diagnostics. */ diagnostics. */
extern int _dl_check_map_versions (struct link_map *map, int verbose) extern int _dl_check_map_versions (struct link_map *map, int verbose,
int trace_mode)
internal_function; internal_function;
/* Initialize the object in SCOPE by calling the constructors with /* Initialize the object in SCOPE by calling the constructors with