| OLD | NEW |
| 1 # Copyright 2010-2012 Free Software Foundation, Inc. | 1 # Copyright 2010-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 set srcfile ${testfile}.c | 30 set srcfile ${testfile}.c |
| 31 set executable1 ${testfile}1 | 31 set executable1 ${testfile}1 |
| 32 set executable2 ${testfile}2 | 32 set executable2 ${testfile}2 |
| 33 set binfile1 ${objdir}/${subdir}/${executable1} | 33 set binfile1 ${objdir}/${subdir}/${executable1} |
| 34 set binfile2 ${objdir}/${subdir}/${executable2} | 34 set binfile2 ${objdir}/${subdir}/${executable2} |
| 35 set binfile2_test_msg OBJDIR/${subdir}/${executable2} | 35 set binfile2_test_msg OBJDIR/${subdir}/${executable2} |
| 36 | 36 |
| 37 # Use conditional compilation according to `BIN' as GDB remembers the source | 37 # Use conditional compilation according to `BIN' as GDB remembers the source |
| 38 # file name of the breakpoint. | 38 # file name of the breakpoint. |
| 39 | 39 |
| 40 set opts [list debug {additional_flags=-fPIE -pie}] | 40 set opts [list debug additional_flags=-fPIE ldflags=-pie] |
| 41 if {[build_executable ${testfile}.exp $executable1 $srcfile [concat $opts {addit
ional_flags=-DBIN=1}]] == "" | 41 if {[build_executable ${testfile}.exp $executable1 $srcfile [concat $opts {addit
ional_flags=-DBIN=1}]] == "" |
| 42 || [build_executable ${testfile}.exp $executable2 $srcfile [concat $opts {ad
ditional_flags=-DBIN=2}]] == ""} { | 42 || [build_executable ${testfile}.exp $executable2 $srcfile [concat $opts {ad
ditional_flags=-DBIN=2}]] == ""} { |
| 43 return -1 | 43 return -1 |
| 44 } | 44 } |
| 45 | 45 |
| 46 clean_restart ${executable1} | 46 clean_restart ${executable1} |
| 47 | 47 |
| 48 gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}" | 48 gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}" |
| 49 | 49 |
| 50 if ![runto_main] { | 50 if ![runto_main] { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 verbose -log "addr2 is $addr2" | 93 verbose -log "addr2 is $addr2" |
| 94 | 94 |
| 95 # Ensure we cannot get a false PASS and the inferior has really changed. | 95 # Ensure we cannot get a false PASS and the inferior has really changed. |
| 96 set test "pie_execl_marker address has changed" | 96 set test "pie_execl_marker address has changed" |
| 97 if [string equal $addr1 $addr2] { | 97 if [string equal $addr1 $addr2] { |
| 98 fail $test | 98 fail $test |
| 99 } else { | 99 } else { |
| 100 pass $test | 100 pass $test |
| 101 } | 101 } |
| OLD | NEW |