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


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 hwcap handling in dl


Hi,

This patch fixes hwcap handling condition in dl.

Currently, hwcap check routine uses below code:

     if (hwcap 
	 && ((lib->hwcap & *hwcap & ~_DL_HWCAP_PLATFORM) > *hwcap))

But this condition does not always fulfill, because left equation does
not exceed by right equation.  My fix is if lib->hwcap has a value and
it does not match the current hwcap, then continue and use an another
library.

Please apply this patch.

Regards,
-- gotom


2002-02-02  GOTO Masanori  <gotom@debian.or.jp>

	* sysdeps/generic/dl-cache.c: Fix hwcap check condition.


--- sysdeps/generic/dl-cache.c	2003-02-02 05:33:47.000000000 +0900
+++ sysdeps/generic/dl-cache.c.new	2003-02-02 06:22:30.000000000 +0900
@@ -231,8 +231,8 @@
 	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0			      \
 	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform)		      \
 	continue;							      \
-      if (hwcap								      \
-	  && ((lib->hwcap & *hwcap & ~_DL_HWCAP_PLATFORM) > *hwcap))	      \
+      if (hwcap && lib->hwcap != 0					      \
+	  && ((lib->hwcap & *hwcap & ~_DL_HWCAP_PLATFORM) == 0))	      \
 	continue
       SEARCH_CACHE (cache_new);
     }


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