summaryrefslogtreecommitdiff
path: root/src/check-plt.sh
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-09-06 13:54:12 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-09-06 13:54:12 -0400
commitcd1b6650648b5a688b4b6c2d696d9434c824a13f (patch)
tree4242256df420d006f923f5a6b09d9224cfc16f08 /src/check-plt.sh
parent3d398b1a214a4e30806773a5198db0dace061608 (diff)
downloadcairo-cd1b6650648b5a688b4b6c2d696d9434c824a13f.tar.gz
Add scripts to sanity check the shared object for exported and PLT symbols
src/check-def.sh checks that the list of symbols exported is the same as the list of symbols in cairo.def, ie. symbols in public header files. (except for symbols starting with _cairo) src/check-plt.sh checks that no PLT entries exist for local function calls. This makes sure we keep the 'slim' annotations uptodate. These two are defined as tests in src/ and will be run during "make distcheck". However, they are skipped if the commands 'nm' and 'readelf' are not found. (We don't really rely on any functionality of eu-readelf, so using readelf proper which should be more commonlly installed.)
Diffstat (limited to 'src/check-plt.sh')
-rwxr-xr-xsrc/check-plt.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/check-plt.sh b/src/check-plt.sh
new file mode 100755
index 000000000..1dd90052a
--- /dev/null
+++ b/src/check-plt.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+LANG=C
+
+status=0
+
+if ! which readelf 2>/dev/null >/dev/null; then
+ echo "'readelf' not found; skipping test"
+ exit 0
+fi
+
+for so in .libs/lib*.so; do
+ echo Checking $so for local PLT entries
+ readelf -r $so | grep 'JU\?MP_SLOT' | grep 'cairo\|pixman' && status=1
+done
+
+exit $status