From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98739 invoked by alias); 19 Mar 2019 13:48:01 -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 98721 invoked by uid 89); 19 Mar 2019 13:48:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Mar 2019 13:47:59 +0000 Received: from [172.16.0.89] (192-222-157-41.qc.cable.ebox.net [192.222.157.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3D1F81E471; Tue, 19 Mar 2019 09:47:56 -0400 (EDT) Subject: Re: [PATCH] Testsuite: Ensure pie is disabled on some tests To: Alan Hayward , "gdb-patches@sourceware.org" Cc: nd References: <20190306102006.99150-1-alan.hayward@arm.com> From: Simon Marchi Message-ID: <696945e9-4942-5285-0bb4-0bf899606f0a@simark.ca> Date: Tue, 19 Mar 2019 13:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190306102006.99150-1-alan.hayward@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2019-03/txt/msg00405.txt.bz2 On 2019-03-06 5:20 a.m., Alan Hayward wrote: > 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. Hi Alan, The "nopie" flag to gdb_compile has been introduced recently for this, could you use that instead? See commit 6e8b1ab2fd4c ("Fix various tests to use -no-pie linker flag when needed"). > --- > 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} > } I believe it won't be necessary here to change CFLAGS (which additional_flags does), only ldflags, to make the final executable a non-PIE. Anyway, you'll probably end up using the "nopie" gdb_compile flag. > > 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. Can you just precise how it breaks the IHEX tests, as you did in the commit message (it causes the addresses to be out of range for that format)? This patch is ok with those fixed, thanks! Simon