From 51898c1516dadb423f80b5c5959f080c18982f37 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 8 Mar 2012 07:42:51 +0000 Subject: [PATCH] gdb/testsuite/ Fix false FAIL on distros with relro linkage as default. * gdb.reverse/solib-precsave.exp: Try to compile the test using -Wl,-z,norelro first. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.reverse/solib-precsave.exp | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 606fedd5f60..a5b57f5be72 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-03-08 Jan Kratochvil + + Fix false FAIL on distros with relro linkage as default. + * gdb.reverse/solib-precsave.exp: Try to compile the test using + -Wl,-z,norelro first. + 2012-03-06 Joel Brobecker * gdb.ada/bp_on_var: New testcase. diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp index 15da8025873..ec89f6c4312 100644 --- a/gdb/testsuite/gdb.reverse/solib-precsave.exp +++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp @@ -39,7 +39,13 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${libsrc} ${library} "debug"] != "" set exec_opts [list debug shlib=${library}] -if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opts] != "" } { +# Attempt to prevent -Wl,-z,relro which may happen by default with some +# toolchain configurations. Due to PR corefiles/11804 GDB will then produce +# invalid core file. + +if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable \ + [concat $exec_opts additional_flags=-Wl,-z,norelro]] != "" + && [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opts] != "" } { untested "Could not compile $binfile." return -1 } -- 2.30.2