This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix ldconfig


Hi!

tls was given hwcap 0x8000000000000000 but add_to_cache relied on
this never set in hwcap. The following patch fixes the endless loop in
ldconfig.

2002-12-29  Jakub Jelinek  <jakub@redhat.com>

	* elf/cache.c (add_to_cache): Don't loop forever with 1ULL << 63 set
	in hwcap.

--- libc/elf/cache.c.jj	2002-09-24 13:00:06.000000000 +0200
+++ libc/elf/cache.c	2002-12-29 12:28:12.000000000 +0100
@@ -475,7 +475,7 @@ add_to_cache (const char *path, const ch
   new_entry->bits_hwcap = 0;
 
   /* Count the number of bits set in the masked value.  */
-  for (i = 0; (~((1ULL << i) - 1) & hwcap) != 0; ++i)
+  for (i = 0; (~((1ULL << i) - 1) & hwcap) != 0 && i < 64; ++i)
     if ((hwcap & (1ULL << i)) != 0)
       ++new_entry->bits_hwcap;
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]