From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Add nopie to gdb.base/unwind-on-each-insn-amd64-2.exp
Date: Wed, 27 Sep 2023 09:24:10 +0200 [thread overview]
Message-ID: <20230927072410.7000-1-tdevries@suse.de> (raw)
When running test-case gdb.base/unwind-on-each-insn-amd64-2.exp with target
board unix/-fPIE/-pie, I run into:
...
gdb compile failed, ld: unwind-on-each-insn-amd64-21.o: relocation \
R_X86_64_32S against `.text' can not be used when making a PIE object; \
recompile with -fPIE
ld: failed to set dynamic section sizes: bad value
...
Fix this by hardcoding nopie in the test-case, and for good measure in the
other test-cases that source unwind-on-each-insn.exp.tcl and use a .s file.
Tested on x86_64-linux.
---
.../gdb.base/unwind-on-each-insn-amd64-2.exp | 11 +++++++++--
gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp | 8 ++++++--
gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp | 8 ++++++--
gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 1 +
gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl | 2 +-
5 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp
index c8a94ccef4f..8675ba2fa48 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp
@@ -17,8 +17,15 @@
require is_x86_64_m64_target
-set srcfile_flags {debug}
-set srcfile2_flags {nodebug}
+set srcfile_flags {}
+lappend srcfile_flags debug
+lappend srcfile_flags nopie
+
+set srcfile2_flags {}
+lappend srcfile2_flags nodebug
+lappend srcfile_flags nopie
+
+set ldflags $srcfile_flags
if [info exists COMPILE] {
# Make sure that we use .eh_frame info, by generating it
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
index cec4a2de236..e7c22d47cd7 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
@@ -17,8 +17,12 @@
require is_x86_64_m64_target
-set srcfile_flags {debug}
-set srcfile2_flags {debug}
+set srcfile_flags {}
+lappend srcfile_flags debug
+lappend srcfile_flags nopie
+
+set srcfile2_flags $srcfile_flags
+set ldflags $srcfile_flags
if [info exists COMPILE] {
standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
index 5e9f60902e7..255ed09f1ba 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
@@ -17,8 +17,12 @@
require is_x86_like_target
-set srcfile_flags {debug}
-set srcfile2_flags {debug}
+set srcfile_flags {}
+lappend srcfile_flags debug
+lappend srcfile_flags nopie
+
+set srcfile2_flags $srcfile_flags
+set ldflags $srcfile_flags
if [info exists COMPILE] {
standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
index 2fc6d30b0f3..b5fc257b69e 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
@@ -17,6 +17,7 @@ standard_testfile .c -foo.c
set srcfile_flags {debug}
set srcfile2_flags {nodebug}
+set ldflags {debug}
# Make sure that we don't use .eh_frame info, by not generating it,
# using -fno-asynchronous-unwind-tables, if supported.
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl
index 1b6840e3102..82404d191e0 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl
@@ -24,7 +24,7 @@
# value, can be calculated correctly.
if {[prepare_for_testing_full "failed to prepare" \
- [list ${testfile} {debug} \
+ [list ${testfile} $ldflags \
$srcfile $srcfile_flags $srcfile2 $srcfile2_flags]]} {
return -1
}
base-commit: 5f22c5abdc68b8a6eab049a30412511b941f65d8
--
2.35.3
next reply other threads:[~2023-09-27 7:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 7:24 Tom de Vries [this message]
2023-09-28 2:10 ` Kevin Buettner
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=20230927072410.7000-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).