This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] Fix false FAILs on gdb.reverse/solib-precsave.exp (PR corefiles/11804 workaround)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 8 Mar 2012 08:47:12 +0100
- Subject: [obv] Fix false FAILs on gdb.reverse/solib-precsave.exp (PR corefiles/11804 workaround)
Hi,
this is the same workaround as has been checked in before:
http://sourceware.org/ml/gdb-patches/2011-04/msg00568.html
[patch] testsuite: Fix "zeroed-threads" for -Wl,-z,relro
Specifically about PR corefiles/11804 - the kernel situation is considered as
correct now by Oleg Nesterov, therefore a GDB patch can finally go in.
But the testsuite should not mix testing of different bugs anyway.
Checked in. Tested it on i686-fedorarawhide-linux-gnu where RELRO has become
default by binutils-2.22.52.0.1-5.fc18.i686 -> binutils-2.22.52.0.1-7.fc18.i686.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-03/msg00126.html
--- src/gdb/testsuite/ChangeLog 2012/03/06 17:33:30 1.3126
+++ src/gdb/testsuite/ChangeLog 2012/03/08 07:42:50 1.3127
@@ -1,3 +1,9 @@
+2012-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ 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 <brobecker@adacore.com>
* gdb.ada/bp_on_var: New testcase.
--- src/gdb/testsuite/gdb.reverse/solib-precsave.exp 2012/02/24 00:05:56 1.7
+++ src/gdb/testsuite/gdb.reverse/solib-precsave.exp 2012/03/08 07:42:51 1.8
@@ -39,7 +39,13 @@
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
}