Lines Matching refs:ehdr
810 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_purgatory_setup_kbuf()
814 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_kbuf()
874 sechdrs = vzalloc(array_size(sizeof(Elf_Shdr), pi->ehdr->e_shnum)); in kexec_purgatory_setup_sechdrs()
877 memcpy(sechdrs, (void *)pi->ehdr + pi->ehdr->e_shoff, in kexec_purgatory_setup_sechdrs()
878 pi->ehdr->e_shnum * sizeof(Elf_Shdr)); in kexec_purgatory_setup_sechdrs()
883 kbuf->image->start = pi->ehdr->e_entry; in kexec_purgatory_setup_sechdrs()
885 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_sechdrs()
913 pi->ehdr->e_entry >= sechdrs[i].sh_addr && in kexec_purgatory_setup_sechdrs()
914 pi->ehdr->e_entry < (sechdrs[i].sh_addr in kexec_purgatory_setup_sechdrs()
916 !WARN_ON(kbuf->image->start != pi->ehdr->e_entry)) { in kexec_purgatory_setup_sechdrs()
921 src = (void *)pi->ehdr + sechdrs[i].sh_offset; in kexec_purgatory_setup_sechdrs()
939 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_apply_relocations()
941 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_apply_relocations()
958 if (relsec->sh_info >= pi->ehdr->e_shnum || in kexec_apply_relocations()
959 relsec->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
972 if (symtab->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
1012 pi->ehdr = (const Elf_Ehdr *)kexec_purgatory; in kexec_load_purgatory()
1047 const Elf_Ehdr *ehdr; in kexec_purgatory_find_symbol() local
1052 if (!pi->ehdr) in kexec_purgatory_find_symbol()
1055 ehdr = pi->ehdr; in kexec_purgatory_find_symbol()
1056 sechdrs = (void *)ehdr + ehdr->e_shoff; in kexec_purgatory_find_symbol()
1058 for (i = 0; i < ehdr->e_shnum; i++) { in kexec_purgatory_find_symbol()
1062 if (sechdrs[i].sh_link >= ehdr->e_shnum) in kexec_purgatory_find_symbol()
1065 strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset; in kexec_purgatory_find_symbol()
1066 syms = (void *)ehdr + sechdrs[i].sh_offset; in kexec_purgatory_find_symbol()
1077 syms[k].st_shndx >= ehdr->e_shnum) { in kexec_purgatory_find_symbol()
1236 Elf64_Ehdr *ehdr; in crash_prepare_elf64_headers() local
1264 ehdr = (Elf64_Ehdr *)buf; in crash_prepare_elf64_headers()
1265 phdr = (Elf64_Phdr *)(ehdr + 1); in crash_prepare_elf64_headers()
1266 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); in crash_prepare_elf64_headers()
1267 ehdr->e_ident[EI_CLASS] = ELFCLASS64; in crash_prepare_elf64_headers()
1268 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in crash_prepare_elf64_headers()
1269 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in crash_prepare_elf64_headers()
1270 ehdr->e_ident[EI_OSABI] = ELF_OSABI; in crash_prepare_elf64_headers()
1271 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); in crash_prepare_elf64_headers()
1272 ehdr->e_type = ET_CORE; in crash_prepare_elf64_headers()
1273 ehdr->e_machine = ELF_ARCH; in crash_prepare_elf64_headers()
1274 ehdr->e_version = EV_CURRENT; in crash_prepare_elf64_headers()
1275 ehdr->e_phoff = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1276 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1277 ehdr->e_phentsize = sizeof(Elf64_Phdr); in crash_prepare_elf64_headers()
1285 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1293 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1303 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1320 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1323 ehdr->e_phnum, phdr->p_offset); in crash_prepare_elf64_headers()