GNU C Library master sources branch, roland/hwcap_mask, created. glibc-2.11-330-g7bfa311

roland@sourceware.org roland@sourceware.org
Tue Apr 6 02:48:00 GMT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, roland/hwcap_mask has been created
        at  7bfa311ff51999f9e92620268e493959a2f7bfb4 (commit)

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7bfa311ff51999f9e92620268e493959a2f7bfb4

commit 7bfa311ff51999f9e92620268e493959a2f7bfb4
Author: Roland McGrath <roland@redhat.com>
Date:   Mon Apr 5 19:43:05 2010 -0700

    Obey LD_HWCAP_MASK in ld.so.cache lookups.

diff --git a/ChangeLog b/ChangeLog
index 7485ec5..cb02ba1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-05  Roland McGrath  <roland@redhat.com>
 
+	* elf/dl-cache.c (_dl_load_cache_lookup): Obey dl_hwcap_mask.
+
+	* elf/dl-support.c (_dl_hwcap_mask): New variable.
+
 	* elf/rtld.c (dl_main) [HAVE_AUX_VECTOR]: Add a cast.
 
 2010-04-05  Ulrich Drepper  <drepper@redhat.com>
diff --git a/elf/dl-cache.c b/elf/dl-cache.c
index bbeba77..5a01c2e 100644
--- a/elf/dl-cache.c
+++ b/elf/dl-cache.c
@@ -1,5 +1,6 @@
 /* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
-   Copyright (C) 1996-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1996-2002,2003,2004,2006,2010
+	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -255,17 +256,19 @@ _dl_load_cache_lookup (const char *name)
       if (platform != (uint64_t) -1)
 	platform = 1ULL << platform;
 
-      /* Only accept hwcap if it's for the right platform.  */
 #define _DL_HWCAP_TLS_MASK (1LL << 63)
+      uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
+				 | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
+
+      /* Only accept hwcap if it's for the right platform.  */
 #define HWCAP_CHECK \
+      if (lib->hwcap & hwcap_exclude)					      \
+	continue;							      \
       if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion))	      \
 	continue;							      \
       if (_DL_PLATFORMS_COUNT						      \
 	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0			      \
 	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform)		      \
-	continue;							      \
-      if (lib->hwcap							      \
-	  & ~(GLRO(dl_hwcap) | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK))      \
 	continue
       SEARCH_CACHE (cache_new);
     }
diff --git a/elf/dl-support.c b/elf/dl-support.c
index bcf0e2a..65b2575 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -1,5 +1,5 @@
 /* Support for dynamic linking code in static libc.
-   Copyright (C) 1996-2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1996-2008,2009,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -126,6 +126,14 @@ ElfW(Phdr) *_dl_phdr;
 size_t _dl_phnum;
 uint64_t _dl_hwcap __attribute__ ((nocommon));
 
+/* This is not initialized to HWCAP_IMPORTANT, matching the definition
+   of _dl_important_hwcaps, below, where no hwcap strings are ever
+   used.  This mask is still used to mediate the lookups in the cache
+   file.  Since there is no way to set this nonzero (we don't grok the
+   LD_HWCAP_MASK environment variable here), there is no real point in
+   setting _dl_hwcap nonzero below, but we do anyway.  */
+uint64_t _dl_hwcap_mask __attribute__ ((nocommon));
+
 /* Prevailing state of the stack, PF_X indicating it's executable.  */
 ElfW(Word) _dl_stack_flags = PF_R|PF_W|PF_X;
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list