2013-01-18 19:56:10 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
list_leaked_symbols () {
|
2020-11-11 09:50:31 +01:00
|
|
|
nm -D "$1" | grep ' T ' | cut -f 3 -d ' ' | grep -E -v "$2"
|
2013-01-18 19:56:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
check_symbols () {
|
2020-11-11 09:50:31 +01:00
|
|
|
if [ "$(list_leaked_symbols "$1" "$2" | wc -l)" -ne 0 ]; then
|
2013-01-18 19:56:10 +01:00
|
|
|
echo File "$1" possibly leaking symbols:
|
|
|
|
list_leaked_symbols "$1" "$2"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-04-13 12:02:24 +02:00
|
|
|
allowed="^_init$|^_fini$|^_ftext$|^g_"
|
2013-01-18 19:56:10 +01:00
|
|
|
allowed_in_libglib="${allowed}|^glib__private__$|^glib_gettext$|^glib_pgettext$|^glib_check_version$"
|
2013-04-13 12:02:24 +02:00
|
|
|
allowed_in_libgthread='^_init$|^_fini$|^_ftext$|^g_thread_init$|^g_thread_init_with_errorcheck_mutexes$'
|
2013-01-18 19:56:10 +01:00
|
|
|
|
|
|
|
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
|