about summary refs log tree commit diff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-03 19:39:52 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-03 19:39:52 +0000
commit9710f75d4a4d57fa86f20e011c6dc6e66c590080 (patch)
tree371793321e7797f93456cf680abb268d8607e25c /elf/dl-minimal.c
parent654a7a0c299f2f5beca8745a35efd4334f361140 (diff)
downloadglibc-9710f75d4a4d57fa86f20e011c6dc6e66c590080.tar.gz
glibc-9710f75d4a4d57fa86f20e011c6dc6e66c590080.tar.xz
glibc-9710f75d4a4d57fa86f20e011c6dc6e66c590080.zip
Update.
2002-02-03  Andreas Schwab  <schwab@suse.de>

	* sysdeps/posix/readv.c: Use ssize_t for bytes_read.
	* sysdeps/posix/writev.c: Use ssize_t for bytes_written.  Fix comment.

2002-02-03  Thorsten Kukuk  <kukuk@suse.de>

	* sysdeps/posix/writev.c: Check for ssize_t overflow, don't use
	alloca if the memory reqirements are too high.

2002-02-03  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-load.c (decompose_rpath): Avoid using strstr.
	* elf/dl-minimal.c (_strerror_r): Use _itoa instead of _itoa_word since
	the former is available anyway and speed isn't important here.
	* elf/dl-misc.c (_dl_debug_vdprintf): Likewise.
	* elf/dl-version.c (match_symbol): Likewise.
	(_dl_check_map_versions): Likewise.
	* elf/rtld.c (process_envvars): Likewise.
	(print_statistics): Likewise.
	* sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Likewise.
	* elf/dl-minimal.c (_itoa): Always define it.  Make it work for all
	bases.  Add assert to catch uses of unimplemented features.
	(__strsep): Add assert to catch uses of unimplemented features.
	* elf/dl-object.c (_dl_new_object): Don't use rawmemchr.  Use strchr
	and avoid inline optimization.
	* elf/rtld.c (process_envvars): Likewise.
	* elf/dl-open.c: Don't include <stdio-common/_itoa.h>.
	* elf/dl-profile.c (_dl_start_profile): Help compiler to avoid ffs.
	* elf/rtld.c (dl_main): Avoid strsep inline optimization.

	* stdio-common/_itoa.h: Minor simplifications of the code.
	* stdio-common/_itoa.c: Likewise.

	* elf/dl-reloc.c (_dl_relocate_object): Use _dl_debug_printf
	instead of _dl_printf for debugging info output.

	* sysdeps/mips/atomicity.h (exchange_and_add): Use branch likely.
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index efdc26dc62..cd899bfd74 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -171,7 +171,7 @@ __strerror_r (int errnum, char *buf, size_t buflen)
       /* No need to check buffer size, all calls in the dynamic linker
 	 provide enough space.  */
       buf[buflen - 1] = '\0';
-      msg = _itoa_word (errnum, buf + buflen - 1, 10, 0);
+      msg = _itoa (errnum, buf + buflen - 1, 10, 0);
       msg = memcpy (msg - (sizeof ("Error ") - 1), "Error ",
 		    sizeof ("Error ") - 1);
       break;
@@ -270,9 +270,9 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group)
 }
 
 
-#if HP_TIMING_AVAIL && ULONG_MAX <= 4294967295UL
-/* We need this function to print the cycle count.  On 64-bit machines the
-   _itoa_word function should be used.  */
+/* We always use _itoa instead of _itoa_word in ld.so since the former
+   also has to be present and it is never about speed when these
+   functions are used.  */
 char *
 _itoa (value, buflim, base, upper_case)
      unsigned long long int value;
@@ -280,17 +280,16 @@ _itoa (value, buflim, base, upper_case)
      unsigned int base;
      int upper_case;
 {
-  char *bp = buflim;
+  extern const char _itoa_lower_digits[];
 
-  assert (base == 10);
+  assert (! upper_case);
 
   do
-    *--bp = '0' + value % 10;
-  while ((value /= 10) != 0);
+    *--buflim = _itoa_lower_digits[value % base];
+  while ((value /= base) != 0);
 
-  return bp;
+  return buflim;
 }
-#endif
 
 
 /* The following is not a complete strsep implementation.  It cannot
@@ -303,6 +302,8 @@ __strsep (char **stringp, const char *delim)
 {
   char *begin;
 
+  assert (delim[0] != '\0');
+
   begin = *stringp;
   if (begin != NULL)
     {