Lines Matching refs:ehdr
852 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_purgatory_setup_kbuf()
856 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_kbuf()
916 sechdrs = vzalloc(array_size(sizeof(Elf_Shdr), pi->ehdr->e_shnum)); in kexec_purgatory_setup_sechdrs()
919 memcpy(sechdrs, (void *)pi->ehdr + pi->ehdr->e_shoff, in kexec_purgatory_setup_sechdrs()
920 pi->ehdr->e_shnum * sizeof(Elf_Shdr)); in kexec_purgatory_setup_sechdrs()
925 kbuf->image->start = pi->ehdr->e_entry; in kexec_purgatory_setup_sechdrs()
927 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_sechdrs()
944 pi->ehdr->e_entry >= sechdrs[i].sh_addr && in kexec_purgatory_setup_sechdrs()
945 pi->ehdr->e_entry < (sechdrs[i].sh_addr in kexec_purgatory_setup_sechdrs()
951 src = (void *)pi->ehdr + sechdrs[i].sh_offset; in kexec_purgatory_setup_sechdrs()
969 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_apply_relocations()
971 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_apply_relocations()
988 if (relsec->sh_info >= pi->ehdr->e_shnum || in kexec_apply_relocations()
989 relsec->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
1002 if (symtab->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
1042 pi->ehdr = (const Elf_Ehdr *)kexec_purgatory; in kexec_load_purgatory()
1077 const Elf_Ehdr *ehdr; in kexec_purgatory_find_symbol() local
1082 if (!pi->ehdr) in kexec_purgatory_find_symbol()
1085 ehdr = pi->ehdr; in kexec_purgatory_find_symbol()
1086 sechdrs = (void *)ehdr + ehdr->e_shoff; in kexec_purgatory_find_symbol()
1088 for (i = 0; i < ehdr->e_shnum; i++) { in kexec_purgatory_find_symbol()
1092 if (sechdrs[i].sh_link >= ehdr->e_shnum) in kexec_purgatory_find_symbol()
1095 strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset; in kexec_purgatory_find_symbol()
1096 syms = (void *)ehdr + sechdrs[i].sh_offset; in kexec_purgatory_find_symbol()
1107 syms[k].st_shndx >= ehdr->e_shnum) { in kexec_purgatory_find_symbol()
1266 Elf64_Ehdr *ehdr; in crash_prepare_elf64_headers() local
1294 ehdr = (Elf64_Ehdr *)buf; in crash_prepare_elf64_headers()
1295 phdr = (Elf64_Phdr *)(ehdr + 1); in crash_prepare_elf64_headers()
1296 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); in crash_prepare_elf64_headers()
1297 ehdr->e_ident[EI_CLASS] = ELFCLASS64; in crash_prepare_elf64_headers()
1298 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in crash_prepare_elf64_headers()
1299 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in crash_prepare_elf64_headers()
1300 ehdr->e_ident[EI_OSABI] = ELF_OSABI; in crash_prepare_elf64_headers()
1301 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); in crash_prepare_elf64_headers()
1302 ehdr->e_type = ET_CORE; in crash_prepare_elf64_headers()
1303 ehdr->e_machine = ELF_ARCH; in crash_prepare_elf64_headers()
1304 ehdr->e_version = EV_CURRENT; in crash_prepare_elf64_headers()
1305 ehdr->e_phoff = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1306 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1307 ehdr->e_phentsize = sizeof(Elf64_Phdr); in crash_prepare_elf64_headers()
1315 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1323 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1333 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1350 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1353 ehdr->e_phnum, phdr->p_offset); in crash_prepare_elf64_headers()