• Home
  • Raw
  • Download

Lines Matching refs:ehdr

52   static void InitElf(uint64_t sh_offset, Ehdr* ehdr, uint8_t class_type, uint8_t machine_type) {  in InitElf()  argument
53 memset(ehdr, 0, sizeof(*ehdr)); in InitElf()
54 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); in InitElf()
55 ehdr->e_ident[EI_CLASS] = class_type; in InitElf()
56 ehdr->e_machine = machine_type; in InitElf()
57 ehdr->e_shoff = sh_offset; in InitElf()
58 ehdr->e_shentsize = sizeof(Shdr) + 100; in InitElf()
59 ehdr->e_shnum = 4; in InitElf()
82 Elf32_Ehdr ehdr; in TEST_F() local
83 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
84 memory_->SetMemory(0x3000, &ehdr, sizeof(ehdr)); in TEST_F()
102 Elf64_Ehdr ehdr; in TEST_F() local
103 TestInitEhdr<Elf64_Ehdr>(&ehdr, ELFCLASS64, EM_AARCH64); in TEST_F()
104 memory_->SetMemory(0x8000, &ehdr, sizeof(ehdr)); in TEST_F()
116 Elf32_Ehdr ehdr; in TEST_F() local
117 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
118 memory_->SetMemory(0x3000, &ehdr, sizeof(ehdr)); in TEST_F()
160 Elf32_Ehdr ehdr; in TEST_F() local
161 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
162 ASSERT_TRUE(android::base::WriteFully(elf_.fd, &ehdr, sizeof(ehdr))); in TEST_F()
189 Elf32_Ehdr ehdr; in TEST_F() local
190 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
191 memcpy(buffer.data(), &ehdr, sizeof(ehdr)); in TEST_F()
203 ASSERT_EQ(0, memcmp(buffer.data(), &ehdr, sizeof(ehdr))); in TEST_F()
204 for (size_t i = sizeof(ehdr); i < buffer.size(); i++) { in TEST_F()
218 Elf32_Ehdr ehdr; in TEST_F() local
219 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
220 memcpy(&buffer[info.offset], &ehdr, sizeof(ehdr)); in TEST_F()
231 ASSERT_EQ(0, memcmp(buffer.data(), &ehdr, sizeof(ehdr))); in TEST_F()
232 for (size_t i = sizeof(ehdr); i < 0x1000; i++) { in TEST_F()
248 Elf32_Ehdr ehdr; in TEST_F() local
249 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
250 ehdr.e_shoff = 0x2000; in TEST_F()
251 ehdr.e_shentsize = sizeof(Elf32_Shdr) + 100; in TEST_F()
252 ehdr.e_shnum = 4; in TEST_F()
253 memcpy(&buffer[info.offset], &ehdr, sizeof(ehdr)); in TEST_F()
265 ASSERT_EQ(0, memcmp(buffer.data(), &ehdr, sizeof(ehdr))); in TEST_F()
276 Elf64_Ehdr ehdr; in TEST_F() local
277 TestInitEhdr<Elf64_Ehdr>(&ehdr, ELFCLASS64, EM_AARCH64); in TEST_F()
278 ehdr.e_shoff = 0x2000; in TEST_F()
279 ehdr.e_shentsize = sizeof(Elf64_Shdr) + 100; in TEST_F()
280 ehdr.e_shnum = 4; in TEST_F()
281 memcpy(&buffer[info.offset], &ehdr, sizeof(ehdr)); in TEST_F()
293 ASSERT_EQ(0, memcmp(buffer.data(), &ehdr, sizeof(ehdr))); in TEST_F()
305 Elf64_Ehdr ehdr; in TEST_F() local
306 TestInitEhdr<Elf64_Ehdr>(&ehdr, ELFCLASS64, EM_X86_64); in TEST_F()
307 ehdr.e_shoff = 0x2000; in TEST_F()
308 ehdr.e_shentsize = sizeof(Elf64_Shdr) + 100; in TEST_F()
309 ehdr.e_shnum = 0; in TEST_F()
310 memory_->SetMemory(0x7000, &ehdr, sizeof(ehdr)); in TEST_F()
332 Elf64_Ehdr ehdr; in TEST_F() local
333 TestInitEhdr<Elf64_Ehdr>(&ehdr, ELFCLASS64, EM_X86_64); in TEST_F()
334 ehdr.e_shoff = 0x2000; in TEST_F()
335 ehdr.e_shentsize = sizeof(Elf64_Shdr) + 100; in TEST_F()
336 ehdr.e_shnum = 0; in TEST_F()
337 memory_->SetMemory(0x7000, &ehdr, sizeof(ehdr)); in TEST_F()
379 Elf32_Ehdr ehdr; in TEST_F() local
380 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
381 memory_->SetMemory(0x2000, &ehdr, sizeof(ehdr)); in TEST_F()
395 Elf32_Ehdr ehdr; in TEST_F() local
396 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
397 memory_->SetMemory(0x1000, &ehdr, sizeof(ehdr)); in TEST_F()