Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Testsuite: Ensure pie is disabled on some tests
@ 2019-03-06 10:20 Alan Hayward
  2019-03-19 10:45 ` [PING][PATCH] " Alan Hayward
  2019-03-19 13:48 ` [PATCH] " Simon Marchi
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Hayward @ 2019-03-06 10:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: nd, Alan Hayward

Recent versions of Ubuntu and Debian default GCC to enable pie.

In dump.exp, pie will causes addresses to be out of range for IHEX.

In break-interp.exp, pie is explicitly set for some tests and assumed
to be disabled for the remainder.

Ensure pie is disabled for these tests when required.

gdb/testsuite/ChangeLog:

2019-03-06  Alan Hayward  <alan.hayward@arm.com>

	* gdb.base/break-interp.exp: Ensure pie is disabled.
	* gdb.base/dump.exp: Likewise.
---
 gdb/testsuite/gdb.base/break-interp.exp | 4 ++++
 gdb/testsuite/gdb.base/dump.exp         | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index f85e8a650a..409c31e568 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -627,6 +627,10 @@ foreach ldprelink {NO YES} {
 			    if {$binpie != "NO"} {
 				lappend opts {additional_flags=-fPIE}
 				lappend opts {ldflags=-pie}
+			    } else {
+				# Recent Debian/Ubuntu defaults PIE enabled. Ensure it is disabled.
+				lappend opts {additional_flags=-no-pie}
+				lappend opts {ldflags=-no-pie}
 			    }
 
 			    set dir ${exec}.d
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index 44b0988b80..b2d7ef938a 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -36,6 +36,10 @@ if {[istarget "spu*-*-*"]} then {
     set is64bitonly "yes"
 }
 
+# Ensure -pie is disabled as this breaks IHEX tests.
+# (PIE defaults to enabled on recent Debian/Ubuntu).
+lappend options "additional_flags=-no-pie"
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } {
      untested "failed to compile"
      return -1
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-20 10:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 10:20 [PATCH] Testsuite: Ensure pie is disabled on some tests Alan Hayward
2019-03-19 10:45 ` [PING][PATCH] " Alan Hayward
2019-03-19 13:48 ` [PATCH] " Simon Marchi
2019-03-19 15:45   ` Alan Hayward
2019-03-19 16:07     ` Simon Marchi
2019-03-20 10:36       ` Alan Hayward
2019-03-19 16:36     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox