c58f1213e628a545081c70e26c6b67a841cff880vboxsync# Copyright (C) 2006-2013 Oracle Corporation
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# available from http://www.virtualbox.org. This file is free software;
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# you can redistribute it and/or modify it under the terms of the GNU
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# General Public License (GPL) as published by the Free Software
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# Compare undefined symbols in a shared or static object against a new-line
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync# separated list of grep patterns in a set of text files and complain if
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync# symbols are found which aren't in the files.
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync# Usage: /bin/sh <script name> <object> [--static] <undefined symbol file...>
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync# Currently only works for native objects on Linux (and Solaris?) platforms.
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync echo $* 1>&2
71b3e8496ade32ed607650332283df431cd2ef9cvboxsyncif test ! -r "${target}"; then
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync if test ! -r "${i}"; then
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync echoerr "Usage: $0 <object> [--static] <undefined symbol file...>"
5fc54c9e295f53c39c7712ae45b17a0d77cb2a87vboxsync echoerr "$0: '$hostos' not a valid hostos string. supported 'linux' 'solaris'"
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsynccommand="-T"
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync command="-t"
71b3e8496ade32ed607650332283df431cd2ef9cvboxsyncif test ! -x "${objdumpbin}"; then
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync echoerr "${0}: '${objdumpbin}' not found or not executable."
71b3e8496ade32ed607650332283df431cd2ef9cvboxsyncundefined=`"${objdumpbin}" ${command} "${target}" | kmk_sed -n 's/.*\*UND\*.*\s\([:graph:]*\)/\1/p'`
f5a06c01933ba6df7cc373dcf5330e3a9d59a865vboxsync undefined=`echo "${undefined}" | "${grepbin}" -w -v -f "${i}"`
71b3e8496ade32ed607650332283df431cd2ef9cvboxsync echoerr "${0}: following symbols not defined in the files ${@}:"
d604c03c7ae485c94bccd5629e96f5c10da81467vboxsync# Return code