hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame elf/tst-rtld-preload.sh

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