size.sh 422 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # get the symbol table, grep for ssfn stuff, convert more spaces to one with
  3. # while+read, then add the 3rd coloumn (size), finally display the last sum
  4. function getsize
  5. {
  6. readelf -s $1 | grep ssfn_$2 | while read line; do
  7. sum=$[$sum+`echo $line | cut -d ' ' -f 3`]
  8. echo $sum bytes
  9. done | tail -1
  10. }
  11. echo -n "Simple renderer: "
  12. getsize sfntest1 putc
  13. echo -n "Normal renderer: "
  14. getsize sfntest2