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.
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
}
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}
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
}
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
}