public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix ldconfig
@ 2002-12-29  4:56 Jakub Jelinek
  2002-12-29 11:16 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2002-12-29  4:56 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix ldconfig
  2002-12-29  4:56 [PATCH] Fix ldconfig Jakub Jelinek
@ 2002-12-29 11:16 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2002-12-29 11:16 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Roland McGrath, Glibc hackers

Jakub Jelinek wrote:

> 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.

Thanks, I've checked the patch in.  After converting the magic 64 in
something more recognizable.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-29 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-29  4:56 [PATCH] Fix ldconfig Jakub Jelinek
2002-12-29 11:16 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).