From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20879 invoked by alias); 19 Sep 2006 16:59:59 -0000 Received: (qmail 20863 invoked by uid 22791); 19 Sep 2006 16:59:58 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Sep 2006 16:59:54 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k8JGxk0t020089; Tue, 19 Sep 2006 18:59:46 +0200 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k8JGxkQY020086; Tue, 19 Sep 2006 18:59:46 +0200 Date: Tue, 19 Sep 2006 16:59:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix dl-cache AT_PLATFORM handling Message-ID: <20060919165945.GO4556@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00035.txt.bz2 Hi! If kernel doesn't provide any AT_PLATFORM in auxv on targets which support it, we should reject any libraries with non-zero _DL_HWCAP_PLATFORM bits (i.e. any platform optimized libs), rather than accepting them all. Otherwise we could say load power5 optimized lib on power4 when using ld.so.cache (for path searches for libraries ld.so was doing the right thing already before). 2006-09-19 Jakub Jelinek * elf/dl-cache.c (HWCAP_CHECK): If _DL_PLATFORMS_COUNT, but platform == -1, reject any libs with non-zero _DL_HWCAP_PLATFORM bits. --- libc/elf/dl-cache.c.jj 2005-12-14 09:34:10.000000000 +0100 +++ libc/elf/dl-cache.c 2006-09-19 18:54:32.000000000 +0200 @@ -1,5 +1,5 @@ /* Support for reading /etc/ld.so.cache files written by Linux ldconfig. - Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1996-2002, 2003, 2004, 2006 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 @@ -264,7 +264,7 @@ _dl_load_cache_lookup (const char *name) #define HWCAP_CHECK \ if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \ continue; \ - if (_DL_PLATFORMS_COUNT && platform != -1 \ + if (_DL_PLATFORMS_COUNT \ && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \ && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \ continue; \ Jakub