10 while read value
type name
; do
11 if [ $value = "U" ]; then
13 # undefined symbols must start with double-underscore
14 if [ $
(expr $name : '\(..\)') != "__" ]; then
15 echo -e "$(basename $file):\tError: undefined reference $name doesn't start with \"__\"."
16 num_errors
=$
(($num_errors + 1))
23 entry_count
=$
(($entry_count + 1))
26 entry_count
=$
(($entry_count + 1))
27 if [ "$(expr $name : '\(..\)')" != "__" ]; then
28 global_count
=$
(($global_count + 1))
33 if [ $entry_count -gt 1 -a $global_count -gt 0 ]; then
34 echo -e "$(basename $file):\tError: detected $global_count strong " \
35 "global and $entry_count entry-points."
36 num_errors
=$
(($num_errors + 1))
42 size
=$
(readelf
-S $file | \
43 (sz
=0; while read line
; do
44 if echo $line | fgrep
-q " .rodata"; then
51 summands
=$
(readelf
-s $file | fgrep
" OBJECT " |
tr -s ' ' |
52 cut
-f4 -d' ' |
sed 's,$,+,')0
54 if [ $sum != $size ]; then
55 echo -e "$(basename $file):\tError: sum of objects=$sum bytes, .rodata size=$size bytes"
56 num_errors
=$
(($num_errors + 1))
59 tmp
=$
(tempfile
-p syms
)
65 echo "Note: 1 error expected in w_tgammal.o due to 64-byte alignment-padding."
66 while read func_pattern src_file dst_file
; do
67 if [ "$(expr $dst_file : '.*\(S\)$')" = "S" ]; then
68 objfile
=$
(expr $dst_file : '\(.*\)[.]S$')
69 check_file
$objdir/$objfile.o
74 do_checks
< import_file_list
76 if [ $num_errors -gt 0 ]; then
77 echo "FAILURE: Detected $num_errors error(s)."