about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-07-02 22:51:40 +0000
committerUlrich Drepper <drepper@redhat.com>1998-07-02 22:51:40 +0000
commitb0b67c47a5812eae16b0ae3b0a8eeca5a4be9528 (patch)
tree36a758869687c8c769a896ccfeac99cc1efffee8 /elf
parent4c223a7cf65bead4a78da1495bebd2df020b9722 (diff)
downloadglibc-b0b67c47a5812eae16b0ae3b0a8eeca5a4be9528.tar.gz
glibc-b0b67c47a5812eae16b0ae3b0a8eeca5a4be9528.tar.xz
glibc-b0b67c47a5812eae16b0ae3b0a8eeca5a4be9528.zip
Update.
1998-07-02 21:51  Ulrich Drepper  <drepper@cygnus.com>

	* Makeconfig: Define list of subdirs as all-subdirs and make subdirs
	a copy.
	* Makefile: Add rules to generate map files.
	(distribute): Remove libc.map, add Versions.def and versions.awk.
	* Makerules: Change rules to find map files on common-objpfx.
	* elf/Makefile: Likewise.
	* md5-crypt/Makefile: Likewise.
	* nis/Makefile (libnsl-map): Remove.
	* Versions.def: New file.
	* versions.awk: New file.
	* argp/Versions: New file.
	* assert/Versions: New file.
	* catgets/Versions: New file.
	* csu/Versions: New file.
	* ctype/Versions: New file.
	* db/Versions: New file.
	* debug/Versions: New file.
	* dirent/Versions: New file.
	* elf/Versions: New file.
	* gmon/Versions: New file.
	* grp/Versions: New file.
	* hesiod/Versions: New file.
	* hurd/Versions: New file.
	* iconv/Versions: New file.
	* inet/Versions: New file.
	* intl/Versions: New file.
	* io/Versions: New file.
	* libio/Versions: New file.
	* linuxthreads/Versions: New file.
	* locale/Versions: New file.
	* login/Versions: New file.
	* malloc/Versions: New file.
	* math/Versions: New file.
	* md5-crypt/Versions: New file.
	* misc/Versions: New file.
	* nis/Versions: New file.
	* nss/Versions: New file.
	* posix/Versions: New file.
	* pwd/Versions: New file.
	* resolv/Versions: New file.
	* resource/Versions: New file.
	* rt/Versions: New file.
	* setjmp/Versions: New file.
	* shadow/Versions: New file.
	* signal/Versions: New file.
	* socket/Versions: New file.
	* stdio/Versions: New file.
	* stdio-common/Versions: New file.
	* stdlib/Versions: New file.
	* streams/Versions: New file.
	* string/Versions: New file.
	* sunrpc/Versions: New file.
	* sysdeps/alpha/Versions: New file.
	* sysdeps/alpha/fpu/Versions: New file.
	* sysdeps/i386/Versions: New file.
	* sysdeps/sparc/Versions: New file.
	* sysdeps/unix/sysv/Versions: New file.
	* sysdeps/unix/sysv/linux/Versions: New file.
	* sysdeps/unix/sysv/linux/alpha/Versions: New file.
	* sysdeps/unix/sysv/linux/i386/Versions: New file.
	* sysdeps/unix/sysv/linux/mips/Versions: New file.
	* sysvipc/Versions: New file.
	* termios/Versions: New file.
	* time/Versions: New file.
	* wcsmbs/Versions: New file.
	* wctype/Versions: New file.
	* libc.map: Removed.
	* db/libdb.map: Removed.
	* elf/libdl.map: Removed.
	* hesiod/libnss_hesiod.map: Removed.
	* hurd/libhurduser.map: Removed.
	* hurd/libmachuser.map: Removed.
	* linuxthreads/libpthread.map: Removed.
	* locale/libBrokenLocale.map: Removed.
	* login/libutil.map: Removed.
	* math/libm.map: Removed.
	* md5-crypt/libcrypt.map: Removed.
	* nis/libnsl.map: Removed.
	* nis/libnsl_compat.map: Removed.
	* nis/libnss_nis.map: Removed.
	* nis/libnss_nisplus.map: Removed.
	* nss/libnss_db.map: Removed.
	* nss/libnss_files.map: Removed.
	* resolv/libnss_dns.map: Removed.
	* resolv/libresolv.map: Removed.
	* rt/librt.map: Removed.

	* elf/dl-load.c (fillin_rpath): Fix test for trusted directory.
	Fix typos.

	* elf/rtld.c (process_dl_debug): Recognize 'all'.
	(process_envvars): LD_BIND_NOW must be followed by y, Y, or 1.

	* sysdeps/generic/elf/backtracesyms.c: Allocate string memory of
	correct size.

	* sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Fix typo
	in comment.
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/Versions35
-rw-r--r--elf/dl-load.c19
-rw-r--r--elf/libdl.map7
-rw-r--r--elf/rtld.c20
5 files changed, 65 insertions, 18 deletions
diff --git a/elf/Makefile b/elf/Makefile
index dedc3d5074..243761cd04 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -35,7 +35,7 @@ elide-routines.os = $(dl-routines) dl-support enbl-secure
 # ld.so uses those routines, plus some special stuff for being the program
 # interpreter and operating independent of libc.
 rtld-routines	:= rtld $(dl-routines) dl-sysdep dl-minimal
-ld-map		= $(..)libc.map
+ld-map		= $(common-objpfx)libc.map
 distribute	= $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
 		  dl-hash.h soinit.c sofini.c ldd.sh.in ldd.bash.in eval.c \
 		  genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
diff --git a/elf/Versions b/elf/Versions
new file mode 100644
index 0000000000..d908c59fd4
--- /dev/null
+++ b/elf/Versions
@@ -0,0 +1,35 @@
+libc {
+  GLIBC_2.0 {
+    # global variables
+    _dl_debug_impcalls; _dl_debug_fd;
+
+    # functions used in other libraries
+    _dl_open; _dl_close; _dl_addr; _dl_sysdep_output; _dl_debug_message;
+
+    # Those are in the dynamic linker, but used by libc.so.
+    __libc_enable_secure; _dl_catch_error; _dl_check_all_versions;
+    _dl_debug_initialize; _dl_debug_state; _dl_default_scope;
+    _dl_global_scope_end; _dl_init_next; _dl_lookup_symbol;
+    _dl_map_object; _dl_map_object_deps; _dl_object_relocation_scope;
+    _dl_relocate_object; _dl_signal_error; _dl_starting_up;
+    _dl_sysdep_start; _r_debug;
+    _dl_global_scope; _dl_lookup_symbol_skip;
+    _dl_lookup_versioned_symbol; _dl_lookup_versioned_symbol_skip;
+  }
+  GLIBC_2.1 {
+    # global variables
+    _dl_profile; _dl_profile_map; _dl_profile_output; _dl_start_profile;
+
+    # functions used in other libraries
+    _dl_mcount; _dl_mcount_wrapper;
+  }
+}
+
+libdl {
+  GLIBC_2.0 {
+    dladdr; dlclose; dlerror; dlopen; dlsym;
+  }
+  GLIBC_2.1 {
+    dlvsym;
+  }
+}
diff --git a/elf/dl-load.c b/elf/dl-load.c
index ad981bc238..b14e52f101 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -204,13 +204,14 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
 	{
 	  const char **trun = trusted;
 
-	  /* All trusted directory must be complete name.  */
+	  /* All trusted directories must be complete names.  */
 	  if (cp[0] != '/')
 	    continue;
 
 	  while (*trun != NULL
 		 && (memcmp (*trun, cp, len) != 0
-		     || ((*trun)[len] != '/' && (*trun)[len + 1] != '\0')))
+		     || (*trun)[len] != '/'
+		     || (*trun)[len + 1] != '\0'))
 	    ++trun;
 
 	  if (*trun == NULL)
@@ -392,7 +393,7 @@ _dl_init_paths (const char *llp)
   if (rtld_search_dirs[0] == NULL)
     _dl_signal_error (ENOMEM, NULL, "cannot create cache for search path");
 
-  pelem = all_dirs= rtld_search_dirs[0];
+  pelem = all_dirs = rtld_search_dirs[0];
   for (strp = system_dirs; *strp != NULL; ++strp, pelem += round_size)
     {
       size_t cnt;
@@ -904,12 +905,13 @@ open_path (const char *name, size_t namelen, int preloaded,
       return -1;
     }
 
-  buf = __alloca (max_dirnamelen + max_capstrlen + namelen + 1);
+  buf = __alloca (max_dirnamelen + max_capstrlen + namelen);
   do
     {
       struct r_search_path_elem *this_dir = *dirs;
       size_t buflen = 0;
       size_t cnt;
+      char *edp;
 
       /* If we are debugging the search for libraries print the path
 	 now if it hasn't happened now.  */
@@ -919,6 +921,7 @@ open_path (const char *name, size_t namelen, int preloaded,
 	  print_search_path (dirs, current_what, this_dir->where);
 	}
 
+      edp = (char *) __mempcpy (buf, this_dir->dirname, this_dir->dirnamelen);
       for (cnt = 0; fd == -1 && cnt < ncapstr; ++cnt)
 	{
 	  /* Skip this directory if we know it does not exist.  */
@@ -926,8 +929,7 @@ open_path (const char *name, size_t namelen, int preloaded,
 	    continue;
 
 	  buflen =
-	    ((char *) __mempcpy (__mempcpy (__mempcpy (buf, this_dir->dirname,
-						       this_dir->dirnamelen),
+	    ((char *) __mempcpy (__mempcpy (edp,
 					    capstr[cnt].str, capstr[cnt].len),
 				 name, namelen)
 	     - buf);
@@ -946,12 +948,11 @@ open_path (const char *name, size_t namelen, int preloaded,
 		   test whether there is any directory at all.  */
 		struct stat st;
 
-		buf[this_dir->dirnamelen
-		    + MAX (capstr[cnt].len - 1, 0)] = '\0';
+		buf[buflen - namelen - 1] = '\0';
 
 		if (__xstat (_STAT_VER, buf, &st) != 0
 		    || ! S_ISDIR (st.st_mode))
-		  /* The directory does not exist ot it is no directory.  */
+		  /* The directory does not exist or it is no directory.  */
 		  this_dir->status[cnt] = nonexisting;
 		else
 		  this_dir->status[cnt] = existing;
diff --git a/elf/libdl.map b/elf/libdl.map
deleted file mode 100644
index 4bd2145a47..0000000000
--- a/elf/libdl.map
+++ /dev/null
@@ -1,7 +0,0 @@
-GLIBC_2.0 {
-  global:
-    dladdr; dlclose; dlerror; dlopen; dlsym; dlvsym;
-
-  local:
-    *;
-};
diff --git a/elf/rtld.c b/elf/rtld.c
index 5bd4b7cd97..bf4a142dba 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -968,6 +968,22 @@ process_dl_debug (const char *dl_debug)
 
 	  switch (len)
 	    {
+	    case 3:
+	      /* This option is not documented since it is not generally
+		 useful.  */
+	      if (memcmp (dl_debug, "all", 3) == 0)
+		{
+		  _dl_debug_libs = 1;
+		  _dl_debug_impcalls = 1;
+		  _dl_debug_reloc = 1;
+		  _dl_debug_files = 1;
+		  _dl_debug_symbols = 1;
+		  _dl_debug_bindings = 1;
+		  _dl_debug_versions = 1;
+		  any_debug = 1;
+		}
+	      break;
+
 	    case 4:
 	      if (memcmp (dl_debug, "help", 4) == 0)
 		{
@@ -1117,7 +1133,9 @@ process_envvars (enum mode *modep, int *lazyp)
 
 	case 8:
 	  /* Do we bind early?  */
-	  if (memcmp (&envline[3], "BIND_NOW", 8) == 0)
+	  if (memcmp (&envline[3], "BIND_NOW", 8) == 0
+	      && (envline[12] == '1' || envline[12] == 'y'
+		  || envline[12] == 'Y'))
 	    bind_now = 1;
 	  break;