From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id S1PpMrQK3V+hegAAWB0awg (envelope-from ) for ; Fri, 18 Dec 2020 15:01:56 -0500 Received: by simark.ca (Postfix, from userid 112) id C63211F0AA; Fri, 18 Dec 2020 15:01:56 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 888B61E590 for ; Fri, 18 Dec 2020 15:01:52 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 452E53854813; Fri, 18 Dec 2020 20:01:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 452E53854813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608321712; bh=ny4kub9dfukTyEmuaerbLMA8jB0rGgZROxK4a/PRPv0=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=byQVAUHhXVXjA1soC4udmbO5kKypPY8miBC7KQXXPqPynbUyD3OGiCDfLDxHrM2eo Q5xIyWhrIlWNCufD+wFDkITattJ/6EEsk1PAzwTHL5GclUzELVYLFS5IfwyI7qCfX4 8zH64xsPySKvRigCTIYmKETP1vtgVAm2l7HQ9fEc= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 4F1483857004 for ; Fri, 18 Dec 2020 20:01:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4F1483857004 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 0BIK1Yuh019112 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Dec 2020 15:01:38 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0BIK1Yuh019112 Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D0CB91E590; Fri, 18 Dec 2020 15:01:33 -0500 (EST) Subject: Re: [PATCH 4/4] testsuite, gdb.btrace: fix 32-bit PIE false positives To: Markus Metzger , gdb-patches@sourceware.org References: <20201217151212.1179058-1-markus.t.metzger@intel.com> <20201217151212.1179058-5-markus.t.metzger@intel.com> Message-ID: <6d4b40f4-31b4-bc99-41a1-36abca520774@polymtl.ca> Date: Fri, 18 Dec 2020 15:01:33 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <20201217151212.1179058-5-markus.t.metzger@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 18 Dec 2020 20:01:34 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-12-17 10:12 a.m., Markus Metzger via Gdb-patches wrote: > 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 > } There's the "nopie" option you can pass to gdb_compile to disable PIE. Although from what I see, it doesn't add -fno-pie to compilation options, just adds -no-pie to link options. I suppose you need both? If so, it could be preferable in the long run to teach gdb_compile to pass -fno-pie to the compilation step as well. Simon