1 # Expect script for ELF compressed debug section tests.
2 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 # Exclude non-ELF targets.
28 # The following tests require running the executable generated by ld.
33 # Check if compiler works
34 if { [which $CC] == 0 } {
39 if { ![ld_assemble $as "--compress-debug-sections $srcdir/$subdir/empty.s" tmpdir/empty.o ] } {
40 fail "linker compressed debug sections"
43 if { ![ld_assemble $as "--compress-debug-sections=zlib-gabi $srcdir/$subdir/empty.s" tmpdir/emptyzlib.o ] } {
44 fail "linker compressed debug sections"
48 {"Build libfoo.so with compressed debug sections"
49 "-shared" "-fPIC -g -Wa,--compress-debug-sections"
50 {foo.c} {} "libfoo.so"}
51 {"Build libbar.so with compressed debug sections"
52 "-shared" "-fPIC -g -Wa,--compress-debug-sections"
53 {begin.c end.c} {} "libbar.so"}
54 {"Build libfoozlib.so with compressed debug sections with zlib-gabi"
55 "-shared" "-fPIC -g -Wa,--compress-debug-sections=zlib-gabi"
56 {foo.c} {} "libfoozlib.so"}
57 {"Build libbarzlib.so with compressed debug sections with zlib-gabi"
58 "-shared" "-fPIC -g -Wa,--compress-debug-sections=zlib-gabi"
59 {begin.c end.c} {} "libbarzlib.so"}
63 {"Run normal with libfoo.so with compressed debug sections"
64 "tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" ""
65 {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections"}
66 {"Run normal with libfoo.so with compressed debug sections with zlib-gabi"
67 "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" ""
68 {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"}
71 run_cc_link_tests $build_tests
72 run_ld_link_exec_tests [] $run_tests
74 set test_name "Link with zlib-gabi compressed debug input"
75 send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n"
76 if { [catch {exec cmp tmpdir/libfoo.so tmpdir/libfoozlib.so}] } then {
77 send_log "tmpdir/libfoo.so tmpdir/libfoozlib.so differ.\n"