Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Add nopie in two test-cases
Date: Fri, 8 Oct 2021 11:20:53 +0200	[thread overview]
Message-ID: <20211008092051.GA12477@delia.home> (raw)

Hi,

When running test-case gdb.dwarf2/dw2-restrict.exp on openSUSE Leap 15.2 with
gcc-PIE installed (switching compiler default to -fPIE/-pie), I get:
...
gdb compile failed, ld: outputs/gdb.dwarf2/dw2-restrict/dw2-restrict0.o: \
  warning: relocation in read-only section `.text'
ld: warning: creating DT_TEXTREL in a PIE
UNTESTED: gdb.dwarf2/dw2-restrict.exp: failed to prepare
...

This is due to using a hardcoded .S file that was generated with -fno-PIE.

Fix this by adding the missing nopie.

Likewise in gdb.arch/amd64-tailcall-noret.exp.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Add nopie in two test-cases

---
 gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp | 2 ++
 gdb/testsuite/gdb.dwarf2/dw2-restrict.exp       | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp
index c68abce61e3..fb1d5695a11 100644
--- a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp
+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp
@@ -25,6 +25,8 @@ if [info exists COMPILE] {
     return
 }
 
+lappend opts nopie
+
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp b/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp
index 6f98b6cfb18..2a46510c7a3 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp
@@ -27,7 +27,8 @@ if {![istarget x86_64-*] || ![is_lp64_target]} {
 
 standard_testfile .S
 
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+	 {nodebug nopie}]} {
     return -1
 }
 

                 reply	other threads:[~2021-10-08  9:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211008092051.GA12477@delia.home \
    --to=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox