/[baselayout]/trunk/src/test/symbols.sh
Gentoo

Contents of /trunk/src/test/symbols.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2942 - (show annotations) (download) (as text)
Wed Sep 26 08:44:39 2007 UTC (7 years, 3 months ago) by vapier
File MIME type: text/x-sh
File size: 1772 byte(s)
add some tests to make sure our exported symbols are sane
1 #!/bin/bash
2
3 top_srcdir=${top_srcdir:-../..}
4 srcdir=${builddir:-..}
5 top_builddir=${top_srcdir:-../..}
6 builddir=${builddir:-..}
7
8 export LD_LIBRARY_PATH=${builddir}:${LD_LIBRARY_PATH}
9 export PATH=${builddir}:${PATH}
10 source ${top_srcdir}/sh/functions.sh
11
12 checkit() {
13 local base=$1 ; shift
14 echo "$@" | tr ' ' '\n' > ${base}.out
15 diff -u ${base}.list ${base}.out
16 eend $?
17 ((ret+=$?))
18 }
19
20 ret=0
21
22 ebegin "Checking exported symbols in libeinfo.so (data)"
23 checkit einfo.data $(
24 readelf -Ws ${builddir}/libeinfo.so \
25 | awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
26 | sort -u
27 )
28
29 ebegin "Checking exported symbols in libeinfo.so (functions)"
30 checkit einfo.funcs $(
31 readelf -Ws ${builddir}/libeinfo.so \
32 | awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
33 | sort -u \
34 | egrep -v \
35 -e '^_(init|fini)$'
36 )
37
38 ebegin "Checking exported symbols in librc.so (data)"
39 checkit rc.data $(
40 readelf -Ws ${builddir}/librc.so \
41 | awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
42 | sort -u
43 )
44
45 ebegin "Checking exported symbols in librc.so (functions)"
46 checkit rc.funcs $(
47 readelf -Ws ${builddir}/librc.so \
48 | awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
49 | sort -u \
50 | egrep -v \
51 -e '^_(init|fini)$'
52 )
53
54 ebegin "Checking hidden functions in librc.so"
55 sed -n '/^librc_hidden_proto/s:.*(\(.*\))$:\1:p' ../librc.h \
56 | sort -u \
57 > librc.funcs.hidden.list
58 readelf -Wr $(grep -l '#include[[:space:]]"librc\.h"' ${builddir}/*.c | sed 's:\.c$:.o:') \
59 | awk '$5 ~ /^rc_/ {print $5}' \
60 | sort -u \
61 | egrep -v '^rc_environ_fd$' \
62 > librc.funcs.hidden.out
63 syms=$(diff -u librc.funcs.hidden.{list,out} | sed -n '/^+[^+]/s:^+::p')
64 [[ -z ${syms} ]]
65 eend $? "Missing hidden defs:"$'\n'"${syms}"
66 ((ret+=$?))
67
68 exit ${ret}

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20