Lines Matching refs:ehdr
840 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_purgatory_setup_kbuf()
844 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_kbuf()
904 sechdrs = vzalloc(array_size(sizeof(Elf_Shdr), pi->ehdr->e_shnum)); in kexec_purgatory_setup_sechdrs()
907 memcpy(sechdrs, (void *)pi->ehdr + pi->ehdr->e_shoff, in kexec_purgatory_setup_sechdrs()
908 pi->ehdr->e_shnum * sizeof(Elf_Shdr)); in kexec_purgatory_setup_sechdrs()
913 kbuf->image->start = pi->ehdr->e_entry; in kexec_purgatory_setup_sechdrs()
915 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_purgatory_setup_sechdrs()
932 pi->ehdr->e_entry >= sechdrs[i].sh_addr && in kexec_purgatory_setup_sechdrs()
933 pi->ehdr->e_entry < (sechdrs[i].sh_addr in kexec_purgatory_setup_sechdrs()
939 src = (void *)pi->ehdr + sechdrs[i].sh_offset; in kexec_purgatory_setup_sechdrs()
957 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_apply_relocations()
959 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_apply_relocations()
976 if (relsec->sh_info >= pi->ehdr->e_shnum || in kexec_apply_relocations()
977 relsec->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
990 if (symtab->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
1030 pi->ehdr = (const Elf_Ehdr *)kexec_purgatory; in kexec_load_purgatory()
1065 const Elf_Ehdr *ehdr; in kexec_purgatory_find_symbol() local
1070 if (!pi->ehdr) in kexec_purgatory_find_symbol()
1073 ehdr = pi->ehdr; in kexec_purgatory_find_symbol()
1074 sechdrs = (void *)ehdr + ehdr->e_shoff; in kexec_purgatory_find_symbol()
1076 for (i = 0; i < ehdr->e_shnum; i++) { in kexec_purgatory_find_symbol()
1080 if (sechdrs[i].sh_link >= ehdr->e_shnum) in kexec_purgatory_find_symbol()
1083 strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset; in kexec_purgatory_find_symbol()
1084 syms = (void *)ehdr + sechdrs[i].sh_offset; in kexec_purgatory_find_symbol()
1095 syms[k].st_shndx >= ehdr->e_shnum) { in kexec_purgatory_find_symbol()
1254 Elf64_Ehdr *ehdr; in crash_prepare_elf64_headers() local
1282 ehdr = (Elf64_Ehdr *)buf; in crash_prepare_elf64_headers()
1283 phdr = (Elf64_Phdr *)(ehdr + 1); in crash_prepare_elf64_headers()
1284 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); in crash_prepare_elf64_headers()
1285 ehdr->e_ident[EI_CLASS] = ELFCLASS64; in crash_prepare_elf64_headers()
1286 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in crash_prepare_elf64_headers()
1287 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in crash_prepare_elf64_headers()
1288 ehdr->e_ident[EI_OSABI] = ELF_OSABI; in crash_prepare_elf64_headers()
1289 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); in crash_prepare_elf64_headers()
1290 ehdr->e_type = ET_CORE; in crash_prepare_elf64_headers()
1291 ehdr->e_machine = ELF_ARCH; in crash_prepare_elf64_headers()
1292 ehdr->e_version = EV_CURRENT; in crash_prepare_elf64_headers()
1293 ehdr->e_phoff = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1294 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1295 ehdr->e_phentsize = sizeof(Elf64_Phdr); in crash_prepare_elf64_headers()
1303 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1311 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1321 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1338 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1341 ehdr->e_phnum, phdr->p_offset); in crash_prepare_elf64_headers()