]>
Commit | Line | Data |
---|---|---|
1b0ea8c5 JB |
1 | #!/bin/sh |
2 | # Test that ldconfig creates symlinks according to the library's soname | |
3 | # (and in particular, does not create symlinks for libraries without a soname) | |
4 | # Copyright (C) 2000-2023 Free Software Foundation, Inc. | |
5 | # Copyright The GNU Toolchain Authors. | |
6 | # This file is part of the GNU C Library. | |
7 | ||
8 | # The GNU C Library is free software; you can redistribute it and/or | |
9 | # modify it under the terms of the GNU Lesser General Public | |
10 | # License as published by the Free Software Foundation; either | |
11 | # version 2.1 of the License, or (at your option) any later version. | |
12 | ||
13 | # The GNU C Library is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # Lesser General Public License for more details. | |
17 | ||
18 | # You should have received a copy of the GNU Lesser General Public | |
19 | # License along with the GNU C Library; if not, see | |
20 | # <https://www.gnu.org/licenses/>. | |
21 | ||
22 | set -ex | |
23 | ||
24 | common_objpfx=$1 | |
25 | test_wrapper_env=$2 | |
26 | run_program_env=$3 | |
27 | ||
28 | testroot="${common_objpfx}elf/bug30125-test-directory" | |
29 | cleanup () { | |
30 | rm -rf "$testroot" | |
31 | } | |
32 | trap cleanup 0 | |
33 | ||
34 | rm -rf "$testroot" | |
35 | mkdir -p $testroot/lib | |
36 | cp "${common_objpfx}elf/tst-ldconfig-soname-lib-with-soname.so" \ | |
37 | $testroot/lib/libtst-ldconfig-soname-lib-with-soname.so.1.2.3 | |
38 | cp "${common_objpfx}elf/tst-ldconfig-soname-lib-without-soname.so" \ | |
39 | $testroot/lib/libtst-ldconfig-soname-lib-without-soname.so.1.2.3 | |
40 | ||
41 | ${test_wrapper_env} \ | |
42 | ${run_program_env} \ | |
43 | ${common_objpfx}elf/ldconfig -vn $testroot/lib | |
44 | ||
45 | LINKS=$(cd $testroot/lib && find . -type l) | |
46 | if [ "$LINKS" != "./libtst-ldconfig-soname-lib-with-soname.so.1" ]; then | |
47 | echo "error: $0 - extra symlinks found" | |
48 | exit 1 | |
49 | fi |