Skip to content

Commit 72b111f

Browse files
committed
_info-bin.sh: allowlist some symbols
1 parent 4c7c9ff commit 72b111f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

_info-bin.sh

+4-9
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ while [ -n "${1:-}" ]; do
7373
if [ "${is_curl}" = '1' ] && [ "${filetype}" != 'exe' ]; then # Verify exported curl symbols
7474
"${NM}" --extern-only --defined-only "${f}" # -g -U
7575
"${NM}" --extern-only --defined-only "${f}" | grep -a -F ' _curl_' | sort || false # -g -U
76-
echo '---------------------------------------'
77-
echo '---------------------------------------'
7876
"${NM}" --extern-only --defined-only "${f}" | grep -a -F -v ' T _curl_' && false # should not export anything else except the libcurl API
79-
echo '---------------------------------------'
80-
echo '---------------------------------------'
8177
fi
8278
elif [ "${_OS}" = 'linux' ]; then
8379
# NOTE: objdump -syms (-t) to show symbol visibility flags
@@ -115,11 +111,10 @@ while [ -n "${1:-}" ]; do
115111
if [ "${filetype}" != 'exe' ]; then # Verify exported curl symbols
116112
"${NM}" --dynamic --defined-only "${f}" # -D -U
117113
"${NM}" --dynamic --defined-only "${f}" | grep -a -F ' curl_' | sort || false # -D -U
118-
echo '---------------------------------------'
119-
echo '---------------------------------------'
120-
"${NM}" --dynamic --defined-only "${f}" | grep -a -F -v ' T curl_' && false # should not export anything else except the libcurl API
121-
echo '---------------------------------------'
122-
echo '---------------------------------------'
114+
# Allowlist:
115+
# - MUSL: _fini, _init
116+
# - ?: _start, _start_c
117+
"${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
123118
fi
124119
# nm -D -g = --dynamic --extern-only
125120
fi

0 commit comments

Comments
 (0)