1 # Copyright 2012-2024 Free Software Foundation, Inc.
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
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/>.
16 # Test that on Linux, we don't warn about not finding the vDSO. E.g.:
18 # warning: Could not load shared library symbols for linux-vdso.so.1.
22 if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
26 with_test_prefix "setup" {
29 # At least some versions of Fedora/RHEL glibc have local patches that
30 # hide the vDSO. This lines re-exposes it. See PR libc/13097,
31 # comment 2. There's no support for passing environment variables in
32 # the remote protocol, but that's OK -- if we're testing against a
33 # glibc that doesn't list the vDSO without this, the test should still
35 gdb_test_no_output "set environment LD_DEBUG=unused"
38 proc test_no_vdso {command} {
43 gdb_test_multiple "$command" $message {
44 -re "Could not load shared library symbols .*\r\n$gdb_prompt $" {
47 -re "main \\(\\) at .*$srcfile.*\r\n$gdb_prompt $" {
52 # Extra testing in case the warning changes and we miss updating
54 set test "no vdso without symbols is listed"
55 gdb_test_multiple "info shared" $test {
56 -re "No\[^\r\n\]+linux-(vdso|gate).*$gdb_prompt $" {
65 # First, try a live process.
66 with_test_prefix "run" {
71 # Now, dump a core, and reload it.
72 with_test_prefix "core" {
73 set corefile [standard_output_file $testfile.core]
74 set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
75 if {!$core_supported} {
79 clean_restart ${testfile}
81 test_no_vdso "core-file $corefile"