From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55590 invoked by alias); 6 Sep 2016 15:42:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 55577 invoked by uid 89); 6 Sep 2016 15:42:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy=loader, s390x, H*x:version, rely X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Sep 2016 15:42:47 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u86FcECs144704 for ; Tue, 6 Sep 2016 11:42:46 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 259y59etag-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 06 Sep 2016 11:42:45 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Sep 2016 16:42:43 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Sep 2016 16:42:41 +0100 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: uweigand@de.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7CF9A17D8067 for ; Tue, 6 Sep 2016 16:44:33 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u86Fgfrp22610034 for ; Tue, 6 Sep 2016 15:42:41 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u86FgfUn009245 for ; Tue, 6 Sep 2016 09:42:41 -0600 Received: from oc8523832656.ibm.com (dyn-9-152-213-149.boeblingen.de.ibm.com [9.152.213.149]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u86Fgeev009240; Tue, 6 Sep 2016 09:42:41 -0600 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id CCF5B100057; Tue, 6 Sep 2016 17:39:13 +0200 (CEST) Subject: Re: [PATCH] Pass HWCAP to ifunc resolver To: arnez@linux.vnet.ibm.com (Andreas Arnez) Date: Tue, 06 Sep 2016 15:42:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Andreas Arnez" at Aug 31, 2016 01:49:57 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16090615-0008-0000-0000-000002BF1C8F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16090615-0009-0000-0000-000019B5BDF5 Message-Id: <20160906154240.CCF5B100057@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-06_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1609060242 X-SW-Source: 2016-09/txt/msg00057.txt.bz2 Andreas Arnez wrote: > On various GNU Elf architectures, including AArch64, ARM, s390/s390x, > ppc32/64, and sparc32/64, the dynamic loader passes HWCAP as a parameter > to each ifunc resolver. Currently there is an open glibc Bugzilla that > requests this to be generalized to all architectures: > > https://sourceware.org/bugzilla/show_bug.cgi?id=19766 > > And various ifunc resolvers already rely on receiving HWCAP. Currently > GDB always calls an ifunc resolver without any arguments; thus the > resolver may receive garbage, and based on that, the resolver may decide > to return a function that is not suited for the given platform. > > This patch always passes HWCAP to ifunc resolvers, even on systems where > the dynamic loader currently behaves otherwise. The rationale is > that (1) the dynamic loader may get adjusted on those systems as well in > the future; (2) passing an unused argument should not cause a problem > with existing resolvers; and (3) the logic is much simpler without such > a distinction. This makes sense to me. If necessary, we can always still add platform- specific call sequences later. > gdb/ChangeLog: > > * elfread.c (auxv.h): New include. > (elf_gnu_ifunc_resolve_addr): Pass HWCAP to ifunc resolver. > > gdb/testsuite/ChangeLog: > > * gdb.base/gnu-ifunc-lib.c (resolver_hwcap): New external > variable declaration. > (gnu_ifunc): Add parameter hwcap. Store it in resolver_hwcap. > * gdb.base/gnu-ifunc.c (resolver_hwcap): New global variable. > * gdb.base/gnu-ifunc.exp: Add test to verify that the resolver > received HWCAP as its argument. This is OK. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com