Home
last modified time | relevance | path

Searched refs:shdr (Results 1 – 11 of 11) sorted by relevance

/system/unwinding/libunwindstack/tests/
DElfInterfaceTest.cpp529 Shdr shdr = {}; in SonameInit() local
530 shdr.sh_type = SHT_STRTAB; in SonameInit()
532 shdr.sh_addr = 0x20100; in SonameInit()
534 shdr.sh_addr = 0x10100; in SonameInit()
536 shdr.sh_offset = 0x10000; in SonameInit()
537 fake_memory_->SetMemory(0x200 + sizeof(shdr), &shdr, sizeof(shdr)); in SonameInit()
781 Shdr shdr = {}; in InitSectionHeadersMalformedSymData() local
782 shdr.sh_type = SHT_SYMTAB; in InitSectionHeadersMalformedSymData()
783 shdr.sh_link = 4; in InitSectionHeadersMalformedSymData()
784 shdr.sh_addr = 0x5000; in InitSectionHeadersMalformedSymData()
[all …]
DGenGnuDebugdata.cpp52 Shdr shdr; in GenElf() local
53 memset(&shdr, 0, sizeof(shdr)); in GenElf()
54 shdr.sh_name = 0; in GenElf()
55 shdr.sh_type = SHT_NULL; in GenElf()
56 TEMP_FAILURE_RETRY(write(fd, &shdr, sizeof(Shdr))); in GenElf()
59 memset(&shdr, 0, sizeof(shdr)); in GenElf()
60 shdr.sh_type = SHT_PROGBITS; in GenElf()
61 shdr.sh_name = 11; in GenElf()
62 shdr.sh_addr = 0x5000; in GenElf()
63 shdr.sh_offset = 0x5000; in GenElf()
[all …]
DElfTestUtils.cpp73 Shdr shdr; in TestInitGnuDebugdata() local
74 memset(&shdr, 0, sizeof(shdr)); in TestInitGnuDebugdata()
75 shdr.sh_type = SHT_NULL; in TestInitGnuDebugdata()
76 copy_func(offset, &shdr, sizeof(shdr)); in TestInitGnuDebugdata()
84 memset(&shdr, 0, sizeof(shdr)); in TestInitGnuDebugdata()
85 shdr.sh_name = 1; in TestInitGnuDebugdata()
86 shdr.sh_type = SHT_STRTAB; in TestInitGnuDebugdata()
87 shdr.sh_offset = symtab_offset; in TestInitGnuDebugdata()
88 shdr.sh_size = 0x100; in TestInitGnuDebugdata()
89 copy_func(offset, &shdr, sizeof(shdr)); in TestInitGnuDebugdata()
[all …]
DMapInfoGetBuildIDTest.cpp153 Elf32_Shdr shdr = {}; in InitElfData() local
154 shdr.sh_type = SHT_NOTE; in InitElfData()
155 shdr.sh_name = 0x500; in InitElfData()
156 shdr.sh_offset = 0xb000; in InitElfData()
157 shdr.sh_size = sizeof(note_section); in InitElfData()
158 offset += ehdr.e_shoff + sizeof(shdr); in InitElfData()
160 ASSERT_EQ(static_cast<ssize_t>(sizeof(shdr)), write(fd, &shdr, sizeof(shdr))); in InitElfData()
163 memset(&shdr, 0, sizeof(shdr)); in InitElfData()
164 shdr.sh_type = SHT_STRTAB; in InitElfData()
165 shdr.sh_name = 0x20000; in InitElfData()
[all …]
DJitDebugTest.cpp106 ShdrType shdr; in CreateElf() local
107 memset(&shdr, 0, sizeof(shdr)); in CreateElf()
108 shdr.sh_type = SHT_NULL; in CreateElf()
109 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
111 sh_offset += sizeof(shdr); in CreateElf()
112 memset(&shdr, 0, sizeof(shdr)); in CreateElf()
113 shdr.sh_type = SHT_STRTAB; in CreateElf()
114 shdr.sh_name = 1; in CreateElf()
115 shdr.sh_offset = 0x500; in CreateElf()
116 shdr.sh_size = 0x100; in CreateElf()
[all …]
DUnwinderTest.cpp1710 Elf32_Shdr shdr = {}; in TEST_F() local
1711 shdr.sh_type = SHT_NULL; in TEST_F()
1712 memory_->SetMemory(0xf7100, &shdr, sizeof(shdr)); in TEST_F()
1714 shdr.sh_type = SHT_SYMTAB; in TEST_F()
1715 shdr.sh_link = 2; in TEST_F()
1716 shdr.sh_addr = 0x300; in TEST_F()
1717 shdr.sh_offset = 0x300; in TEST_F()
1718 shdr.sh_entsize = sizeof(Elf32_Sym); in TEST_F()
1719 shdr.sh_size = shdr.sh_entsize; in TEST_F()
1720 memory_->SetMemory(0xf7100 + sizeof(shdr), &shdr, sizeof(shdr)); in TEST_F()
[all …]
DElfCacheTest.cpp116 Elf32_Shdr shdr = {}; in WriteElfFile() local
117 shdr.sh_type = SHT_NULL; in WriteElfFile()
121 ehdr.e_shentsize = sizeof(shdr); in WriteElfFile()
126 ASSERT_TRUE(android::base::WriteFully(tf->fd, &shdr, sizeof(shdr))); in WriteElfFile()
/system/unwinding/libunwindstack/
DElfInterface.cpp344 ShdrType shdr; in ReadSectionHeaders() local
347 if (memory_->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders()
348 sec_offset = shdr.sh_offset; in ReadSectionHeaders()
349 sec_size = shdr.sh_size; in ReadSectionHeaders()
356 if (!memory_->ReadFully(offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders()
360 if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) { in ReadSectionHeaders()
364 if (shdr.sh_link >= ehdr.e_shnum) { in ReadSectionHeaders()
367 uint64_t str_offset = ehdr.e_shoff + shdr.sh_link * ehdr.e_shentsize; in ReadSectionHeaders()
374 symbols_.push_back(new Symbols(shdr.sh_offset, shdr.sh_size, shdr.sh_entsize, in ReadSectionHeaders()
376 } else if ((shdr.sh_type == SHT_PROGBITS || shdr.sh_type == SHT_NOBITS) && sec_size != 0) { in ReadSectionHeaders()
[all …]
/system/memory/libmeminfo/libelf64/
Dparse.cpp86 Elf64_Shdr shdr = elf64Binary.shdrs[i]; in ParseSections() local
87 uint64_t sOffset = shdr.sh_offset; in ParseSections()
88 uint64_t sSize = shdr.sh_size; in ParseSections()
93 if (shdr.sh_type != SHT_NOBITS) { in ParseSections()
118 Elf64_Shdr shdr = elf64Binary.shdrs[i]; in ParseSections() local
119 uint32_t nameIdx = shdr.sh_name; in ParseSections()
142 Elf64_Shdr shdr; in ParseSectionHeaders() local
144 elfFile.read((char*)&shdr, sizeof(shdr)); in ParseSectionHeaders()
148 elf64Binary.shdrs.push_back(shdr); in ParseSectionHeaders()
/system/unwinding/libunwindstack/tests/fuzz/
DUnwinderComponentCreator.cpp259 ShdrType shdr; in PutElfInMemory() local
260 memset(&shdr, 0, sizeof(shdr)); in PutElfInMemory()
261 shdr.sh_type = SHT_NULL; in PutElfInMemory()
262 memory->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in PutElfInMemory()
264 sh_offset += sizeof(shdr); in PutElfInMemory()
265 memset(&shdr, 0, sizeof(shdr)); in PutElfInMemory()
266 shdr.sh_type = SHT_STRTAB; in PutElfInMemory()
267 shdr.sh_name = 1; in PutElfInMemory()
268 shdr.sh_offset = 0x500; in PutElfInMemory()
269 shdr.sh_size = 0x100; in PutElfInMemory()
[all …]
/system/extras/simpleperf/
Dread_elf.cpp312 const auto* shdr = elf->getSection(section_ref.getRawDataRefImpl()); in AddSymbolForPltSection() local
313 if (shdr == nullptr) { in AddSymbolForPltSection()
317 symbol.vaddr = shdr->sh_addr; in AddSymbolForPltSection()
318 symbol.len = shdr->sh_size; in AddSymbolForPltSection()
386 const auto& shdr = section_headers[i]; in GetSectionHeader() local
387 if (auto name = GetELFSectionName(elf_, shdr); name) { in GetSectionHeader()
390 sections[i].vaddr = shdr.sh_addr; in GetSectionHeader()
391 sections[i].file_offset = shdr.sh_offset; in GetSectionHeader()
392 sections[i].size = shdr.sh_size; in GetSectionHeader()