2 # Copyright (C) 2015 Red Hat, Inc.
3 # This file is part of elfutils.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # elfutils is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 . $srcdir/test-subr.sh
25 # .type testfunc, @function
26 # .size testfunc, .-testfunc
34 # .type testfunc2, @function
35 # .size testfunc2, .-testfunc2
45 # .type functest3, @function
46 # .size functest3, .-functest3
69 # .type _start, @function
70 # .size _start, .-_start
72 # gas --compress-debug-sections=zlib-gnu -32 -g -o start.o start.s
73 # gas --compress-debug-sections=zlib-gnu -32 -g -o funcs.o funcs.s
74 # ld --compress-debug-sections=zlib-gnu -melf_i386 -g -o zgnu32 funcs.o start.o
76 # gas --compress-debug-sections=zlib-gnu -64 -g -o start.o start.s
77 # gas --compress-debug-sections=zlib-gnu -64 -g -o funcs.o funcs.s
78 # ld --compress-debug-sections=zlib-gnu -g -o zgnu64 funcs.o start.o
80 # gas --compress-debug-sections=zlib-gabi -32 -g -o start.o start.s
81 # gas --compress-debug-sections=zlib-gabi -32 -g -o funcs.o funcs.s
82 # ld --compress-debug-sections=zlib-gabi -melf_i386 -g -o zgabi32 funcs.o start.o
84 # gas --compress-debug-sections=zlib-gabi -64 -g -o start.o start.s
85 # gas --compress-debug-sections=zlib-gabi -64 -g -o funcs.o funcs.s
86 # ld --compress-debug-sections=zlib-gabi -g -o zgabi64 funcs.o start.o
88 testfiles testfile-zgnu64
89 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgnu64 <<\EOF
90 section 1: NOT Compressed
91 section 2: GNU Compressed size: 60
92 section 3: GNU Compressed size: aa
93 section 4: NOT Compressed
94 section 5: GNU Compressed size: 8d
95 section 6: NOT Compressed
96 section 7: NOT Compressed
97 section 8: NOT Compressed
100 testfiles testfile-zgabi64
101 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgabi64 <<\EOF
102 section 1: NOT Compressed
103 section 2: ELF Compressed ch_type: 1, ch_size: 60, ch_addralign: 10
104 section 3: ELF Compressed ch_type: 1, ch_size: aa, ch_addralign: 1
105 section 4: NOT Compressed
106 section 5: ELF Compressed ch_type: 1, ch_size: 8d, ch_addralign: 1
107 section 6: NOT Compressed
108 section 7: NOT Compressed
109 section 8: NOT Compressed
112 testfiles testfile-zgnu32
113 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgnu32 <<\EOF
114 section 1: NOT Compressed
115 section 2: GNU Compressed size: 40
116 section 3: GNU Compressed size: 9a
117 section 4: NOT Compressed
118 section 5: GNU Compressed size: 85
119 section 6: NOT Compressed
120 section 7: NOT Compressed
121 section 8: NOT Compressed
124 testfiles testfile-zgabi32
125 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgabi32 <<\EOF
126 section 1: NOT Compressed
127 section 2: ELF Compressed ch_type: 1, ch_size: 40, ch_addralign: 8
128 section 3: ELF Compressed ch_type: 1, ch_size: 9a, ch_addralign: 1
129 section 4: NOT Compressed
130 section 5: ELF Compressed ch_type: 1, ch_size: 85, ch_addralign: 1
131 section 6: NOT Compressed
132 section 7: NOT Compressed
133 section 8: NOT Compressed
136 testfiles testfile-zgnu64be
137 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgnu64be <<\EOF
138 section 1: NOT Compressed
139 section 2: NOT Compressed
140 section 3: GNU Compressed size: 60
141 section 4: GNU Compressed size: 7e
142 section 5: NOT Compressed
143 section 6: GNU Compressed size: 8d
144 section 7: NOT Compressed
145 section 8: NOT Compressed
146 section 9: NOT Compressed
149 testfiles testfile-zgabi64be
150 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgabi64be <<\EOF
151 section 1: NOT Compressed
152 section 2: NOT Compressed
153 section 3: ELF Compressed ch_type: 1, ch_size: 60, ch_addralign: 10
154 section 4: ELF Compressed ch_type: 1, ch_size: 7e, ch_addralign: 1
155 section 5: NOT Compressed
156 section 6: ELF Compressed ch_type: 1, ch_size: 8d, ch_addralign: 1
157 section 7: NOT Compressed
158 section 8: NOT Compressed
159 section 9: NOT Compressed
162 testfiles testfile-zgnu32be
163 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgnu32be <<\EOF
164 section 1: NOT Compressed
165 section 2: NOT Compressed
166 section 3: GNU Compressed size: 40
167 section 4: GNU Compressed size: 6e
168 section 5: NOT Compressed
169 section 6: GNU Compressed size: 85
170 section 7: NOT Compressed
171 section 8: NOT Compressed
172 section 9: NOT Compressed
175 testfiles testfile-zgabi32be
176 testrun_compare ${abs_top_builddir}/tests/elfgetchdr testfile-zgabi32be <<\EOF
177 section 1: NOT Compressed
178 section 2: NOT Compressed
179 section 3: ELF Compressed ch_type: 1, ch_size: 40, ch_addralign: 8
180 section 4: ELF Compressed ch_type: 1, ch_size: 6e, ch_addralign: 1
181 section 5: NOT Compressed
182 section 6: ELF Compressed ch_type: 1, ch_size: 85, ch_addralign: 1
183 section 7: NOT Compressed
184 section 8: NOT Compressed
185 section 9: NOT Compressed