Home
last modified time | relevance | path

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

/system/core/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()
82 Elf32_Ehdr ehdr; in TEST_F() local
83 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.cpp155 Ehdr ehdr = {}; in SinglePtLoad() local
156 ehdr.e_phoff = 0x100; in SinglePtLoad()
157 ehdr.e_phnum = 1; in SinglePtLoad()
158 ehdr.e_phentsize = sizeof(Phdr); in SinglePtLoad()
159 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in SinglePtLoad()
193 Ehdr ehdr = {}; in MultipleExecutablePtLoads() local
194 ehdr.e_phoff = 0x100; in MultipleExecutablePtLoads()
195 ehdr.e_phnum = 3; in MultipleExecutablePtLoads()
196 ehdr.e_phentsize = sizeof(Phdr); in MultipleExecutablePtLoads()
197 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()
261 Elf32_Ehdr ehdr = {}; in TEST_F() local
262 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, EM_ARM); in TEST_F()
[all …]
DMapInfoGetBuildIDTest.cpp132 Elf32_Ehdr ehdr; in InitElfData() local
133 TestInitEhdr(&ehdr, ELFCLASS32, EM_ARM); in InitElfData()
134 ehdr.e_shoff = 0x2000; in InitElfData()
135 ehdr.e_shnum = 3; in InitElfData()
136 ehdr.e_shentsize = sizeof(Elf32_Shdr); in InitElfData()
137 ehdr.e_shstrndx = 2; in InitElfData()
140 ASSERT_EQ(static_cast<ssize_t>(sizeof(ehdr)), write(fd, &ehdr, sizeof(ehdr))); in InitElfData()
159 offset += ehdr.e_shoff + sizeof(shdr); in InitElfData()
DElfTest.cpp48 Elf32_Ehdr ehdr; in InitElf32() local
49 TestInitEhdr<Elf32_Ehdr>(&ehdr, ELFCLASS32, machine_type); in InitElf32()
51 ehdr.e_phoff = 0x100; in InitElf32()
52 ehdr.e_ehsize = sizeof(ehdr); in InitElf32()
53 ehdr.e_phentsize = sizeof(Elf32_Phdr); in InitElf32()
54 ehdr.e_phnum = 1; in InitElf32()
55 ehdr.e_shentsize = sizeof(Elf32_Shdr); in InitElf32()
57 ehdr.e_flags = 0x5000200; in InitElf32()
58 ehdr.e_phnum = 2; in InitElf32()
60 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.cpp88 EhdrType ehdr; in CreateElf() local
89 memset(&ehdr, 0, sizeof(ehdr)); in CreateElf()
90 uint64_t sh_offset = sizeof(ehdr); in CreateElf()
91 memcpy(ehdr.e_ident, ELFMAG, SELFMAG); in CreateElf()
92 ehdr.e_ident[EI_CLASS] = class_type; in CreateElf()
93 ehdr.e_machine = machine_type; in CreateElf()
94 ehdr.e_shstrndx = 1; in CreateElf()
95 ehdr.e_shoff = sh_offset; in CreateElf()
96 ehdr.e_shentsize = sizeof(ShdrType); in CreateElf()
97 ehdr.e_shnum = 3; in CreateElf()
[all …]
DElfTestUtils.h28 void TestInitEhdr(Ehdr* ehdr, uint32_t elf_class, uint32_t machine_type);
/system/core/libunwindstack/
DElfInterface.cpp163 EhdrType ehdr; in ReadAllHeaders() local
164 if (!memory_->ReadFully(0, &ehdr, sizeof(ehdr))) { in ReadAllHeaders()
172 ReadProgramHeaders<EhdrType, PhdrType>(ehdr, load_bias); in ReadAllHeaders()
173 ReadSectionHeaders<EhdrType, ShdrType>(ehdr); in ReadAllHeaders()
179 EhdrType ehdr; in GetLoadBias() local
180 if (!memory->ReadFully(0, &ehdr, sizeof(ehdr))) { in GetLoadBias()
184 uint64_t offset = ehdr.e_phoff; in GetLoadBias()
185 for (size_t i = 0; i < ehdr.e_phnum; i++, offset += ehdr.e_phentsize) { in GetLoadBias()
198 void ElfInterface::ReadProgramHeaders(const EhdrType& ehdr, uint64_t* load_bias) { in ReadProgramHeaders() argument
199 uint64_t offset = ehdr.e_phoff; in ReadProgramHeaders()
[all …]
/system/core/libunwindstack/include/unwindstack/
DElfInterface.h114 void ReadProgramHeaders(const EhdrType& ehdr, uint64_t* load_bias);
117 void ReadSectionHeaders(const EhdrType& ehdr);