1 # Copyright
2021-2022 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
/>.
18 # This test can only be run
on targets which support DWARF
-2 and use gas.
19 if {![dwarf2_support
]} {
23 # No remote host testing either.
24 if {[is_remote host
]} {
28 standard_testfile main.c dwznolink.S
30 set asm_file
[standard_output_file $srcfile2
]
32 # The DWARF should contain a reference to a supplementary
("dwz")
33 # file
, but the section that links to the file should be missing. At
34 # one point
, this caused gdb crashes.
35 Dwarf
::assemble $asm_file
{
37 compile_unit
{{language @DW_LANG_C
}} {
39 {name 0 DW_FORM_GNU_strp_alt
}
40 {type
97 DW_FORM_GNU_ref_alt
}
41 {const_value
99 data1
}
47 # We can
't use prepare_for_testing here because we need to check the
48 # 'file
' command's output.
49 if {[build_executable $testfile.exp $testfile \
50 [list $srcfile $asm_file
] {nodebug quiet
}]} {
56 gdb_reinitialize_dir $srcdir
/$subdir
58 gdb_test
"file -readnow $binfile" \
59 "could not read '.gnu_debugaltlink' section" \