From patchwork Wed Mar 6 10:20:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 31728 Received: (qmail 101810 invoked by alias); 6 Mar 2019 10:20:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 101792 invoked by uid 89); 6 Mar 2019 10:20:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1763 X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr140075.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (40.107.14.75) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Mar 2019 10:20:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T1QJi8x2sWDlRcB3Z1MQ+4Dsi6BynaYWiQa8p7EQspM=; b=hZCCYbZ9T+pZnMkw3yJmHwsg6zylb611CKBTvW93sDh15vvtBqucS+uI8UpVFAdlhvl0EmJy6dngnR3/klL0lroHE19LqKlIrnq+pAEHTQY8okevhOlVIV5cSL5Z4OXXBvUMobuI/bmnkZkHRWOybI+E3PzKgY0mU6u57cFUFUE= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2152.eurprd08.prod.outlook.com (10.172.226.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Wed, 6 Mar 2019 10:20:12 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::e974:35a7:c83c:e5b7]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::e974:35a7:c83c:e5b7%3]) with mapi id 15.20.1686.018; Wed, 6 Mar 2019 10:20:12 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH] Testsuite: Ensure pie is disabled on some tests Date: Wed, 6 Mar 2019 10:20:12 +0000 Message-ID: <20190306102006.99150-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes Recent versions of Ubuntu and Debian default GCC to enable pie. In dump.exp, pie will causes addresses to be out of range for IHEX. In break-interp.exp, pie is explicitly set for some tests and assumed to be disabled for the remainder. Ensure pie is disabled for these tests when required. gdb/testsuite/ChangeLog: 2019-03-06 Alan Hayward * gdb.base/break-interp.exp: Ensure pie is disabled. * gdb.base/dump.exp: Likewise. --- gdb/testsuite/gdb.base/break-interp.exp | 4 ++++ gdb/testsuite/gdb.base/dump.exp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp index f85e8a650a..409c31e568 100644 --- a/gdb/testsuite/gdb.base/break-interp.exp +++ b/gdb/testsuite/gdb.base/break-interp.exp @@ -627,6 +627,10 @@ foreach ldprelink {NO YES} { if {$binpie != "NO"} { lappend opts {additional_flags=-fPIE} lappend opts {ldflags=-pie} + } else { + # Recent Debian/Ubuntu defaults PIE enabled. Ensure it is disabled. + lappend opts {additional_flags=-no-pie} + lappend opts {ldflags=-no-pie} } set dir ${exec}.d diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp index 44b0988b80..b2d7ef938a 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -36,6 +36,10 @@ if {[istarget "spu*-*-*"]} then { set is64bitonly "yes" } +# Ensure -pie is disabled as this breaks IHEX tests. +# (PIE defaults to enabled on recent Debian/Ubuntu). +lappend options "additional_flags=-no-pie" + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } { untested "failed to compile" return -1