Home | History | Annotate | Download | only in pbsdboot

Lines Matching defs:elf

1 /*	$NetBSD: elf.c,v 1.9 2007/03/05 21:05:01 dogcow Exp $	*/
131 Elf_Ehdr elfx, *elf = &elfx;
146 if (read(fd, (void*)elf, sizeof(Elf_Ehdr)) != sizeof(Elf_Ehdr)) {
152 if ((phtbl = (Elf_Phdr *)alloc(sizeof(*phtbl) * elf->e_phnum)) == NULL ||
153 (shtbl = (Elf_Shdr *)alloc(sizeof(*shtbl) * elf->e_shnum)) == NULL) {
159 if (lseek(fd, elf->e_phoff, SEEK_SET) == -1) {
164 if (read(fd, (void *)phtbl, sizeof(Elf_Phdr) * elf->e_phnum)
165 != (int)(sizeof(Elf_Phdr) * elf->e_phnum)) {
171 if (lseek(fd, elf->e_shoff, SEEK_SET) == -1) {
176 if (read(fd, (void *)shtbl, sizeof(Elf_Shdr) * elf->e_shnum)
177 != (int)(sizeof(Elf_Shdr) * elf->e_shnum)) {
189 for (i = 0; i < elf->e_phnum; i++) {
235 elf->e_entry, min_addr, max_addr);
245 for (i = 0; i < elf->e_shnum; i++) {
263 memcpy(dbg_eh.e_ident, elf->e_ident,
264 sizeof(elf->e_ident));
265 dbg_eh.e_machine = elf->e_machine;
266 dbg_eh.e_version = elf->e_version;
270 dbg_eh.e_flags = elf->e_flags;
349 if (phtbl) dealloc(phtbl, sizeof(*phtbl) * elf->e_phnum);
350 if (shtbl) dealloc(shtbl, sizeof(*shtbl) * elf->e_shnum);
354 if (entry) *entry = (void *)elf->e_entry;
358 if (phtbl) dealloc(phtbl, sizeof(*phtbl) * elf->e_phnum);
359 if (shtbl) dealloc(shtbl, sizeof(*shtbl) * elf->e_shnum);