[gdb/testsuite] Add nopie to gdb.base/unwind-on-each-insn-amd64-2.exp

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.

Approved-by: Kevin Buettner <kevinb@redhat.com>
This commit is contained in:
Tom de Vries
2023-09-28 09:47:36 +02:00
parent be92e53428
commit 2654f77d14
5 changed files with 23 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

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

View File

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