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