From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by sourceware.org (Postfix) with ESMTPS id 496DE3AAA0E9 for ; Thu, 4 Feb 2021 08:12:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 496DE3AAA0E9 IronPort-SDR: VuT1DXc1VhzGXp+LnU+3Ykrxxm/GwRi7PU4XBBB0FY/5y+e7yrR0w+V+wflKE0dxFIAY6CLp/K O73GiIFUSQ7g== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="181265802" X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="181265802" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 00:12:01 -0800 IronPort-SDR: Ddno63zrTEPkAVl8Ef2Ly7kawQ+0UhH+kx7WQDIyrsN5mUyD2Ji0IxEQi48fFpO80BEGtttqAO oQ12KWmkMkQQ== X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="483142411" 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; 04 Feb 2021 00:11:59 -0800 From: Markus Metzger To: gdb-patches@sourceware.org Subject: [PATCH 8/8] gdb, testsuite: enforce lazy binding for gdb.btrace/rn-dl-bind.exp Date: Thu, 4 Feb 2021 09:10:37 +0100 Message-Id: <20210204081037.3712162-12-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210204081037.3712162-1-markus.t.metzger@intel.com> References: <20210204081037.3712162-1-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 04 Feb 2021 08:12:04 -0000 In gdb.btrace/rn-dl-bind.exp we test that we can reverse-step over recorded dynamic linking. The test covers specific behaviour to support _dl_runtime_resolve calling the resolved function by returning to it. This would normally mess up stepping as we'd end up with backtraces that contain the same functions but different frame ids. Since GDB needs to recognize a return from _dl_runtime_resolve, the test only passes when debug information for _dl_runtime_resolve is available. The test requires that symbols are bound lazily. Otherwise, we won't record dynamic linking and the test will be fairly pointless. Recent GCC pass -z now by default to bind symbols eagerly. Add -z lazy to the test's ldflags to enforce lazy binding. gdb/testsuite/ChangeLog: 2021-01-13 Markus Metzger * gdb.btrace/rn-dl-bind.exp: Add ldflags=-Wl,-z,lazy. --- gdb/testsuite/gdb.btrace/rn-dl-bind.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp index 65e445334af..204e88093a4 100644 --- a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp +++ b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp @@ -27,7 +27,8 @@ if { [skip_btrace_tests] } { } standard_testfile -if [prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}] { +if [prepare_for_testing "failed to prepare" $testfile $srcfile \ + {c++ debug ldflags=-Wl,-z,lazy}] { 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