/aosp12/system/unwinding/libunwindstack/tests/ |
H A D | ElfInterfaceTest.cpp | 536 memory_.SetMemory(0x200 + sizeof(shdr), &shdr, sizeof(shdr)); in SonameInit() 794 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeadersMalformedSymData() 804 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeadersMalformedSymData() 815 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeadersMalformedSymData() 867 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeaders() 877 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeaders() 884 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeaders() 956 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeadersOffsets() 964 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeadersOffsets() 975 memset(&shdr, 0, sizeof(shdr)); in InitSectionHeadersOffsets() [all …]
|
H A D | GenGnuDebugdata.cpp | 56 Shdr shdr; in GenElf() local 57 memset(&shdr, 0, sizeof(shdr)); in GenElf() 58 shdr.sh_name = 0; in GenElf() 63 memset(&shdr, 0, sizeof(shdr)); in GenElf() 65 shdr.sh_name = 11; in GenElf() 66 shdr.sh_addr = 0x5000; in GenElf() 69 shdr.sh_size = 0x800; in GenElf() 73 memset(&shdr, 0, sizeof(shdr)); in GenElf() 75 shdr.sh_name = 1; in GenElf() 76 shdr.sh_offset = 0x200; in GenElf() [all …]
|
H A D | ElfTestUtils.cpp | 73 Shdr shdr; in TestInitGnuDebugdata() local 74 memset(&shdr, 0, sizeof(shdr)); 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() 88 shdr.sh_size = 0x100; in TestInitGnuDebugdata() 89 copy_func(offset, &shdr, sizeof(shdr)); in TestInitGnuDebugdata() 125 memset(&shdr, 0, sizeof(shdr)); in TestInitGnuDebugdata() 128 shdr.sh_addr = offset; in TestInitGnuDebugdata() 130 shdr.sh_size = bytes; in TestInitGnuDebugdata() [all …]
|
H A D | JitDebugTest.cpp | 106 ShdrType shdr; in CreateElf() local 107 memset(&shdr, 0, sizeof(shdr)); in CreateElf() 109 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 112 memset(&shdr, 0, sizeof(shdr)); in CreateElf() 114 shdr.sh_name = 1; in CreateElf() 117 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 122 memset(&shdr, 0, sizeof(shdr)); in CreateElf() 124 shdr.sh_name = 0; in CreateElf() 128 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 131 memset(&shdr, 0, sizeof(shdr)); in CreateElf() [all …]
|
H A D | MapInfoGetBuildIDTest.cpp | 156 Elf32_Shdr shdr = {}; in InitElfData() local 157 shdr.sh_type = SHT_NOTE; in InitElfData() 158 shdr.sh_name = 0x500; in InitElfData() 159 shdr.sh_offset = 0xb000; in InitElfData() 163 ASSERT_EQ(static_cast<ssize_t>(sizeof(shdr)), write(fd, &shdr, sizeof(shdr))); in InitElfData() 166 memset(&shdr, 0, sizeof(shdr)); in InitElfData() 168 shdr.sh_name = 0x20000; in InitElfData() 169 shdr.sh_offset = 0xf000; in InitElfData() 170 shdr.sh_size = 0x1000; in InitElfData() 171 offset += sizeof(shdr); in InitElfData() [all …]
|
H A D | UnwinderTest.cpp | 1703 Elf32_Shdr shdr = {}; in TEST_F() local 1705 memory_->SetMemory(0xf7100, &shdr, sizeof(shdr)); in TEST_F() 1708 shdr.sh_link = 2; in TEST_F() 1709 shdr.sh_addr = 0x300; in TEST_F() 1710 shdr.sh_offset = 0x300; in TEST_F() 1712 shdr.sh_size = shdr.sh_entsize; in TEST_F() 1713 memory_->SetMemory(0xf7100 + sizeof(shdr), &shdr, sizeof(shdr)); in TEST_F() 1715 memset(&shdr, 0, sizeof(shdr)); in TEST_F() 1717 shdr.sh_name = 0x500; in TEST_F() 1719 shdr.sh_size = 0x100; in TEST_F() [all …]
|
/aosp12/system/unwinding/libunwindstack/ |
H A D | ElfInterface.cpp | 285 ShdrType shdr; in ReadSectionHeaders() local 288 if (memory_->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders() 290 sec_size = shdr.sh_size; in ReadSectionHeaders() 297 if (!memory_->ReadFully(offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders() 301 if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) { in ReadSectionHeaders() 315 symbols_.push_back(new Symbols(shdr.sh_offset, shdr.sh_size, shdr.sh_entsize, in ReadSectionHeaders() 545 ShdrType shdr; in GetBuildIDInfo() local 551 if (!memory->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in GetBuildIDInfo() 555 sec_size = shdr.sh_size; in GetBuildIDInfo() 560 if (!memory->ReadFully(offset, &shdr, sizeof(shdr))) { in GetBuildIDInfo() [all …]
|
/aosp12/system/unwinding/libunwindstack/tests/fuzz/ |
H A D | UnwinderComponentCreator.cpp | 265 ShdrType shdr; in PutElfInMemory() local 266 memset(&shdr, 0, sizeof(shdr)); in PutElfInMemory() 268 memory->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in PutElfInMemory() 271 memset(&shdr, 0, sizeof(shdr)); in PutElfInMemory() 273 shdr.sh_name = 1; in PutElfInMemory() 275 shdr.sh_size = 0x100; in PutElfInMemory() 276 memory->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in PutElfInMemory() 280 memset(&shdr, 0, sizeof(shdr)); in PutElfInMemory() 282 shdr.sh_name = 0; in PutElfInMemory() 283 shdr.sh_addr = 0x600; in PutElfInMemory() [all …]
|
/aosp12/art/libelffile/elf/ |
H A D | elf_builder.h | 907 const Elf_Shdr& shdr = section->header_; in MakeProgramHeaders() local 908 if ((shdr.sh_flags & SHF_ALLOC) != 0 && shdr.sh_size != 0) { in MakeProgramHeaders() 917 load.p_offset = shdr.sh_offset; in MakeProgramHeaders() 919 load.p_filesz = (shdr.sh_type != SHT_NOBITS ? shdr.sh_size : 0u); in MakeProgramHeaders() 920 load.p_memsz = shdr.sh_size; in MakeProgramHeaders() 921 load.p_align = shdr.sh_addralign; in MakeProgramHeaders() 927 Elf_Word size = shdr.sh_offset + shdr.sh_size - prev.p_offset; in MakeProgramHeaders() 938 const Elf_Shdr& shdr = section->header_; in MakeProgramHeaders() local 939 if ((shdr.sh_flags & SHF_ALLOC) != 0 && shdr.sh_size != 0) { in MakeProgramHeaders() 946 phdr.p_offset = shdr.sh_offset; in MakeProgramHeaders() [all …]
|
/aosp12/frameworks/compile/mclinker/lib/LD/ |
H A D | ELFReader.cpp | 329 const llvm::ELF::Elf32_Shdr* shdr = NULL; in readSectionHeaders() local 347 sh_size = shdr->sh_size; in readSectionHeaders() 348 sh_link = shdr->sh_link; in readSectionHeaders() 368 shdr = &shdrTab[shstrtab]; in readSectionHeaders() 370 sh_offset = shdr->sh_offset; in readSectionHeaders() 371 sh_size = shdr->sh_size; in readSectionHeaders() 841 sh_size = shdr->sh_size; in readSectionHeaders() 842 sh_link = shdr->sh_link; in readSectionHeaders() 862 shdr = &shdrTab[shstrtab]; in readSectionHeaders() 864 sh_offset = shdr->sh_offset; in readSectionHeaders() [all …]
|
H A D | ELFObjectWriter.cpp | 308 ElfXX_Shdr* shdr = reinterpret_cast<ElfXX_Shdr*>(region.begin()); in emitSectionHeader() local 315 shdr[sectIdx].sh_name = shstridx; in emitSectionHeader() 316 shdr[sectIdx].sh_type = ld_sect->type(); in emitSectionHeader() 317 shdr[sectIdx].sh_flags = ld_sect->flag(); in emitSectionHeader() 318 shdr[sectIdx].sh_addr = ld_sect->addr(); in emitSectionHeader() 319 shdr[sectIdx].sh_offset = ld_sect->offset(); in emitSectionHeader() 320 shdr[sectIdx].sh_size = ld_sect->size(); in emitSectionHeader() 321 shdr[sectIdx].sh_addralign = ld_sect->align(); in emitSectionHeader() 322 shdr[sectIdx].sh_entsize = getSectEntrySize<SIZE>(*ld_sect); in emitSectionHeader() 323 shdr[sectIdx].sh_link = getSectLink(*ld_sect, pConfig); in emitSectionHeader() [all …]
|
/aosp12/system/extras/simpleperf/ |
H A D | read_elf.cpp | 275 const auto* shdr = elf->getSection(section_ref.getRawDataRefImpl()); in AddSymbolForPltSection() local 276 if (shdr == nullptr) { in AddSymbolForPltSection() 280 symbol.vaddr = shdr->sh_addr; in AddSymbolForPltSection() 281 symbol.len = shdr->sh_size; in AddSymbolForPltSection() 347 const auto& shdr = section_headers[i]; 348 if (auto name = elf_->getSectionName(&shdr); name) { 351 sections[i].vaddr = shdr.sh_addr; 352 sections[i].file_offset = shdr.sh_offset; 353 sections[i].size = shdr.sh_size;
|
/aosp12/art/runtime/ |
H A D | elf_file.cc | 1355 Elf_Shdr* shdr = GetSectionHeader(i); in FindSectionByName() local 1356 if (shdr == nullptr) { in FindSectionByName() 1364 return shdr; in FindSectionByName() 1628 Elf64_Shdr *shdr = elf64_->FindSectionByName(section_name); in GetSectionOffsetAndSize() local 1629 if (shdr == nullptr) { in GetSectionOffsetAndSize() 1633 *offset = shdr->sh_offset; in GetSectionOffsetAndSize() 1636 *size = shdr->sh_size; in GetSectionOffsetAndSize() 1640 Elf32_Shdr *shdr = elf32_->FindSectionByName(section_name); in GetSectionOffsetAndSize() local 1641 if (shdr == nullptr) { in GetSectionOffsetAndSize() 1645 *offset = shdr->sh_offset; in GetSectionOffsetAndSize() [all …]
|