129ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard#! /bin/sh
229ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# Copyright (C) 2015 Red Hat, Inc.
329ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# This file is part of elfutils.
429ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard#
529ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# This file is free software; you can redistribute it and/or modify
629ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# it under the terms of the GNU General Public License as published by
729ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# the Free Software Foundation; either version 3 of the License, or
829ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# (at your option) any later version.
929ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard#
1029ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# elfutils is distributed in the hope that it will be useful, but
1129ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# WITHOUT ANY WARRANTY; without even the implied warranty of
1229ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1329ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# GNU General Public License for more details.
1429ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard#
1529ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# You should have received a copy of the GNU General Public License
1629ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# along with this program.  If not, see <http://www.gnu.org/licenses/>.
1729ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
1829ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard. $srcdir/test-subr.sh
1929ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
2029ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# Merge string tables of file and check result with elflint.
2129ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaardtestrun_elfcompress()
2229ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard{
2329ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    testfile="$1"
2429ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    testfiles ${testfile}
2529ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
2629ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    mergedfile="${testfile}.merged"
2729ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    tempfiles ${mergedfile}
2829ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
2929ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    echo "merging string tables ${testfile} -> ${mergedfile}"
3029ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    testrun ${abs_top_builddir}/tests/elfstrmerge -o ${mergedfile} ${testfile}
3129ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard    testrun ${abs_top_builddir}/src/elflint --gnu-ld ${mergedfile}
3229ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard}
3329ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
3429ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# Random ELF32 testfile with extra STT_SECTION symbols
3529ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaardtestrun_elfcompress testfile4
3629ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
3729ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard# Random ELF64 testfile with extra STT_SECTION symbols
3829ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaardtestrun_elfcompress testfile12
3929ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaard
4029ee512fb8a71b0d22065c369a2117ff758bdf5eMark Wielaardexit 0
41