Lines Matching refs:ehdr
101 static TEE_Result e32_parse_ehdr(struct ta_elf *elf, Elf32_Ehdr *ehdr) in e32_parse_ehdr() argument
103 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT || in e32_parse_ehdr()
104 ehdr->e_ident[EI_CLASS] != ELFCLASS32 || in e32_parse_ehdr()
105 ehdr->e_ident[EI_DATA] != ELFDATA2LSB || in e32_parse_ehdr()
106 (ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE && in e32_parse_ehdr()
107 ehdr->e_ident[EI_OSABI] != ELFOSABI_ARM) || in e32_parse_ehdr()
108 ehdr->e_type != ET_DYN || ehdr->e_machine != EM_ARM || in e32_parse_ehdr()
110 (ehdr->e_flags & EF_ARM_ABI_FLOAT_HARD) || in e32_parse_ehdr()
112 ehdr->e_phentsize != sizeof(Elf32_Phdr) || in e32_parse_ehdr()
113 ehdr->e_shentsize != sizeof(Elf32_Shdr)) in e32_parse_ehdr()
116 if (ehdr->e_ident[EI_OSABI] == ELFOSABI_NONE && in e32_parse_ehdr()
117 (ehdr->e_flags & EF_ARM_ABIMASK) != EF_ARM_ABI_V5) in e32_parse_ehdr()
120 if (ehdr->e_ident[EI_OSABI] == ELFOSABI_ARM && in e32_parse_ehdr()
121 (ehdr->e_flags & EF_ARM_ABIMASK) != EF_ARM_ABI_UNKNOWN) in e32_parse_ehdr()
125 elf->e_entry = ehdr->e_entry; in e32_parse_ehdr()
126 elf->e_phoff = ehdr->e_phoff; in e32_parse_ehdr()
127 elf->e_shoff = ehdr->e_shoff; in e32_parse_ehdr()
128 elf->e_phnum = ehdr->e_phnum; in e32_parse_ehdr()
129 elf->e_shnum = ehdr->e_shnum; in e32_parse_ehdr()
130 elf->e_phentsize = ehdr->e_phentsize; in e32_parse_ehdr()
131 elf->e_shentsize = ehdr->e_shentsize; in e32_parse_ehdr()
137 static TEE_Result e64_parse_ehdr(struct ta_elf *elf, Elf64_Ehdr *ehdr) in e64_parse_ehdr() argument
139 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT || in e64_parse_ehdr()
140 ehdr->e_ident[EI_CLASS] != ELFCLASS64 || in e64_parse_ehdr()
141 ehdr->e_ident[EI_DATA] != ELFDATA2LSB || in e64_parse_ehdr()
142 ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE || in e64_parse_ehdr()
143 ehdr->e_type != ET_DYN || ehdr->e_machine != EM_AARCH64 || in e64_parse_ehdr()
144 ehdr->e_flags || ehdr->e_phentsize != sizeof(Elf64_Phdr) || in e64_parse_ehdr()
145 ehdr->e_shentsize != sizeof(Elf64_Shdr)) in e64_parse_ehdr()
150 elf->e_entry = ehdr->e_entry; in e64_parse_ehdr()
151 elf->e_phoff = ehdr->e_phoff; in e64_parse_ehdr()
152 elf->e_shoff = ehdr->e_shoff; in e64_parse_ehdr()
153 elf->e_phnum = ehdr->e_phnum; in e64_parse_ehdr()
154 elf->e_shnum = ehdr->e_shnum; in e64_parse_ehdr()
155 elf->e_phentsize = ehdr->e_phentsize; in e64_parse_ehdr()
156 elf->e_shentsize = ehdr->e_shentsize; in e64_parse_ehdr()
162 Elf64_Ehdr *ehdr __unused) in e64_parse_ehdr()
171 Elf32_Ehdr *ehdr __unused) in e32_parse_ehdr()
176 static TEE_Result e64_parse_ehdr(struct ta_elf *elf, Elf64_Ehdr *ehdr) in e64_parse_ehdr() argument
178 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT || in e64_parse_ehdr()
179 ehdr->e_ident[EI_CLASS] != ELFCLASS64 || in e64_parse_ehdr()
180 ehdr->e_ident[EI_DATA] != ELFDATA2LSB || in e64_parse_ehdr()
181 ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE || in e64_parse_ehdr()
182 ehdr->e_type != ET_DYN || ehdr->e_machine != EM_RISCV || in e64_parse_ehdr()
183 ehdr->e_phentsize != sizeof(Elf64_Phdr) || in e64_parse_ehdr()
184 ehdr->e_shentsize != sizeof(Elf64_Shdr)) in e64_parse_ehdr()
188 elf->e_entry = ehdr->e_entry; in e64_parse_ehdr()
189 elf->e_phoff = ehdr->e_phoff; in e64_parse_ehdr()
190 elf->e_shoff = ehdr->e_shoff; in e64_parse_ehdr()
191 elf->e_phnum = ehdr->e_phnum; in e64_parse_ehdr()
192 elf->e_shnum = ehdr->e_shnum; in e64_parse_ehdr()
193 elf->e_phentsize = ehdr->e_phentsize; in e64_parse_ehdr()
194 elf->e_shentsize = ehdr->e_shentsize; in e64_parse_ehdr()