| OLD | NEW |
| 1 # Copyright (C) 2009-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2009-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 30 matching lines...) Expand all Loading... |
| 41 # | 41 # |
| 42 # Both functions need to be in the same shared library file but | 42 # Both functions need to be in the same shared library file but |
| 43 # gdb_compile_shlib has no way to specify source-specific compilation options. | 43 # gdb_compile_shlib has no way to specify source-specific compilation options. |
| 44 # | 44 # |
| 45 # Therefore $libfile contains only the STT_GNU_IFUNC function with no DWARF | 45 # Therefore $libfile contains only the STT_GNU_IFUNC function with no DWARF |
| 46 # referencing all the other parts from the main executable with DWARF. | 46 # referencing all the other parts from the main executable with DWARF. |
| 47 | 47 |
| 48 set lib_opts {} | 48 set lib_opts {} |
| 49 set exec_opts [list debug shlib=$lib_so] | 49 set exec_opts [list debug shlib=$lib_so] |
| 50 | 50 |
| 51 if [get_compiler_info ${binfile}] { | 51 if [get_compiler_info] { |
| 52 return -1 | 52 return -1 |
| 53 } | 53 } |
| 54 | 54 |
| 55 if { [gdb_compile_shlib ${srcdir}/${subdir}/$libsrc $lib_so $lib_opts] != "" | 55 if { [gdb_compile_shlib ${srcdir}/${subdir}/$libsrc $lib_so $lib_opts] != "" |
| 56 || [gdb_compile ${srcdir}/${subdir}/$srcfile $binfile executable $exec_opts
] != ""} { | 56 || [gdb_compile ${srcdir}/${subdir}/$srcfile $binfile executable $exec_opts
] != ""} { |
| 57 untested "Could not compile dynamic executable $binfile." | 57 untested "Could not compile dynamic executable $binfile." |
| 58 return -1 | 58 return -1 |
| 59 } | 59 } |
| 60 | 60 |
| 61 # Start with a fresh gdb. | 61 # Start with a fresh gdb. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 -re "Symbol \"gnu_ifunc\" is at (0x\[0-9a-f\]+) in .*$gdb_prompt $" { | 120 -re "Symbol \"gnu_ifunc\" is at (0x\[0-9a-f\]+) in .*$gdb_prompt $" { |
| 121 pass $test | 121 pass $test |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 gdb_test "info sym $expect_out(1,string)" "gnu_ifunc in section .*" "info sym <g
nu_ifunc-address>" | 124 gdb_test "info sym $expect_out(1,string)" "gnu_ifunc in section .*" "info sym <g
nu_ifunc-address>" |
| 125 | 125 |
| 126 | 126 |
| 127 # Test statically linked ifunc resolving during inferior start. | 127 # Test statically linked ifunc resolving during inferior start. |
| 128 # https://bugzilla.redhat.com/show_bug.cgi?id=624967 | 128 # https://bugzilla.redhat.com/show_bug.cgi?id=624967 |
| 129 | 129 |
| 130 if ![target_info exists gdb_stub] { | 130 # Compile $staticbinfile separately as it may exit on error (ld/12595). |
| 131 | 131 |
| 132 # Compile $staticbinfile separately as it may exit on error (ld/12595). | 132 if { [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != "" |
| 133 || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile execut
able {debug}] != "" } { |
| 134 untested "Could not compile static executable $staticbinfile." |
| 135 return -1 |
| 136 } |
| 133 | 137 |
| 134 if { [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != "" | 138 clean_restart $staticexecutable |
| 135 » || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile ex
ecutable {debug}] != "" } { | |
| 136 » untested "Could not compile static executable $staticbinfile." | |
| 137 » return -1 | |
| 138 } | |
| 139 | 139 |
| 140 clean_restart $staticexecutable | 140 gdb_breakpoint "gnu_ifunc" |
| 141 | 141 gdb_breakpoint "main" |
| 142 gdb_breakpoint "gnu_ifunc" | 142 gdb_run_cmd |
| 143 gdb_breakpoint "main" | 143 gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc" |
| 144 gdb_run_cmd | |
| 145 gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc" | |
| 146 } | |
| OLD | NEW |