aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-06-17 12:28:58 +0200
committerTom de Vries <tdevries@suse.de>2023-06-17 12:28:58 +0200
commit90cce6c0551b31b7e7bebec8ca9d6ac9267a8560 (patch)
tree8916aab8b54c1abbe2e356a95de2757926d03d91 /gdb
parent09ea7c9c49ec1a94c8107cd2c1dd303d158b218d (diff)
downloadgdb-90cce6c0551b31b7e7bebec8ca9d6ac9267a8560.zip
gdb-90cce6c0551b31b7e7bebec8ca9d6ac9267a8560.tar.gz
gdb-90cce6c0551b31b7e7bebec8ca9d6ac9267a8560.tar.bz2
[gdb/testsuite] Add nopie in a few test-cases
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.arch/i386-disp-step.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/implptr.exp2
-rw-r--r--gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/typeddwarf.exp7
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 02f7413..45fad09 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 71fb1e4..d8d5ff9 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 b0e01af..bdb7fc8 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 3fafe9c..1e46cab 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
}