Path: blob/main/Mk/Scripts/check_have_symbols.sh
16460 views
#!/bin/sh12set -eu34# the 3 implementations of readelf we can use have different output, but they all have a similarity5# for the .gnu.version_d section they all have the symbol version in last element of their output6# and have "Name:" or "vda_name": in the 10th position, no other section displayed have this7# it means that if there are no symbols exported then nothing matches this search pattern.89STAGEDIR=$110shift11ret=012failed=""13for lib; do14if ! /usr/bin/readelf -V ${STAGEDIR}$lib | awk 'BEGIN { ret=1 } $10 == "Name:" || $10 == "vda_name:" { ret=0; exit 0 } END { exit ret }'; then15ret=116failed="${failed} ${lib}"17fi18done19if [ "$failed" != "" ]; then20echo "the following libraries are supposed to have symbols versioning but they don't" >&221for l in ${failed}; do22echo "- $l" >&223done24fi25exit $ret262728