Lines Matching refs:ehdr

847 	sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff;  in kexec_purgatory_setup_kbuf()
851 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_kbuf()
911 sechdrs = vzalloc(array_size(sizeof(Elf_Shdr), pi->ehdr->e_shnum)); in kexec_purgatory_setup_sechdrs()
914 memcpy(sechdrs, (void *)pi->ehdr + pi->ehdr->e_shoff, in kexec_purgatory_setup_sechdrs()
915 pi->ehdr->e_shnum * sizeof(Elf_Shdr)); in kexec_purgatory_setup_sechdrs()
920 kbuf->image->start = pi->ehdr->e_entry; in kexec_purgatory_setup_sechdrs()
922 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_sechdrs()
939 pi->ehdr->e_entry >= sechdrs[i].sh_addr && in kexec_purgatory_setup_sechdrs()
940 pi->ehdr->e_entry < (sechdrs[i].sh_addr in kexec_purgatory_setup_sechdrs()
946 src = (void *)pi->ehdr + sechdrs[i].sh_offset; in kexec_purgatory_setup_sechdrs()
964 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_apply_relocations()
966 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_apply_relocations()
983 if (relsec->sh_info >= pi->ehdr->e_shnum || in kexec_apply_relocations()
984 relsec->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
997 if (symtab->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
1037 pi->ehdr = (const Elf_Ehdr *)kexec_purgatory; in kexec_load_purgatory()
1072 const Elf_Ehdr *ehdr; in kexec_purgatory_find_symbol() local
1077 if (!pi->ehdr) in kexec_purgatory_find_symbol()
1080 ehdr = pi->ehdr; in kexec_purgatory_find_symbol()
1081 sechdrs = (void *)ehdr + ehdr->e_shoff; in kexec_purgatory_find_symbol()
1083 for (i = 0; i < ehdr->e_shnum; i++) { in kexec_purgatory_find_symbol()
1087 if (sechdrs[i].sh_link >= ehdr->e_shnum) in kexec_purgatory_find_symbol()
1090 strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset; in kexec_purgatory_find_symbol()
1091 syms = (void *)ehdr + sechdrs[i].sh_offset; in kexec_purgatory_find_symbol()
1102 syms[k].st_shndx >= ehdr->e_shnum) { in kexec_purgatory_find_symbol()
1261 Elf64_Ehdr *ehdr; in crash_prepare_elf64_headers() local
1289 ehdr = (Elf64_Ehdr *)buf; in crash_prepare_elf64_headers()
1290 phdr = (Elf64_Phdr *)(ehdr + 1); in crash_prepare_elf64_headers()
1291 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); in crash_prepare_elf64_headers()
1292 ehdr->e_ident[EI_CLASS] = ELFCLASS64; in crash_prepare_elf64_headers()
1293 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in crash_prepare_elf64_headers()
1294 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in crash_prepare_elf64_headers()
1295 ehdr->e_ident[EI_OSABI] = ELF_OSABI; in crash_prepare_elf64_headers()
1296 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); in crash_prepare_elf64_headers()
1297 ehdr->e_type = ET_CORE; in crash_prepare_elf64_headers()
1298 ehdr->e_machine = ELF_ARCH; in crash_prepare_elf64_headers()
1299 ehdr->e_version = EV_CURRENT; in crash_prepare_elf64_headers()
1300 ehdr->e_phoff = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1301 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1302 ehdr->e_phentsize = sizeof(Elf64_Phdr); in crash_prepare_elf64_headers()
1310 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1318 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1328 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1345 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1348 ehdr->e_phnum, phdr->p_offset); in crash_prepare_elf64_headers()