3 # Copyright (C) 2021 Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
20 # CHK_LIBC_OBJ -- a script to scan the .o's in an output directory,
21 # which is one of ../{intel-S2,sparc-S2,intel-Linux,sparc-Linux}
23 # usage: cd to the output directory, and invoke ../src/CHK_LIBC_OBJ
27 logF
="nm.`basename $1`.log"
28 if [ `uname` = 'Linux' ]; then
29 nm
$1 |
grep -v GLIBC_
> ${logF}
34 FUNC_LIST
="strcpy strlcpy strncpy strcat strlcat strncat strncmp strlen \
35 strerror strchr strrchr strpbrk strstr strtok strtok_r \
36 printf fprintf sprintf snprintf asprintf wsprintf \
37 vprintf vfprintf vsprintf vsnprintf vasprintf \
38 memset memcmp memcpy strtol strtoll strtoul strtoull \
39 getcpuid calloc malloc free strdup"
41 echo " -- Checking Object file '$1' for functions from libc"
42 for j
in `echo ${FUNC_LIST}` ; do
43 grep -w ${j} ${logF} |
grep UNDEF
> grep.log
2>&1
58 if [ ${res} -eq 0 ]; then
59 echo "Object file ${i} does not reference functions in libc"
61 echo "======Object file: ${i} DOES reference functions in libc"
63 if [ ${STATUS} -eq 0 ]; then
72 if [ ${res} -eq 0 ]; then
73 echo "Object file ${i} does not reference functions in libc"
75 echo "======Object file: ${i} DOES reference functions in libc"
77 if [ ${STATUS} -eq 0 ]; then