Blame tests/run-dwelfgnucompressed.sh

Packit 032894
#! /bin/sh
Packit 032894
# Copyright (C) 2015 Red Hat, Inc.
Packit 032894
# This file is part of elfutils.
Packit 032894
#
Packit 032894
# This file is free software; you can redistribute it and/or modify
Packit 032894
# it under the terms of the GNU General Public License as published by
Packit 032894
# the Free Software Foundation; either version 3 of the License, or
Packit 032894
# (at your option) any later version.
Packit 032894
#
Packit 032894
# elfutils is distributed in the hope that it will be useful, but
Packit 032894
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 032894
# GNU General Public License for more details.
Packit 032894
#
Packit 032894
# You should have received a copy of the GNU General Public License
Packit 032894
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 032894
Packit 032894
. $srcdir/test-subr.sh
Packit 032894
Packit 032894
# = funcs.s =
Packit 032894
# .globl testfunc
Packit 032894
# testfunc:
Packit 032894
# 	nop
Packit 032894
# 	ret
Packit 032894
# .type testfunc, @function
Packit 032894
# .size testfunc, .-testfunc
Packit 032894
#
Packit 032894
# .globl testfunc2
Packit 032894
# testfunc2:
Packit 032894
# 	call testfunc
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	ret
Packit 032894
# .type testfunc2, @function
Packit 032894
# .size testfunc2, .-testfunc2
Packit 032894
#
Packit 032894
# .globl functest3
Packit 032894
# functest3:
Packit 032894
# 	jmp local
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# local:
Packit 032894
# 	call testfunc2
Packit 032894
# 	ret
Packit 032894
# .type functest3, @function
Packit 032894
# .size functest3, .-functest3
Packit 032894
Packit 032894
# = start.s =
Packit 032894
# .global _start
Packit 032894
# _start:
Packit 032894
# 	call functest3
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	nop
Packit 032894
# 	ret
Packit 032894
# .type _start, @function
Packit 032894
# .size _start, .-_start
Packit 032894
Packit 032894
# gas --compress-debug-sections=zlib-gnu -32 -g -o start.o start.s
Packit 032894
# gas --compress-debug-sections=zlib-gnu -32 -g -o funcs.o funcs.s
Packit 032894
# ld --compress-debug-sections=zlib-gnu -melf_i386 -g -o zgnu32 funcs.o start.o
Packit 032894
Packit 032894
# gas --compress-debug-sections=zlib-gnu -64 -g -o start.o start.s
Packit 032894
# gas --compress-debug-sections=zlib-gnu -64 -g -o funcs.o funcs.s
Packit 032894
# ld --compress-debug-sections=zlib-gnu -g -o zgnu32 funcs.o start.o
Packit 032894
Packit 032894
testfiles testfile-zgnu64
Packit 032894
testrun_compare ${abs_top_builddir}/tests/dwelfgnucompressed testfile-zgnu64 <<\EOF
Packit 032894
section 2: GNU Compressed size: 60
Packit 032894
section 3: GNU Compressed size: aa
Packit 032894
section 5: GNU Compressed size: 8d
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgnu64be
Packit 032894
testrun_compare ${abs_top_builddir}/tests/dwelfgnucompressed testfile-zgnu64be <<\EOF
Packit 032894
section 3: GNU Compressed size: 60
Packit 032894
section 4: GNU Compressed size: 7e
Packit 032894
section 6: GNU Compressed size: 8d
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgnu32
Packit 032894
testrun_compare ${abs_top_builddir}/tests/dwelfgnucompressed testfile-zgnu32 <<\EOF
Packit 032894
section 2: GNU Compressed size: 40
Packit 032894
section 3: GNU Compressed size: 9a
Packit 032894
section 5: GNU Compressed size: 85
Packit 032894
EOF
Packit 032894
Packit 032894
testfiles testfile-zgnu32be
Packit 032894
testrun_compare ${abs_top_builddir}/tests/dwelfgnucompressed testfile-zgnu32be <<\EOF
Packit 032894
section 3: GNU Compressed size: 40
Packit 032894
section 4: GNU Compressed size: 6e
Packit 032894
section 6: GNU Compressed size: 85
Packit 032894
EOF
Packit 032894
Packit 032894
exit 0