Home
last modified time | relevance | path

Searched refs:ehdr (Results 1 – 14 of 14) sorted by relevance

/system/unwinding/libunwindstack/tests/
DMapInfoGetElfTest.cpp52 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()
84 Elf32_Ehdr ehdr; in TEST_F() local
85 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
[all …]
DElfTestUtils.cpp37 void TestInitEhdr(Ehdr* ehdr, uint32_t elf_class, uint32_t machine_type) { in TestInitEhdr() argument
38 memset(ehdr, 0, sizeof(Ehdr)); in TestInitEhdr()
39 memcpy(&ehdr->e_ident[0], ELFMAG, SELFMAG); in TestInitEhdr()
40 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in TestInitEhdr()
41 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in TestInitEhdr()
42 ehdr->e_ident[EI_OSABI] = ELFOSABI_SYSV; in TestInitEhdr()
43 ehdr->e_ident[EI_CLASS] = elf_class; in TestInitEhdr()
44 ehdr->e_type = ET_DYN; in TestInitEhdr()
45 ehdr->e_machine = machine_type; in TestInitEhdr()
46 ehdr->e_version = EV_CURRENT; in TestInitEhdr()
[all …]
DGenGnuDebugdata.cpp34 void InitEhdr(Ehdr* ehdr, uint32_t elf_class, uint32_t machine) { in InitEhdr() argument
35 memset(ehdr, 0, sizeof(Ehdr)); in InitEhdr()
36 memcpy(&ehdr->e_ident[0], ELFMAG, SELFMAG); in InitEhdr()
37 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; in InitEhdr()
38 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in InitEhdr()
39 ehdr->e_ident[EI_OSABI] = ELFOSABI_SYSV; in InitEhdr()
40 ehdr->e_ident[EI_CLASS] = elf_class; in InitEhdr()
41 ehdr->e_type = ET_DYN; in InitEhdr()
42 ehdr->e_machine = machine; in InitEhdr()
43 ehdr->e_version = EV_CURRENT; in InitEhdr()
[all …]
DElfInterfaceTest.cpp184 Ehdr ehdr = {}; in SinglePtLoad() local
185 ehdr.e_phoff = 0x100; in SinglePtLoad()
186 ehdr.e_phnum = 1; in SinglePtLoad()
187 ehdr.e_phentsize = sizeof(Phdr); in SinglePtLoad()
188 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in SinglePtLoad()
222 Ehdr ehdr = {}; in MultipleExecutablePtLoads() local
223 ehdr.e_phoff = 0x100; in MultipleExecutablePtLoads()
224 ehdr.e_phnum = 3; in MultipleExecutablePtLoads()
225 ehdr.e_phentsize = sizeof(Phdr); in MultipleExecutablePtLoads()
226 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in MultipleExecutablePtLoads()
[all …]
DMapInfoCreateMemoryTest.cpp49 Ehdr ehdr; in InitElf() local
50 memset(&ehdr, 0, sizeof(ehdr)); in InitElf()
51 memcpy(ehdr.e_ident, ELFMAG, SELFMAG); in InitElf()
52 ehdr.e_ident[EI_CLASS] = class_type; in InitElf()
53 ehdr.e_shoff = sh_offset; in InitElf()
54 ehdr.e_shentsize = sizeof(Shdr) + 100; in InitElf()
55 ehdr.e_shnum = 4; in InitElf()
56 memcpy(&buffer[file_offset], &ehdr, sizeof(ehdr)); in InitElf()
256 Elf32_Ehdr ehdr = {}; in TEST_F() local
257 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
[all …]
DMapInfoGetBuildIDTest.cpp135 Elf32_Ehdr ehdr; in InitElfData() local
136 TestInitEhdr(&ehdr, ELFCLASS32, EM_ARM); in InitElfData()
137 ehdr.e_shoff = 0x2000; in InitElfData()
138 ehdr.e_shnum = 3; in InitElfData()
139 ehdr.e_shentsize = sizeof(Elf32_Shdr); in InitElfData()
140 ehdr.e_shstrndx = 2; in InitElfData()
143 ASSERT_EQ(static_cast<ssize_t>(sizeof(ehdr)), write(fd, &ehdr, sizeof(ehdr))); in InitElfData()
161 offset += ehdr.e_shoff + sizeof(shdr); in InitElfData()
DElfTest.cpp49 Elf32_Ehdr ehdr; in InitElf32() local
50 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, machine_type); in InitElf32()
52 ehdr.e_phoff = 0x100; in InitElf32()
53 ehdr.e_ehsize = sizeof(ehdr); in InitElf32()
54 ehdr.e_phentsize = sizeof(Elf32_Phdr); in InitElf32()
55 ehdr.e_phnum = 1; in InitElf32()
56 ehdr.e_shentsize = sizeof(Elf32_Shdr); in InitElf32()
58 ehdr.e_flags = 0x5000200; in InitElf32()
59 ehdr.e_phnum = 2; in InitElf32()
61 memory_->SetMemory(0, &ehdr, sizeof(ehdr)); in InitElf32()
[all …]
DMapInfoGetLoadBiasTest.cpp132 Elf32_Ehdr ehdr; in InitElfData() local
133 TestInitEhdr(&ehdr, ELFCLASS32, EM_ARM); in InitElfData()
134 ehdr.e_phoff = 0x5000; in InitElfData()
135 ehdr.e_phnum = 2; in InitElfData()
136 ehdr.e_phentsize = sizeof(Elf32_Phdr); in InitElfData()
137 memory->SetMemory(offset, &ehdr, sizeof(ehdr)); in InitElfData()
DJitDebugTest.cpp94 EhdrType ehdr; in CreateElf() local
95 memset(&ehdr, 0, sizeof(ehdr)); in CreateElf()
96 uint64_t sh_offset = sizeof(ehdr); in CreateElf()
97 memcpy(ehdr.e_ident, ELFMAG, SELFMAG); in CreateElf()
98 ehdr.e_ident[EI_CLASS] = class_type; in CreateElf()
99 ehdr.e_machine = machine_type; in CreateElf()
100 ehdr.e_shstrndx = 1; in CreateElf()
101 ehdr.e_shoff = sh_offset; in CreateElf()
102 ehdr.e_shentsize = sizeof(ShdrType); in CreateElf()
103 ehdr.e_shnum = 4; in CreateElf()
[all …]
DElfTestUtils.h28 void TestInitEhdr(Ehdr* ehdr, uint32_t elf_class, uint32_t machine_type);
DUnwinderTest.cpp1684 Elf32_Ehdr ehdr = {}; in TEST_F() local
1685 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
1686 ehdr.e_phoff = 0x50; in TEST_F()
1687 ehdr.e_phnum = 1; in TEST_F()
1688 ehdr.e_phentsize = sizeof(Elf32_Phdr); in TEST_F()
1689 ehdr.e_shoff = 0x100; in TEST_F()
1690 ehdr.e_shstrndx = 1; in TEST_F()
1691 ehdr.e_shentsize = sizeof(Elf32_Shdr); in TEST_F()
1692 ehdr.e_shnum = 3; in TEST_F()
1693 memory_->SetMemory(0xf7000, &ehdr, sizeof(ehdr)); in TEST_F()
/system/unwinding/libunwindstack/
DElfInterface.cpp138 EhdrType ehdr; in ReadAllHeaders() local
139 if (!memory_->ReadFully(0, &ehdr, sizeof(ehdr))) { in ReadAllHeaders()
147 ReadProgramHeaders(ehdr, load_bias); in ReadAllHeaders()
148 ReadSectionHeaders(ehdr); in ReadAllHeaders()
154 EhdrType ehdr; in GetLoadBias() local
155 if (!memory->ReadFully(0, &ehdr, sizeof(ehdr))) { in GetLoadBias()
159 uint64_t offset = ehdr.e_phoff; in GetLoadBias()
160 for (size_t i = 0; i < ehdr.e_phnum; i++, offset += ehdr.e_phentsize) { in GetLoadBias()
175 void ElfInterfaceImpl<ElfTypes>::ReadProgramHeaders(const EhdrType& ehdr, int64_t* load_bias) { in ReadProgramHeaders() argument
176 uint64_t offset = ehdr.e_phoff; in ReadProgramHeaders()
[all …]
/system/unwinding/libunwindstack/tests/fuzz/
DUnwinderComponentCreator.cpp253 EhdrType ehdr; in PutElfInMemory() local
254 memset(&ehdr, 0, sizeof(ehdr)); in PutElfInMemory()
255 uint64_t sh_offset = sizeof(ehdr); in PutElfInMemory()
256 memcpy(ehdr.e_ident, ELFMAG, SELFMAG); in PutElfInMemory()
257 ehdr.e_ident[EI_CLASS] = class_type; in PutElfInMemory()
258 ehdr.e_machine = machine_type; in PutElfInMemory()
259 ehdr.e_shstrndx = 1; in PutElfInMemory()
260 ehdr.e_shoff = sh_offset; in PutElfInMemory()
261 ehdr.e_shentsize = sizeof(ShdrType); in PutElfInMemory()
262 ehdr.e_shnum = 3; in PutElfInMemory()
[all …]
/system/unwinding/libunwindstack/include/unwindstack/
DElfInterface.h217 void ReadProgramHeaders(const EhdrType& ehdr, int64_t* load_bias);
219 void ReadSectionHeaders(const EhdrType& ehdr);