Blame elf/tst-rtld-preload.sh

Packit Service d36442
#!/bin/sh
Packit Service d36442
# Test --preload argument ld.so.
Packit Service d36442
# Copyright (C) 2019 Free Software Foundation, Inc.
Packit Service d36442
# This file is part of the GNU C Library.
Packit Service d36442
#
Packit Service d36442
# The GNU C Library is free software; you can redistribute it and/or
Packit Service d36442
# modify it under the terms of the GNU Lesser General Public
Packit Service d36442
# License as published by the Free Software Foundation; either
Packit Service d36442
# version 2.1 of the License, or (at your option) any later version.
Packit Service d36442
#
Packit Service d36442
# The GNU C Library is distributed in the hope that it will be useful,
Packit Service d36442
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service d36442
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service d36442
# Lesser General Public License for more details.
Packit Service d36442
#
Packit Service d36442
# You should have received a copy of the GNU Lesser General Public
Packit Service d36442
# License along with the GNU C Library; if not, see
Packit Service d36442
# <http://www.gnu.org/licenses/>.
Packit Service d36442
Packit Service d36442
set -e
Packit Service d36442
Packit Service d36442
rtld=$1
Packit Service d36442
test_program=$2
Packit Service d36442
test_wrapper=$3
Packit Service d36442
test_wrapper_env=$4
Packit Service d36442
run_program_env=$5
Packit Service d36442
library_path=$6
Packit Service d36442
preload=$7
Packit Service d36442
Packit Service d36442
echo "# [${test_wrapper}] [$rtld] [--library-path] [$library_path]" \
Packit Service d36442
     "[--preload] [$preload] [$test_program]"
Packit Service d36442
${test_wrapper_env} \
Packit Service d36442
${run_program_env} \
Packit Service d36442
${test_wrapper} $rtld --library-path "$library_path" \
Packit Service d36442
  --preload "$preload" $test_program 2>&1 && rc=0 || rc=$?
Packit Service d36442
echo "# exit status $rc"
Packit Service d36442
Packit Service d36442
exit $rc