Lines Matching refs:ehdr

102 static TEE_Result e32_parse_ehdr(struct ta_elf *elf, Elf32_Ehdr *ehdr)  in e32_parse_ehdr()  argument
104 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT || in e32_parse_ehdr()
105 ehdr->e_ident[EI_CLASS] != ELFCLASS32 || in e32_parse_ehdr()
106 ehdr->e_ident[EI_DATA] != ELFDATA2LSB || in e32_parse_ehdr()
107 ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE || in e32_parse_ehdr()
108 ehdr->e_type != ET_DYN || ehdr->e_machine != EM_ARM || in e32_parse_ehdr()
109 (ehdr->e_flags & EF_ARM_ABIMASK) != EF_ARM_ABI_VERSION || in e32_parse_ehdr()
111 (ehdr->e_flags & EF_ARM_ABI_FLOAT_HARD) || in e32_parse_ehdr()
113 ehdr->e_phentsize != sizeof(Elf32_Phdr) || in e32_parse_ehdr()
114 ehdr->e_shentsize != sizeof(Elf32_Shdr)) in e32_parse_ehdr()
118 elf->e_entry = ehdr->e_entry; in e32_parse_ehdr()
119 elf->e_phoff = ehdr->e_phoff; in e32_parse_ehdr()
120 elf->e_shoff = ehdr->e_shoff; in e32_parse_ehdr()
121 elf->e_phnum = ehdr->e_phnum; in e32_parse_ehdr()
122 elf->e_shnum = ehdr->e_shnum; in e32_parse_ehdr()
123 elf->e_phentsize = ehdr->e_phentsize; in e32_parse_ehdr()
124 elf->e_shentsize = ehdr->e_shentsize; in e32_parse_ehdr()
130 static TEE_Result e64_parse_ehdr(struct ta_elf *elf, Elf64_Ehdr *ehdr) in e64_parse_ehdr() argument
132 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT || in e64_parse_ehdr()
133 ehdr->e_ident[EI_CLASS] != ELFCLASS64 || in e64_parse_ehdr()
134 ehdr->e_ident[EI_DATA] != ELFDATA2LSB || in e64_parse_ehdr()
135 ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE || in e64_parse_ehdr()
136 ehdr->e_type != ET_DYN || ehdr->e_machine != EM_AARCH64 || in e64_parse_ehdr()
137 ehdr->e_flags || ehdr->e_phentsize != sizeof(Elf64_Phdr) || in e64_parse_ehdr()
138 ehdr->e_shentsize != sizeof(Elf64_Shdr)) in e64_parse_ehdr()
143 elf->e_entry = ehdr->e_entry; in e64_parse_ehdr()
144 elf->e_phoff = ehdr->e_phoff; in e64_parse_ehdr()
145 elf->e_shoff = ehdr->e_shoff; in e64_parse_ehdr()
146 elf->e_phnum = ehdr->e_phnum; in e64_parse_ehdr()
147 elf->e_shnum = ehdr->e_shnum; in e64_parse_ehdr()
148 elf->e_phentsize = ehdr->e_phentsize; in e64_parse_ehdr()
149 elf->e_shentsize = ehdr->e_shentsize; in e64_parse_ehdr()
155 Elf64_Ehdr *ehdr __unused) in e64_parse_ehdr()
164 Elf32_Ehdr *ehdr __unused) in e32_parse_ehdr()
169 static TEE_Result e64_parse_ehdr(struct ta_elf *elf, Elf64_Ehdr *ehdr) in e64_parse_ehdr() argument
171 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT || in e64_parse_ehdr()
172 ehdr->e_ident[EI_CLASS] != ELFCLASS64 || in e64_parse_ehdr()
173 ehdr->e_ident[EI_DATA] != ELFDATA2LSB || in e64_parse_ehdr()
174 ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE || in e64_parse_ehdr()
175 ehdr->e_type != ET_DYN || ehdr->e_machine != EM_RISCV || in e64_parse_ehdr()
176 ehdr->e_phentsize != sizeof(Elf64_Phdr) || in e64_parse_ehdr()
177 ehdr->e_shentsize != sizeof(Elf64_Shdr)) in e64_parse_ehdr()
181 elf->e_entry = ehdr->e_entry; in e64_parse_ehdr()
182 elf->e_phoff = ehdr->e_phoff; in e64_parse_ehdr()
183 elf->e_shoff = ehdr->e_shoff; in e64_parse_ehdr()
184 elf->e_phnum = ehdr->e_phnum; in e64_parse_ehdr()
185 elf->e_shnum = ehdr->e_shnum; in e64_parse_ehdr()
186 elf->e_phentsize = ehdr->e_phentsize; in e64_parse_ehdr()
187 elf->e_shentsize = ehdr->e_shentsize; in e64_parse_ehdr()