2007-09-26 14:46:41 +05:30
|
|
|
#!/bin/sh
|
2007-09-26 14:14:39 +05:30
|
|
|
|
|
|
|
top_srcdir=${top_srcdir:-../..}
|
2008-03-24 12:47:05 +05:30
|
|
|
. ${top_srcdir}/test/setup_env.sh
|
2008-03-24 12:00:21 +05:30
|
|
|
|
|
|
|
libeinfo_srcdir="${srcdir}/../libeinfo"
|
|
|
|
libeinfo_builddir="${builddir}/../libeinfo"
|
|
|
|
librc_srcdir="${srcdir}/../librc"
|
|
|
|
librc_builddir="${builddir}/../librc"
|
|
|
|
rc_srcdir="${srcdir}/../rc"
|
|
|
|
rc_builddir="${builddir}/../rc"
|
|
|
|
|
2007-09-26 14:14:39 +05:30
|
|
|
checkit() {
|
2007-11-28 21:15:03 +05:30
|
|
|
local base=$1; shift
|
2007-09-26 14:14:39 +05:30
|
|
|
echo "$@" | tr ' ' '\n' > ${base}.out
|
|
|
|
diff -u ${base}.list ${base}.out
|
|
|
|
eend $?
|
2007-09-26 14:46:41 +05:30
|
|
|
ret=$(($ret + $?))
|
2007-09-26 14:14:39 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
ret=0
|
|
|
|
|
|
|
|
ebegin "Checking exported symbols in libeinfo.so (data)"
|
|
|
|
checkit einfo.data $(
|
2008-03-24 12:00:21 +05:30
|
|
|
readelf -Ws ${libeinfo_builddir}/libeinfo.so \
|
2007-09-26 14:14:39 +05:30
|
|
|
| awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
|
|
|
|
| sort -u
|
|
|
|
)
|
|
|
|
|
|
|
|
ebegin "Checking exported symbols in libeinfo.so (functions)"
|
|
|
|
checkit einfo.funcs $(
|
2008-03-24 12:00:21 +05:30
|
|
|
readelf -Ws ${libeinfo_builddir}/libeinfo.so \
|
2007-09-26 14:14:39 +05:30
|
|
|
| awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
|
|
|
|
| sort -u \
|
|
|
|
| egrep -v \
|
|
|
|
-e '^_(init|fini)$'
|
|
|
|
)
|
|
|
|
|
|
|
|
ebegin "Checking exported symbols in librc.so (data)"
|
|
|
|
checkit rc.data $(
|
2008-03-24 12:00:21 +05:30
|
|
|
readelf -Ws ${librc_builddir}/librc.so \
|
2007-09-26 14:14:39 +05:30
|
|
|
| awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
|
|
|
|
| sort -u
|
|
|
|
)
|
|
|
|
|
|
|
|
ebegin "Checking exported symbols in librc.so (functions)"
|
|
|
|
checkit rc.funcs $(
|
2008-03-24 12:00:21 +05:30
|
|
|
readelf -Ws ${librc_builddir}/librc.so \
|
2007-09-26 14:14:39 +05:30
|
|
|
| awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
|
|
|
|
| sort -u \
|
|
|
|
| egrep -v \
|
|
|
|
-e '^_(init|fini)$'
|
|
|
|
)
|
|
|
|
|
|
|
|
ebegin "Checking hidden functions in librc.so"
|
2008-03-24 12:00:21 +05:30
|
|
|
sed -n '/^librc_hidden_proto/s:.*(\(.*\))$:\1:p' ${librc_srcdir}/librc.h \
|
2007-09-26 14:14:39 +05:30
|
|
|
| sort -u \
|
|
|
|
> librc.funcs.hidden.list
|
2008-03-24 12:00:21 +05:30
|
|
|
readelf -Wr $(grep -l '#include[[:space:]]"librc\.h"' ${librc_srcdir}/*.c | sed 's:\.c$:.o:') \
|
2007-09-26 14:14:39 +05:30
|
|
|
| awk '$5 ~ /^rc_/ {print $5}' \
|
|
|
|
| sort -u \
|
|
|
|
| egrep -v '^rc_environ_fd$' \
|
|
|
|
> librc.funcs.hidden.out
|
2007-09-26 14:46:41 +05:30
|
|
|
syms=$(diff -u librc.funcs.hidden.list librc.funcs.hidden.out | sed -n '/^+[^+]/s:^+::p')
|
|
|
|
[ -z "${syms}" ]
|
2007-09-26 14:14:39 +05:30
|
|
|
eend $? "Missing hidden defs:"$'\n'"${syms}"
|
2007-09-26 14:46:41 +05:30
|
|
|
ret=$(($ret + $?))
|
2007-09-26 14:14:39 +05:30
|
|
|
|
|
|
|
exit ${ret}
|