Skip to content

Commit c158208

Browse files
committed
curl-pkg.sh: show linked glibc versions for linux target
And the actual list of functions affected. Avoid `--with-symbol-versions` option. It's the default with llvm-nm-13 and also with the binutils nm in Debian bullseye.
1 parent f0a9253 commit c158208

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

curl-pkg.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@
7575
otool -L "${f}"
7676
elif [ "${_OS}" = 'linux' ]; then
7777
"${_READELF}" --file-header --dynamic "${f}"
78+
# Show linked GLIBC versions
79+
# https://en.wikipedia.org/wiki/Glibc#Version_history
80+
if [ "${_CPU}" = 'a64' ]; then
81+
filter='@GLIBC_2\.(17|2[0-9])$' # Exclude: 2.17 (2012-12) and 2.2x (2019-02)
82+
else
83+
filter='@GLIBC_([0-9]+\.[0-9]+\.[0-9]+|2\.([0-9]|1[0-9]))$' # Exclude: x.y.z, 2.x, 2.1x (-2014-02)
84+
fi
85+
"${NM}" --dynamic --undefined-only "${f}" \
86+
| grep -E -v "${filter}" \
87+
| grep -E -o '@GLIBC_[0-9]+\.[0-9]+$' | sed 's/@GLIBC_//g' | sort -u -V || true
88+
"${NM}" --dynamic --undefined-only "${f}" \
89+
| grep -F '@GLIBC_' | grep -E -v "${filter}" || true
7890
fi
7991
fi
8092
done

0 commit comments

Comments
 (0)