Lines Matching refs:ehdr
63 Elf64_Ehdr *ehdr = (Elf64_Ehdr *)payload_start; in elf_check() local
65 if (ehdr->e_machine != EM_RISCV) { in elf_check()
67 EM_RISCV, ehdr->e_machine); in elf_check()
83 Elf64_Ehdr **ehdr) in elf_get_header() argument
88 *ehdr = (Elf64_Ehdr *)payload_start; in elf_get_header()
92 static void print_elf_info(Elf64_Ehdr *ehdr) in print_elf_info() argument
95 efi_printk(" e_type: %d\n", ehdr->e_type); in print_elf_info()
96 efi_printk(" e_machine: %d\n", ehdr->e_machine); in print_elf_info()
97 efi_printk(" e_version: %d\n", ehdr->e_version); in print_elf_info()
98 efi_printk(" e_entry: %p\n", ehdr->e_entry); in print_elf_info()
99 efi_printk(" e_phoff: %p\n", ehdr->e_phoff); in print_elf_info()
100 efi_printk(" e_shoff: %p\n", ehdr->e_shoff); in print_elf_info()
101 efi_printk(" e_flags: %d\n", ehdr->e_flags); in print_elf_info()
102 efi_printk(" e_ehsize: %d\n", ehdr->e_ehsize); in print_elf_info()
103 efi_printk(" e_phentsize: %d\n", ehdr->e_phentsize); in print_elf_info()
104 efi_printk(" e_phnum: %d\n", ehdr->e_phnum); in print_elf_info()
105 efi_printk(" e_shentsize: %d\n", ehdr->e_shentsize); in print_elf_info()
106 efi_printk(" e_shnum: %d\n", ehdr->e_shnum); in print_elf_info()
107 efi_printk(" e_shstrndx: %d\n", ehdr->e_shstrndx); in print_elf_info()
111 const Elf64_Ehdr *ehdr, u32 *ret_segments_nr, in parse_phdrs() argument
114 if (ehdr->e_phnum == 0) { in parse_phdrs()
118 if (ehdr->e_phentsize != sizeof(Elf64_Phdr)) { in parse_phdrs()
120 ehdr->e_phentsize, sizeof(Elf64_Phdr)); in parse_phdrs()
124 u16 phnum = ehdr->e_phnum; in parse_phdrs()
126 u64 shoff = ehdr->e_shoff; in parse_phdrs()
146 size_t phoff = ehdr->e_phoff; in parse_phdrs()
147 size_t phsize = ehdr->e_phentsize; in parse_phdrs()
410 Elf64_Ehdr *ehdr = NULL; in load_elf() local
412 elf_get_header(payload_start, payload_size, &ehdr); in load_elf()
417 ASSERT(ehdr != NULL); in load_elf()
419 print_elf_info(ehdr); in load_elf()
424 status = parse_phdrs(payload_start, payload_size, ehdr, &phdrs_nr, in load_elf()
443 ehdr->e_entry - image_link_base_vaddr + program_paddr; in load_elf()
447 efi_info("ehdr->e_entry: %lx\n", ehdr->e_entry); in load_elf()