From 482eec0d1188823ad93247f79bf965886e8bd4f7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 16 Jan 1999 17:09:04 +0000 Subject: Update. 1999-01-16 Ulrich Drepper * elf/Makefile (tests): Add loadtest. Add rules to generate test modules. * Makeconfig (+link): Add $(LDFLAGS-$(@F)) to command line. * elf/loadtest.c: New file. * elf/testobj1.c: New file. * elf/testobj2.c: New file. * elf/testobj3.c: New file. * elf/dl-close.c: Correct removing module from global list. * elf/dl-open.c: Add debugging code. * include/string.h: Add __rawmemchr prototype. * string/Makefile (routines): Add rawmemchr. * string/Versions [GLIBC_2.1]: Add __rawmemchr and rawmemchr. * string/string.h: Add prototype for rawmemchr. * string/bits/string2.h: Optimize strchr with rawmemchr. * sysdeps/generic/rawmemchr.c: New file. * sysdeps/i386/rawmemchr.c: New file. * sysdeps/i386/i486/bits/string.h: Add rawmemchr inline code. Optimize strchr with rawmemchr. * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _LFS_LARGEFILE, _LFS64_LARGEFILE, and _LFS64_STDIO for Unix98. 1999-01-14 Andreas Jaeger * nis/nis_error.c (nis_errlist): Fix capitilasation. --- elf/dl-open.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'elf/dl-open.c') diff --git a/elf/dl-open.c b/elf/dl-open.c index 8cf1084a94..3db2b0e9f7 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -1,5 +1,5 @@ /* Load a shared object at runtime, relocate it, and run its initializer. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,6 +42,11 @@ extern char **__libc_argv; extern char **__environ; +/* Undefine the following for debugging. */ +/* #define SCOPE_DEBUG 1 */ +#ifdef SCOPE_DEBUG +static void show_scope (struct link_map *new); +#endif /* During the program run we must not modify the global data of loaded shared object simultanously in two threads. Therefore we @@ -86,6 +91,10 @@ dl_open_worker (void *a) /* So far, so good. Now check the versions. */ (void) _dl_check_all_versions (new, 0); +#ifdef SCOPE_DEBUG + show_scope (new); +#endif + /* Relocate the objects loaded. We do this in reverse order so that copy relocs of earlier objects overwrite the data written by later objects. */ @@ -195,3 +204,34 @@ _dl_open (const char *file, int mode) return args.map; } + + +#ifdef SCOPE_DEBUG +#include + +static void +show_scope (struct link_map *new) +{ + int scope_cnt; + + for (scope_cnt = 0; new->l_scope[scope_cnt] != NULL; ++scope_cnt) + { + char numbuf[2]; + unsigned int cnt; + + numbuf[0] = '0' + scope_cnt; + numbuf[1] = '\0'; + _dl_sysdep_message ("scope ", numbuf, ":", NULL); + + for (cnt = 0; cnt < new->l_scope[scope_cnt]->r_nlist; ++cnt) + if (*new->l_scope[scope_cnt]->r_list[cnt]->l_name) + _dl_sysdep_message (" ", + new->l_scope[scope_cnt]->r_list[cnt]->l_name, + NULL); + else + _dl_sysdep_message ("
", NULL); + + _dl_sysdep_message ("\n", NULL); + } +} +#endif -- cgit 1.4.1