aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-10-12 16:50:16 +0200
committerTom de Vries <tdevries@suse.de>2022-10-12 16:50:16 +0200
commita2470500432334fe254ef10ddabcab239e8de828 (patch)
tree10794d93dd71b88b0c5692bae4c3db44ac8cab2a
parent9693166f6648b3aaa7dc680b3fecda16b63ecfb4 (diff)
downloadgdb-a2470500432334fe254ef10ddabcab239e8de828.zip
gdb-a2470500432334fe254ef10ddabcab239e8de828.tar.gz
gdb-a2470500432334fe254ef10ddabcab239e8de828.tar.bz2
[gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with recent ld
On openSUSE Tumbleweed (with ld 2.39) and test-case gdb.base/infoline-reloc-main-from-zero.exp, I get: ... gdb compile failed, ld: warning: infoline-reloc-main-from-zero has a LOAD \ segment with RWX permissions UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: \ infoline-reloc-main-from-zero.exp ... Fix this by compiling with -Wl,--no-warn-rwx-segments. Tested on x86_64-linux.
-rw-r--r--gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
index 31e753a..35c2db0 100644
--- a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
+++ b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
@@ -25,7 +25,15 @@ standard_testfile .c
# Build executable with stripped startup code and text section starting at zero
-set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"}
+set opts {}
+lappend opts debug
+lappend opts "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"
+
+set ld_flags additional_flags=-Wl,--no-warn-rwx-segments
+if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \
+ $ld_flags] } {
+ lappend opts $ld_flags
+}
if {[build_executable $testfile.exp $testfile $srcfile $opts] == -1} {
untested "failed to compile"