Skip to content

Commit

Permalink
_info-bin.sh: allowlist some symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Oct 16, 2024
1 parent 4c7c9ff commit 72b111f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions _info-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ while [ -n "${1:-}" ]; do
if [ "${is_curl}" = '1' ] && [ "${filetype}" != 'exe' ]; then # Verify exported curl symbols
"${NM}" --extern-only --defined-only "${f}" # -g -U
"${NM}" --extern-only --defined-only "${f}" | grep -a -F ' _curl_' | sort || false # -g -U
echo '---------------------------------------'
echo '---------------------------------------'
"${NM}" --extern-only --defined-only "${f}" | grep -a -F -v ' T _curl_' && false # should not export anything else except the libcurl API
echo '---------------------------------------'
echo '---------------------------------------'
fi
elif [ "${_OS}" = 'linux' ]; then
# NOTE: objdump -syms (-t) to show symbol visibility flags
Expand Down Expand Up @@ -115,11 +111,10 @@ while [ -n "${1:-}" ]; do
if [ "${filetype}" != 'exe' ]; then # Verify exported curl symbols
"${NM}" --dynamic --defined-only "${f}" # -D -U
"${NM}" --dynamic --defined-only "${f}" | grep -a -F ' curl_' | sort || false # -D -U
echo '---------------------------------------'
echo '---------------------------------------'
"${NM}" --dynamic --defined-only "${f}" | grep -a -F -v ' T curl_' && false # should not export anything else except the libcurl API
echo '---------------------------------------'
echo '---------------------------------------'
# Allowlist:
# - MUSL: _fini, _init
# - ?: _start, _start_c
"${NM}" --dynamic --defined-only "${f}" | grep -a -E -v ' T (curl_|(_fini|_init|_start|_start_c)$)' && false || true # FIXME: should not export anything else except the libcurl API
fi
# nm -D -g = --dynamic --extern-only
fi
Expand Down

0 comments on commit 72b111f

Please sign in to comment.