1 #! /bin/sh 2 # Copyright (C) 2018 Red Hat, Inc. 3 # This file is part of elfutils. 4 # 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. 9 # 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. 14 # 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/>. 17 18 . $srcdir/test-subr.sh 19 20 # Generated on s390x with an older gas (2.29.1) that generates 21 # badly aligned version notes. 22 # 23 # = testfile-version.s = 24 # 25 # .section ".extra" 26 # .byte 42 27 # 28 # .version "Sliding Snow" 29 # .version "Hurr durr 3.1" 30 # 31 # .globl _start 32 #_start: 33 # 34 # gcc -nostartfiles -nodefaultlibs -o testfile-version testfile-version.s 35 36 testfiles testfile-version 37 tempfiles debug.out elf.out 38 39 testrun ${abs_top_builddir}/src/strip -o elf.out -f debug.out \ 40 testfile-version 41 42 testrun ${abs_top_builddir}/src/elflint --gnu elf.out 43 testrun ${abs_top_builddir}/src/elflint --gnu --debug debug.out 44 45 testrun_compare ${abs_top_builddir}/src/readelf -n debug.out <<\EOF 46 47 Note section [ 1] '.note.gnu.build-id' of 36 bytes at offset 0xb0: 48 Owner Data size Type 49 GNU 20 GNU_BUILD_ID 50 Build ID: d3c84c0b307c06f50a37c6c0f59c82c4cb10720b 51 52 Note section [ 3] '.note' of 56 bytes at offset 0xd5: 53 Owner Data size Type 54 Sliding Snow 0 VERSION 55 Hurr durr 3.1 0 VERSION 56 EOF 57 58 exit 0 59