1 /* 2 * The elfdump function and the return value 3 */ 4 5 struct elf_entry { 6 const char *name; 7 u_int64_t value; 8 u_int64_t size; 9 }; 10 11 /* 12 * The return value is a struct with appeneded the storage for strings 13 * and the matched entries. It is allocated by the function and must be 14 * freebd by the caller. 15 */ 16 struct elfdump_info { 17 int count; 18 struct elf_entry m[0]; /* 'count' entries */ 19 }; 20 21 /* flags values */ 22 #define ED_DYN (1<<0) 23 #define ED_EHDR (1<<1) 24 #define ED_GOT (1<<2) 25 #define ED_HASH (1<<3) 26 #define ED_INTERP (1<<4) 27 #define ED_NOTE (1<<5) 28 #define ED_PHDR (1<<6) 29 #define ED_REL (1<<7) 30 #define ED_SHDR (1<<8) 31 #define ED_SYMTAB (1<<9) 32 #define ED_ALL ((1<<10)-1) 33 34 struct elfdump_info *elfdump(u_int flags, const char* fn, const char *syms); 35