1 ! Copyright (C) 2010 Erik Charlebois.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors combinators elf formatting io.mmap kernel sequences ;
6 : print-symbol ( sections symbol -- )
7 [ sym>> st_value>> "%016x " printf ]
11 { SHN_UNDEF [ drop "undefined" ] }
12 { SHN_ABS [ drop "absolute" ] }
13 { SHN_COMMON [ drop "common" ] }
15 } case "%-16s " printf
17 [ name>> "%s\n" printf ] tri ;
21 sections dup ".symtab" find-section
22 symbols [ name>> empty? ] reject
23 [ print-symbol ] with each