From 7a569f675a8253185f919345d984097397b74172 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 May 2022 13:06:22 +0100 Subject: tools: Move check-abis.sh from top-level to tools directory This tidies up the root directory a bit. Signed-off-by: Philip Withnall --- tools/check-abis.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tools/check-abis.sh (limited to 'tools') diff --git a/tools/check-abis.sh b/tools/check-abis.sh new file mode 100755 index 000000000..5340f317d --- /dev/null +++ b/tools/check-abis.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +list_leaked_symbols () { + nm -D "$1" | grep ' T ' | cut -f 3 -d ' ' | grep -E -v "$2" +} + +check_symbols () { + if [ "$(list_leaked_symbols "$1" "$2" | wc -l)" -ne 0 ]; then + echo File "$1" possibly leaking symbols: + list_leaked_symbols "$1" "$2" + exit 1 + fi +} + +allowed="^_init$|^_fini$|^_ftext$|^g_" +allowed_in_libglib="${allowed}|^glib__private__$|^glib_gettext$|^glib_pgettext$|^glib_check_version$" +allowed_in_libgthread='^_init$|^_fini$|^_ftext$|^g_thread_init$|^g_thread_init_with_errorcheck_mutexes$' + +check_symbols glib/.libs/libglib-2.0.so "$allowed_in_libglib" +check_symbols gthread/.libs/libgthread-2.0.so "$allowed_in_libgthread" +for file in gmodule/.libs/libgmodule-2.0.so gobject/.libs/libgobject-2.0.so gio/.libs/libgio-2.0.so; do + check_symbols "$file" "$allowed" +done -- cgit v1.2.1