public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix dl-cache AT_PLATFORM handling
Date: Tue, 19 Sep 2006 16:59:00 -0000	[thread overview]
Message-ID: <20060919165945.GO4556@sunsite.mff.cuni.cz> (raw)

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  <jakub@redhat.com>

	* 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

                 reply	other threads:[~2006-09-19 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060919165945.GO4556@sunsite.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).