From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id F20CD3858CD1 for ; Sat, 17 Jun 2023 10:30:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F20CD3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6B40521A02 for ; Sat, 17 Jun 2023 10:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686997832; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W1X1itSnxlq80A5XNPAbvK15LsFBcclAzqRnvU6XuwM=; b=a/DaKTbNycE3XXrvMEYDt7owLeSwn+VTbMfGCYLzUr9LWiPxT1wfTXbeAS0XZ7+u3IpO5L VQxBG475YoPub+3e9Ogr7RakTMoNbsEi9XfXwaqa/tDGqQBmgAGD/OJdAac5RVyKKU9TxX xhrjlqSXNC5QS01K4n4k9JBcS1PckS8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686997832; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W1X1itSnxlq80A5XNPAbvK15LsFBcclAzqRnvU6XuwM=; b=ttAoPBSMUrEldO07JsG7es0IsG6s4w5rx4PiKVdlagS1kDZCOgYlRsQloyVWhIxP1EqzQo uZLZwonj6hh/ZGCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 57B9113A74 for ; Sat, 17 Jun 2023 10:30:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CA1PFEiLjWQwcQAAMHmgww (envelope-from ) for ; Sat, 17 Jun 2023 10:30:32 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 2/3] [gdb/testsuite] Add nopie in a few test-cases Date: Sat, 17 Jun 2023 12:30:22 +0200 Message-Id: <20230617103023.32722-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230617103023.32722-1-tdevries@suse.de> References: <20230617103023.32722-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: When running test-case gdb.arch/i386-disp-step.exp with target board unix/-m32/-fPIE/-pie we run into: ... gdb compile failed, ld: i386-disp-step0.o: warning: relocation in read-only section `.text' ld: warning: creating DT_TEXTREL in a PIE ... Fix this by adding nopie in the compilation flags. Likewise in a few other test-cases. Tested on x86_64-linux. --- gdb/testsuite/gdb.arch/i386-disp-step.exp | 6 +++++- gdb/testsuite/gdb.dwarf2/implptr.exp | 2 ++ gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp | 6 +++++- gdb/testsuite/gdb.dwarf2/typeddwarf.exp | 7 ++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.exp b/gdb/testsuite/gdb.arch/i386-disp-step.exp index 02f74136507..45fad094a67 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step.exp +++ b/gdb/testsuite/gdb.arch/i386-disp-step.exp @@ -22,7 +22,11 @@ require is_x86_like_target standard_testfile .S -if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { +set opts {} +lappend opts debug +lappend opts nopie + +if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/implptr.exp b/gdb/testsuite/gdb.dwarf2/implptr.exp index 71fb1e443ef..d8d5ff9abd5 100644 --- a/gdb/testsuite/gdb.dwarf2/implptr.exp +++ b/gdb/testsuite/gdb.dwarf2/implptr.exp @@ -26,6 +26,8 @@ standard_testfile .S set csrcfile ${testfile}.c set opts {} +lappend opts nopie + if [info exists COMPILE] { # make check RUNTESTFLAGS='gdb.dwarf2/implptr.exp COMPILE=1 CC_FOR_TARGET=gcc\ -m32' set srcfile ${csrcfile} diff --git a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp index b0e01afd06e..bdb7fc8141e 100644 --- a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp +++ b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp @@ -22,7 +22,11 @@ require dwarf2_support is_x86_like_target standard_testfile .S set csrcfile ${testfile}.c -if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile]} { +set opts {} +lappend opts debug +lappend opts nopie + +if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile $opts]} { return -1 } diff --git a/gdb/testsuite/gdb.dwarf2/typeddwarf.exp b/gdb/testsuite/gdb.dwarf2/typeddwarf.exp index 3fafe9cf6f8..1e46cab03ef 100644 --- a/gdb/testsuite/gdb.dwarf2/typeddwarf.exp +++ b/gdb/testsuite/gdb.dwarf2/typeddwarf.exp @@ -29,7 +29,12 @@ if { [is_x86_like_target] } { return 0 } -if { [prepare_for_testing "failed to prepare" "${test}" ${sfile} {nodebug additional_flags=-nostdlib}] } { +set opts {} +lappend opts nodebug +lappend opts additional_flags=-nostdlib +lappend opts nopie + +if { [prepare_for_testing "failed to prepare" "${test}" ${sfile} $opts] } { return -1 } -- 2.35.3