]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2021-2024 Free Software Foundation, Inc. |
a7308ce0 TT |
2 | |
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. | |
7 | # | |
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. | |
12 | # | |
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/>. | |
15 | ||
16 | load_lib dwarf.exp | |
17 | ||
18 | # This test can only be run on targets which support DWARF-2 and use gas. | |
ce8d533e | 19 | require dwarf2_support |
a7308ce0 TT |
20 | |
21 | # No remote host testing either. | |
52c0551e | 22 | require {!is_remote host} |
a7308ce0 TT |
23 | |
24 | standard_testfile main.c dwznolink.S | |
25 | ||
26 | set asm_file [standard_output_file $srcfile2] | |
27 | ||
28 | # The DWARF should contain a reference to a supplementary ("dwz") | |
29 | # file, but the section that links to the file should be missing. At | |
30 | # one point, this caused gdb crashes. | |
31 | Dwarf::assemble $asm_file { | |
32 | cu {} { | |
33 | compile_unit {{language @DW_LANG_C}} { | |
34 | constant { | |
35 | {name 0 DW_FORM_GNU_strp_alt} | |
36 | {type 97 DW_FORM_GNU_ref_alt} | |
37 | {const_value 99 data1} | |
38 | } | |
39 | } | |
40 | } | |
41 | } | |
42 | ||
43 | # We can't use prepare_for_testing here because we need to check the | |
44 | # 'file' command's output. | |
45 | if {[build_executable $testfile.exp $testfile \ | |
46 | [list $srcfile $asm_file] {nodebug quiet}]} { | |
47 | return -1 | |
48 | } | |
49 | ||
e8d8a0df | 50 | clean_restart |
a7308ce0 TT |
51 | gdb_test "file -readnow $binfile" \ |
52 | "could not read '.gnu_debugaltlink' section" \ | |
53 | "file $testfile" |