From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QL68Oud121/TSwAAWB0awg (envelope-from ) for ; Thu, 17 Dec 2020 10:14:47 -0500 Received: by simark.ca (Postfix, from userid 112) id EC4E91F0AA; Thu, 17 Dec 2020 10:14:47 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1896F1E965 for ; Thu, 17 Dec 2020 10:14:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C241E389602F; Thu, 17 Dec 2020 15:14:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C241E389602F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608218083; bh=Jruwpt1xERj/E292cFhlRaPJNOLFSfRt1q6KUmWV3sA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EEJMiKDxLINiHkG7VGiS6Fhd/NqCM75R72WgYyb4uxXVkEs2AgDM+1oL211jubOa0 SFM4p8PmlSgIhX3WA/26OvDmjaLi5U1pjsL83phoiSNDgE5ICPqDLd81FzzcI67Gak yXsh+U1l18DIBXnTrIG4quEZlYQAfjK2h6mRd12M= Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id ABD87388E807 for ; Thu, 17 Dec 2020 15:14:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABD87388E807 IronPort-SDR: I/pUHhJQSxYjR3nNzVPZDkbW6Ycucop5pi9YQfm0tDchSYEl2j6+M3pScWDPjSxTyY7BQKlku8 BWD661MDrtXQ== X-IronPort-AV: E=McAfee;i="6000,8403,9837"; a="163004814" X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="163004814" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 07:14:25 -0800 IronPort-SDR: 4+FECg7k1I2+OSpNz76PvmpWxButaGAKhwMeHU08P6cmzNCFuzqiEfmJ96KSRQohwmtCgr2q2r +Px9GSzOnN1g== X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="453126307" Received: from labpc2407.iul.intel.com (HELO localhost) ([172.28.50.61]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 07:14:24 -0800 To: gdb-patches@sourceware.org Subject: [PATCH 4/4] testsuite, gdb.btrace: fix 32-bit PIE false positives Date: Thu, 17 Dec 2020 16:12:12 +0100 Message-Id: <20201217151212.1179058-5-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201217151212.1179058-1-markus.t.metzger@intel.com> References: <20201217151212.1179058-1-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Markus Metzger via Gdb-patches Reply-To: Markus Metzger Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" For 32-bit position independent executables, GCC generates an extra call to __x86.get_pc_thunk. which appears in the function call history. It is correct to appear there but this confuses the tests, which check for an expected sequence of functions. Build with -no-pie -fno-pie to avoid this complication. gdb/testsuite/ChangeLog: 2020-12-04 Markus Metzger * gdb.btrace/exception.exp: Build with -no-pie -fno-pie. * gdb.btrace/function_call_history.exp: Likewise. * gdb.btrace/unknown_functions.exp: Likewise. --- gdb/testsuite/gdb.btrace/exception.exp | 5 ++++- gdb/testsuite/gdb.btrace/function_call_history.exp | 5 ++++- gdb/testsuite/gdb.btrace/unknown_functions.exp | 9 ++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.btrace/exception.exp b/gdb/testsuite/gdb.btrace/exception.exp index 0d242227938..b515de87b01 100755 --- a/gdb/testsuite/gdb.btrace/exception.exp +++ b/gdb/testsuite/gdb.btrace/exception.exp @@ -22,8 +22,11 @@ if { [skip_btrace_tests] } { return -1 } +# We expect a specific function call history. This gets messed up with +# PIE on 32-bit. standard_testfile exception.cc -if [prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}] { +if [prepare_for_testing "failed to prepare" $testfile $srcfile \ + {additional_flags=-fno-pie ldflags=-no-pie c++ debug}] { return -1 } diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp index 51536ff6035..ea22692bb47 100644 --- a/gdb/testsuite/gdb.btrace/function_call_history.exp +++ b/gdb/testsuite/gdb.btrace/function_call_history.exp @@ -22,8 +22,11 @@ if { [skip_btrace_tests] } { return -1 } +# We expect a specific function call history. This gets messed up with +# PIE on 32-bit. standard_testfile -if [prepare_for_testing "failed to prepare" $testfile {} {debug}] { +if [prepare_for_testing "failed to prepare" $testfile {} \ + {additional_flags=-fno-pie ldflags=-no-pie debug}] { return -1 } diff --git a/gdb/testsuite/gdb.btrace/unknown_functions.exp b/gdb/testsuite/gdb.btrace/unknown_functions.exp index 4db9c70f496..76803319d9f 100644 --- a/gdb/testsuite/gdb.btrace/unknown_functions.exp +++ b/gdb/testsuite/gdb.btrace/unknown_functions.exp @@ -24,9 +24,12 @@ if { [skip_btrace_tests] } { standard_testfile -# discard local symbols -set ldflags "additional_flags=-Wl,-x" -if [prepare_for_testing "failed to prepare" $testfile $srcfile $ldflags] { +# We expect a specific function call history. This gets messed up with +# PIE on 32-bit. +# +# Also discard local symbols. +if [prepare_for_testing "failed to prepare" $testfile $srcfile \ + {additional_flags=-fno-pie additional_flags=-Wl,-x ldflags=-no-pie}] { return -1 } -- 2.26.2 Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Gary Kershaw Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928