]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/tst-ldconfig-soname.sh
malloc: set NON_MAIN_ARENA flag for reclaimed memalign chunk (BZ #30101)
[thirdparty/glibc.git] / elf / tst-ldconfig-soname.sh
CommitLineData
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
22set -ex
23
24common_objpfx=$1
25test_wrapper_env=$2
26run_program_env=$3
27
28testroot="${common_objpfx}elf/bug30125-test-directory"
29cleanup () {
30 rm -rf "$testroot"
31}
32trap cleanup 0
33
34rm -rf "$testroot"
35mkdir -p $testroot/lib
36cp "${common_objpfx}elf/tst-ldconfig-soname-lib-with-soname.so" \
37 $testroot/lib/libtst-ldconfig-soname-lib-with-soname.so.1.2.3
38cp "${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
45LINKS=$(cd $testroot/lib && find . -type l)
46if [ "$LINKS" != "./libtst-ldconfig-soname-lib-with-soname.so.1" ]; then
47 echo "error: $0 - extra symlinks found"
48 exit 1
49fi