Testsuite: Ensure pie is disabled on some tests
[external/binutils.git] / gdb / testsuite / gdb.base / dump.exp
index 289abb5..52ba5f8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2002-2016 Free Software Foundation, Inc.
+# Copyright 2002-2019 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -36,8 +36,12 @@ if {[istarget "spu*-*-*"]} then {
     set is64bitonly "yes"
 }
 
+# Debian9/Ubuntu16.10 onwards default to PIE enabled. Ensure it is disabled as
+# this causes addresses to be out of range for IHEX.
+lappend options {nopie}
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } {
-     untested dump.exp
+     untested "failed to compile"
      return -1
 }
 
@@ -95,18 +99,13 @@ remote_exec host "rm -f $filenames"
 # Run target program until data structs are initialized.
 
 if { ! [ runto checkpoint1 ] } then {
-    untested dump.exp
+    untested "couldn't run to checkpoint"
     return -1
 }
 
 # Get the endianness for the later use with endianless formats.
 
-gdb_test_multiple "show endian" "show endian" {
-    -re ".* (big|little) endian.*$gdb_prompt $" { 
-       set endian $expect_out(1,string) 
-       pass "endianness: $endian"
-    }
-}
+set endian [get_endianness]
 
 # Now generate some dump files.
 
@@ -152,10 +151,10 @@ make_dump_file "dump tekhex val [set intstr1.tekhex] intstruct" \
        "dump struct as value, tekhex"
 
 make_dump_file "dump verilog val [set intarr1.verilog] intarray" \
-       "dump array as value, intel hex"
+       "dump array as value, verilog"
 
 make_dump_file "dump verilog val [set intstr1.verilog] intstruct" \
-       "dump struct as value, intel hex"
+       "dump struct as value, verilog"
 
 proc capture_value { expression args } {
     global gdb_prompt