You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fnrec.sh 1022B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2010 Stefan Hajnoczi <stefanha@gmail.com>.
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License as
  7. # published by the Free Software Foundation; either version 2 of the
  8. # License, or any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. if [ $# != 2 ]
  19. then
  20. cat >&2 <<EOF
  21. usage: $0 <elf-binary> <addresses-file>
  22. Look up symbol names in <elf-binary> for function addresses from
  23. <addresses-file>.
  24. Example:
  25. $0 bin/ipxe.hd.tmp fnrec.dat
  26. EOF
  27. exit 1
  28. fi
  29. tr ' ' '\n' <"$2" | addr2line -fe "$1" | awk '(NR % 2) { print }'