* 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>.
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.
Fix typo.
Reported by Andrew Schulman <SCHULMAN.ANDREW@epamail.epa.gov>.
_dl_map_object_deps (new, NULL, 0, 0);
/* 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
show_scope (new);
int
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;
const char *strtab;
and no stub entry was created. This should never happen. */
assert (needed != NULL);
- /* NEEDED is the map for the file we need. Now look for the
- dependency symbols. */
- aux = (ElfW(Vernaux) *) ((char *) ent + ent->vn_aux);
- while (1)
+ /* Make sure this is no stub we created because of a missing
+ dependency. */
+ if (! trace_mode || needed->l_opencount != 0)
{
- /* Match the symbol. */
- 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. */
- if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high)
- ndx_high = aux->vna_other & 0x7fff;
-
- if (aux->vna_next == 0)
- /* No more symbols. */
- break;
-
- /* Next symbol. */
- aux = (ElfW(Vernaux) *) ((char *) aux + aux->vna_next);
+ /* NEEDED is the map for the file we need. Now look for the
+ dependency symbols. */
+ aux = (ElfW(Vernaux) *) ((char *) ent + ent->vn_aux);
+ while (1)
+ {
+ /* Match the symbol. */
+ 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. */
+ if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high)
+ ndx_high = aux->vna_other & 0x7fff;
+
+ if (aux->vna_next == 0)
+ /* No more symbols. */
+ break;
+
+ /* Next symbol. */
+ aux = (ElfW(Vernaux) *) ((char *) aux + aux->vna_next);
+ }
}
if (ent->vn_next == 0)
int
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;
int result = 0;
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;
}
struct version_check_args
{
int doexit;
+ int dotrace;
};
static void
version_check_doit (void *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. */
_exit (1);
}
{
struct version_check_args args;
args.doexit = mode == normal;
+ args.dotrace = mode == trace;
_dl_receive_error (print_missing_version, version_check_doit, &args);
}
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
to dynamically detect RT signals and avoid generating compatibility
functions with old kernel.
#ifndef __i386__
sa.sa_handler = pthread_handle_sigrestart;
#else
- if (__pthread_sig_restart >= SIGRTMIN)
- sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_rt;
- else
+# if !__ASSUME_REALTIME_SIGNALS
+ if (__pthread_sig_restart < SIGRTMIN)
sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_nonrt;
+ else
+# endif
+ sa.sa_handler = (__sighandler_t) pthread_handle_sigrestart_rt;
#endif
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
#ifndef __i386__
sa.sa_handler = pthread_handle_sigcancel;
#else
- if (__pthread_sig_restart >= SIGRTMIN)
- sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_rt;
- else
+# if !__ASSUME_REALTIME_SIGNALS
+ if (__pthread_sig_restart < SIGRTMIN)
sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_nonrt;
+ else
+# endif
+ sa.sa_handler = (__sighandler_t) pthread_handle_sigcancel_rt;
#endif
sa.sa_flags = 0;
__sigaction(__pthread_sig_cancel, &sa, NULL);
}
#ifdef __i386__
+# if !__ASSUME_REALTIME_SIGNALS
static void pthread_handle_sigrestart_nonrt(int sig, struct sigcontext ctx)
{
asm volatile ("movw %w0,%%gs" : : "r" (ctx.gs));
pthread_handle_sigrestart(sig);
}
+# endif
static void pthread_handle_sigrestart_rt(int sig, struct siginfo *si,
struct ucontext *uc)
}
#ifdef __i386__
+# if !__ASSUME_REALTIME_SIGNALS
static void pthread_handle_sigcancel_nonrt(int sig, struct sigcontext ctx)
{
asm volatile ("movw %w0,%%gs" : : "r" (ctx.gs));
pthread_handle_sigcancel(sig);
}
+# endif
static void pthread_handle_sigcancel_rt(int sig, struct siginfo *si,
struct ucontext *uc)
THREAD_SETMEM(self, p_nextlock, (pthread_descr) oldstatus);
/* Make sure the store in p_nextlock completes before performing
the compare-and-swap */
- WRITE_MEMORY_BARRIER();
+ MEMORY_BARRIER();
}
} while(! compare_and_swap(&lock->__status, oldstatus, newstatus,
&lock->__spinlock));
}
/* Prevent reordering of store to *maxptr above and store to thr->p_nextlock
below */
- MEMORY_BARRIER();
+ WRITE_MEMORY_BARRIER();
/* Wake up the selected waiting thread */
thr->p_nextlock = NULL;
restart(thr);
@comment utmpx.h
@comment XPG4.2
@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
-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}.
@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
@subsection Logging In and Out
the actual function definitions. */
# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
-# define __WAIT_STATUS void *
+# define __WAIT_STATUS void *
# define __WAIT_STATUS_DEFN void *
# else
/* This works in GCC 2.6.1 and later. */
# else /* Don't use BSD. */
# define __WAIT_INT(status) (status)
-# define __WAIT_STATUS int *
+# define __WAIT_STATUS int *
# define __WAIT_STATUS_DEFN int *
# endif /* Use BSD. */
/* Check the version dependencies of all objects available through
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;
/* Check the version dependencies for MAP. If VERBOSE print some more
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;
/* Initialize the object in SCOPE by calling the constructors with