Lines Matching full:hdr
68 static unsigned long get_offset_from_address(Elf_Ehdr *hdr, unsigned long addr) in get_offset_from_address() argument
73 x = (void *)hdr + hdr->e_shoff; in get_offset_from_address()
74 if (hdr->e_shnum == SHN_UNDEF) in get_offset_from_address()
77 num_sections = hdr->e_shnum; in get_offset_from_address()
93 static void get_symbol_from_map(Elf_Ehdr *hdr, FILE *f, char *name, in get_symbol_from_map() argument
128 s->offset = get_offset_from_address(hdr, s->address); in get_symbol_from_map()
130 s->content = (void *)hdr + s->offset; in get_symbol_from_map()
133 static Elf_Sym *find_elf_symbol(Elf_Ehdr *hdr, Elf_Shdr *symtab, char *name) in find_elf_symbol() argument
141 x = (void *)hdr + hdr->e_shoff; in find_elf_symbol()
143 symtab_start = (void *)hdr + symtab->sh_offset; in find_elf_symbol()
145 strtab = (void *)hdr + x[link].sh_offset; in find_elf_symbol()
157 static void get_symbol_from_table(Elf_Ehdr *hdr, Elf_Shdr *symtab, in get_symbol_from_table() argument
165 x = (void *)hdr + hdr->e_shoff; in get_symbol_from_table()
169 elf_sym = find_elf_symbol(hdr, symtab, name); in get_symbol_from_table()
181 s->content = (void *)hdr + s->offset; in get_symbol_from_table()
184 static Elf_Shdr *get_symbol_table(Elf_Ehdr *hdr) in get_symbol_table() argument
189 x = (void *)hdr + hdr->e_shoff; in get_symbol_table()
190 if (hdr->e_shnum == SHN_UNDEF) in get_symbol_table()
193 num_sections = hdr->e_shnum; in get_symbol_table()
260 static void print_sym(Elf_Ehdr *hdr, struct sym *s) in print_sym() argument
280 Elf_Ehdr *hdr; in main() local
314 hdr = map_file(vmlinux_file, &vmlinux_size); in main()
315 if (!hdr) in main()
318 if (vmlinux_size < sizeof(*hdr)) { in main()
323 if ((hdr->e_ident[EI_MAG0] != ELFMAG0) || in main()
324 (hdr->e_ident[EI_MAG1] != ELFMAG1) || in main()
325 (hdr->e_ident[EI_MAG2] != ELFMAG2) || in main()
326 (hdr->e_ident[EI_MAG3] != ELFMAG3)) { in main()
331 if (hdr->e_ident[EI_CLASS] != CURRENT_ELFCLASS) { in main()
336 if (hdr->e_ident[EI_DATA] != endianness()) { in main()
341 if (hdr->e_shoff > vmlinux_size) { in main()
346 symtab = get_symbol_table(hdr); in main()
360 get_symbol_from_map(hdr, system_map, CERT_SYM, &cert_sym); in main()
361 get_symbol_from_map(hdr, system_map, USED_SYM, &used_sym); in main()
362 get_symbol_from_map(hdr, system_map, LSIZE_SYM, &lsize_sym); in main()
368 get_symbol_from_table(hdr, symtab, CERT_SYM, &cert_sym); in main()
369 get_symbol_from_table(hdr, symtab, USED_SYM, &used_sym); in main()
370 get_symbol_from_table(hdr, symtab, LSIZE_SYM, &lsize_sym); in main()
376 print_sym(hdr, &cert_sym); in main()
377 print_sym(hdr, &used_sym); in main()
378 print_sym(hdr, &lsize_sym); in main()