Skip to content

Commit 2a7fcdc

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 dec848e commit 2a7fcdc

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
@@ -65,6 +65,18 @@
6565
otool -L "${f}"
6666
elif [ "${_OS}" = 'linux' ]; then
6767
"${_READELF}" --file-header --dynamic "${f}"
68+
# Show linked GLIBC versions
69+
# https://en.wikipedia.org/wiki/Glibc#Version_history
70+
if [ "${_CPU}" = 'a64' ]; then
71+
filter='@GLIBC_2\.(17|2[0-9])$' # Exclude: 2.17 (2012-12) and 2.2x (2019-02)
72+
else
73+
filter='@GLIBC_([0-9]+\.[0-9]+\.[0-9]+|2\.([0-9]|1[0-9]))$' # Exclude: x.y.z, 2.x, 2.1x (-2014-02)
74+
fi
75+
"${NM}" --dynamic --undefined-only "${f}" \
76+
| grep -E -v "${filter}" \
77+
| grep -E -o '@GLIBC_[0-9]+\.[0-9]+$' | sed 's/@GLIBC_//g' | sort -u -V || true
78+
"${NM}" --dynamic --undefined-only "${f}" \
79+
| grep -F '@GLIBC_' | grep -E -v "${filter}" || true
6880
fi
6981
fi
7082
done

0 commit comments

Comments
 (0)