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()
902 pi->ehdr->e_entry >= sechdrs[i].sh_addr && in kexec_purgatory_setup_sechdrs()
903 pi->ehdr->e_entry < (sechdrs[i].sh_addr in kexec_purgatory_setup_sechdrs()
909 src = (void *)pi->ehdr + sechdrs[i].sh_offset; in kexec_purgatory_setup_sechdrs()
927 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_apply_relocations()
929 for (i = 0; i < pi->ehdr->e_shnum; i++) { in kexec_apply_relocations()
946 if (relsec->sh_info >= pi->ehdr->e_shnum || in kexec_apply_relocations()
947 relsec->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
960 if (symtab->sh_link >= pi->ehdr->e_shnum) in kexec_apply_relocations()
1000 pi->ehdr = (const Elf_Ehdr *)kexec_purgatory; in kexec_load_purgatory()
1035 const Elf_Ehdr *ehdr; in kexec_purgatory_find_symbol() local
1040 if (!pi->ehdr) in kexec_purgatory_find_symbol()
1043 ehdr = pi->ehdr; in kexec_purgatory_find_symbol()
1044 sechdrs = (void *)ehdr + ehdr->e_shoff; in kexec_purgatory_find_symbol()
1046 for (i = 0; i < ehdr->e_shnum; i++) { in kexec_purgatory_find_symbol()
1050 if (sechdrs[i].sh_link >= ehdr->e_shnum) in kexec_purgatory_find_symbol()
1053 strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset; in kexec_purgatory_find_symbol()
1054 syms = (void *)ehdr + sechdrs[i].sh_offset; in kexec_purgatory_find_symbol()
1065 syms[k].st_shndx >= ehdr->e_shnum) { in kexec_purgatory_find_symbol()
1224 Elf64_Ehdr *ehdr; in crash_prepare_elf64_headers() local
1252 ehdr = (Elf64_Ehdr *)buf; in crash_prepare_elf64_headers()
1253 phdr = (Elf64_Phdr *)(ehdr + 1); in crash_prepare_elf64_headers()
1254 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); in crash_prepare_elf64_headers()
1255 ehdr->e_ident[EI_CLASS] = ELFCLASS64; in crash_prepare_elf64_headers()
1256 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in crash_prepare_elf64_headers()
1257 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in crash_prepare_elf64_headers()
1258 ehdr->e_ident[EI_OSABI] = ELF_OSABI; in crash_prepare_elf64_headers()
1259 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); in crash_prepare_elf64_headers()
1260 ehdr->e_type = ET_CORE; in crash_prepare_elf64_headers()
1261 ehdr->e_machine = ELF_ARCH; in crash_prepare_elf64_headers()
1262 ehdr->e_version = EV_CURRENT; in crash_prepare_elf64_headers()
1263 ehdr->e_phoff = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1264 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in crash_prepare_elf64_headers()
1265 ehdr->e_phentsize = sizeof(Elf64_Phdr); in crash_prepare_elf64_headers()
1273 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1281 (ehdr->e_phnum)++; in crash_prepare_elf64_headers()
1291 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1308 ehdr->e_phnum++; in crash_prepare_elf64_headers()
1311 ehdr->e_phnum, phdr->p_offset); in crash_prepare_elf64_headers()