| OLD | NEW |
| 1 # Copyright (C) 2003, 2005, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2003, 2005, 2007-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 |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 # | 15 # |
| 16 | 16 |
| 17 # Tests for shared object file relocation. If two shared objects have | 17 # Tests for shared object file relocation. If two shared objects have |
| 18 # the same load address (actually, overlapping load spaces), one of | 18 # the same load address (actually, overlapping load spaces), one of |
| 19 # them gets relocated at load-time. Check that gdb gets the right | 19 # them gets relocated at load-time. Check that gdb gets the right |
| 20 # values for the debugging and minimal symbols. | 20 # values for the debugging and minimal symbols. |
| 21 | 21 |
| 22 if {[skip_shlib_tests]} { | 22 if {[skip_shlib_tests]} { |
| 23 return 0 | 23 return 0 |
| 24 } | 24 } |
| 25 | 25 |
| 26 if $tracelevel then { | |
| 27 strace $tracelevel | |
| 28 } | |
| 29 | |
| 30 # | 26 # |
| 31 # This file uses shreloc.c, shreloc1.c and shreloc2.c | 27 # This file uses shreloc.c, shreloc1.c and shreloc2.c |
| 32 # | 28 # |
| 33 | 29 |
| 34 | 30 |
| 35 set workdir ${objdir}/${subdir} | 31 set workdir ${objdir}/${subdir} |
| 36 set testfile "shreloc" | 32 set testfile "shreloc" |
| 37 set libfile1 "shreloc1" | 33 set libfile1 "shreloc1" |
| 38 set libfile2 "shreloc2" | 34 set libfile2 "shreloc2" |
| 39 set srcfile $srcdir/$subdir/$testfile.c | 35 set srcfile $srcdir/$subdir/$testfile.c |
| 40 set lib1src $srcdir/$subdir/$libfile1.c | 36 set lib1src $srcdir/$subdir/$libfile1.c |
| 41 set lib2src $srcdir/$subdir/$libfile2.c | 37 set lib2src $srcdir/$subdir/$libfile2.c |
| 42 set binfile $objdir/$subdir/$testfile | 38 set binfile $objdir/$subdir/$testfile |
| 43 set lib1_sl $objdir/$subdir/$libfile1.sl | 39 set lib1_sl $objdir/$subdir/$libfile1.sl |
| 44 set lib2_sl $objdir/$subdir/$libfile2.sl | 40 set lib2_sl $objdir/$subdir/$libfile2.sl |
| 45 | 41 |
| 46 if [get_compiler_info ${binfile}] { | 42 if [get_compiler_info] { |
| 47 return -1 | 43 return -1 |
| 48 } | 44 } |
| 49 | 45 |
| 50 set lib_opts "debug" | 46 set lib_opts "debug" |
| 51 set exec_opts [list debug shlib=$lib1_sl shlib=$lib2_sl] | 47 set exec_opts [list debug shlib=$lib1_sl shlib=$lib2_sl] |
| 52 | 48 |
| 53 if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { | 49 if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { |
| 54 lappend lib_opts "ldflags=-Wl,--image-base,0x04000000" | 50 lappend lib_opts "ldflags=-Wl,--image-base,0x04000000" |
| 55 } | 51 } |
| 56 | 52 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 # relocated. | 255 # relocated. |
| 260 # | 256 # |
| 261 # A better approach would be include absolute symbols via the assembler. | 257 # A better approach would be include absolute symbols via the assembler. |
| 262 # | 258 # |
| 263 if {[check_same "_minor_os_version__" "${msymfile}"]} { | 259 if {[check_same "_minor_os_version__" "${msymfile}"]} { |
| 264 pass "Absolute symbols not relocated" | 260 pass "Absolute symbols not relocated" |
| 265 } else { | 261 } else { |
| 266 fail "Absolute symbols not relocated" | 262 fail "Absolute symbols not relocated" |
| 267 } | 263 } |
| 268 } | 264 } |
| OLD | NEW |