Lines Matching refs:elf

183   std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_));  in SinglePtLoad()  local
200 ASSERT_TRUE(elf->Init(&load_bias)); in SinglePtLoad()
203 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in SinglePtLoad()
221 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in MultipleExecutablePtLoads() local
256 ASSERT_TRUE(elf->Init(&load_bias)); in MultipleExecutablePtLoads()
259 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in MultipleExecutablePtLoads()
288 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() local
323 ASSERT_TRUE(elf->Init(&load_bias)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr()
326 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr()
357 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in NonExecutablePtLoads() local
392 ASSERT_TRUE(elf->Init(&load_bias)); in NonExecutablePtLoads()
395 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in NonExecutablePtLoads()
414 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in ManyPhdrs() local
463 ASSERT_TRUE(elf->Init(&load_bias)); in ManyPhdrs()
466 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in ManyPhdrs()
581 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in Soname() local
584 ASSERT_TRUE(elf->Init(&load_bias)); in Soname()
587 ASSERT_EQ("fake_soname.so", elf->GetSoname()); in Soname()
602 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in SonameAfterDtNull() local
605 ASSERT_TRUE(elf->Init(&load_bias)); in SonameAfterDtNull()
608 ASSERT_EQ("", elf->GetSoname()); in SonameAfterDtNull()
623 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in SonameSize() local
626 ASSERT_TRUE(elf->Init(&load_bias)); in SonameSize()
629 ASSERT_EQ("", elf->GetSoname()); in SonameSize()
646 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in SonameMissingMap() local
649 ASSERT_TRUE(elf->Init(&load_bias)); in SonameMissingMap()
652 ASSERT_EQ("", elf->GetSoname()); in SonameMissingMap()
667 ElfType elf(memory_); in InitHeadersEhFrameTest() local
669 elf.FakeSetEhFrameInfo(SectionInfo{.offset = 0x10000}); in InitHeadersEhFrameTest()
670 elf.FakeSetDebugFrameInfo(SectionInfo{}); in InitHeadersEhFrameTest()
677 elf.InitHeaders(); in InitHeadersEhFrameTest()
679 EXPECT_FALSE(elf.eh_frame() == nullptr); in InitHeadersEhFrameTest()
680 EXPECT_TRUE(elf.debug_frame() == nullptr); in InitHeadersEhFrameTest()
693 ElfType elf(memory_); in InitHeadersDebugFrame() local
695 elf.FakeSetEhFrameInfo(SectionInfo{}); in InitHeadersDebugFrame()
696 elf.FakeSetDebugFrameInfo(SectionInfo{.offset = 0x5000, .size = 0x200}); in InitHeadersDebugFrame()
707 elf.InitHeaders(); in InitHeadersDebugFrame()
709 EXPECT_TRUE(elf.eh_frame() == nullptr); in InitHeadersDebugFrame()
710 EXPECT_FALSE(elf.debug_frame() == nullptr); in InitHeadersDebugFrame()
723 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitProgramHeadersMalformed() local
732 ASSERT_TRUE(elf->Init(&load_bias)); in InitProgramHeadersMalformed()
746 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeadersMalformed() local
755 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeadersMalformed()
769 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeadersMalformedSymData() local
820 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeadersMalformedSymData()
822 EXPECT_EQ(0U, elf->debug_frame_info().offset); in InitSectionHeadersMalformedSymData()
823 EXPECT_EQ(0U, elf->debug_frame_info().size); in InitSectionHeadersMalformedSymData()
824 EXPECT_EQ(0U, elf->gnu_debugdata_offset()); in InitSectionHeadersMalformedSymData()
825 EXPECT_EQ(0U, elf->gnu_debugdata_size()); in InitSectionHeadersMalformedSymData()
829 ASSERT_FALSE(elf->GetFunctionName(0x90010, &name, &name_offset)); in InitSectionHeadersMalformedSymData()
842 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeaders() local
892 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeaders()
894 EXPECT_EQ(0U, elf->debug_frame_info().offset); in InitSectionHeaders()
895 EXPECT_EQ(0U, elf->debug_frame_info().size); in InitSectionHeaders()
896 EXPECT_EQ(0U, elf->gnu_debugdata_offset()); in InitSectionHeaders()
897 EXPECT_EQ(0U, elf->gnu_debugdata_size()); in InitSectionHeaders()
902 ASSERT_TRUE(elf->GetFunctionName(0x90010, &name, &name_offset)); in InitSectionHeaders()
905 ASSERT_TRUE(elf->GetFunctionName(0xd0020, &name, &name_offset)); in InitSectionHeaders()
928 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeadersOffsets() local
1009 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeadersOffsets()
1011 EXPECT_EQ(0x6000U, elf->debug_frame_info().offset); in InitSectionHeadersOffsets()
1012 EXPECT_EQ(0, elf->debug_frame_info().bias); in InitSectionHeadersOffsets()
1013 EXPECT_EQ(0x500U, elf->debug_frame_info().size); in InitSectionHeadersOffsets()
1014 EXPECT_EQ(0U, elf->debug_frame_info().flags); in InitSectionHeadersOffsets()
1016 EXPECT_EQ(0x5000U, elf->gnu_debugdata_offset()); in InitSectionHeadersOffsets()
1017 EXPECT_EQ(0x800U, elf->gnu_debugdata_size()); in InitSectionHeadersOffsets()
1019 EXPECT_EQ(0x7000U, elf->eh_frame_info().offset); in InitSectionHeadersOffsets()
1020 EXPECT_EQ(0, elf->eh_frame_info().bias); in InitSectionHeadersOffsets()
1021 EXPECT_EQ(0x800U, elf->eh_frame_info().size); in InitSectionHeadersOffsets()
1022 EXPECT_EQ(0U, elf->eh_frame_info().flags); in InitSectionHeadersOffsets()
1024 EXPECT_EQ(0xa000U, elf->eh_frame_hdr_info().offset); in InitSectionHeadersOffsets()
1025 EXPECT_EQ(0, elf->eh_frame_hdr_info().bias); in InitSectionHeadersOffsets()
1026 EXPECT_EQ(0xf00U, elf->eh_frame_hdr_info().size); in InitSectionHeadersOffsets()
1027 EXPECT_EQ(0U, elf->eh_frame_hdr_info().flags); in InitSectionHeadersOffsets()
1029 EXPECT_EQ(0xb000U, elf->gnu_build_id_offset()); in InitSectionHeadersOffsets()
1030 EXPECT_EQ(0xf00U, elf->gnu_build_id_size()); in InitSectionHeadersOffsets()
1044 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeadersOffsetsEhFrameSectionBias() local
1091 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeadersOffsetsEhFrameSectionBias()
1093 EXPECT_EQ(offset, elf->eh_frame_info().offset); in InitSectionHeadersOffsetsEhFrameSectionBias()
1094 EXPECT_EQ(expected_bias, elf->eh_frame_info().bias); in InitSectionHeadersOffsetsEhFrameSectionBias()
1095 EXPECT_EQ(0x500U, elf->eh_frame_info().size); in InitSectionHeadersOffsetsEhFrameSectionBias()
1096 EXPECT_EQ(0U, elf->eh_frame_info().flags); in InitSectionHeadersOffsetsEhFrameSectionBias()
1098 EXPECT_EQ(0x8000U, elf->eh_frame_hdr_info().offset); in InitSectionHeadersOffsetsEhFrameSectionBias()
1099 EXPECT_EQ(0, elf->eh_frame_hdr_info().bias); in InitSectionHeadersOffsetsEhFrameSectionBias()
1100 EXPECT_EQ(0x800U, elf->eh_frame_hdr_info().size); in InitSectionHeadersOffsetsEhFrameSectionBias()
1101 EXPECT_EQ(0U, elf->eh_frame_hdr_info().flags); in InitSectionHeadersOffsetsEhFrameSectionBias()
1138 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeadersOffsetsEhFrameHdrSectionBias() local
1185 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1187 EXPECT_EQ(0x5000U, elf->eh_frame_info().offset); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1188 EXPECT_EQ(0, elf->eh_frame_info().bias); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1189 EXPECT_EQ(0x500U, elf->eh_frame_info().size); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1190 EXPECT_EQ(0U, elf->eh_frame_info().flags); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1191 EXPECT_EQ(offset, elf->eh_frame_hdr_info().offset); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1192 EXPECT_EQ(expected_bias, elf->eh_frame_hdr_info().bias); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1193 EXPECT_EQ(0x800U, elf->eh_frame_hdr_info().size); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1194 EXPECT_EQ(0U, elf->eh_frame_hdr_info().flags); in InitSectionHeadersOffsetsEhFrameHdrSectionBias()
1231 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in InitSectionHeadersOffsetsDebugFrameSectionBias() local
1266 ASSERT_TRUE(elf->Init(&load_bias)); in InitSectionHeadersOffsetsDebugFrameSectionBias()
1268 EXPECT_EQ(offset, elf->debug_frame_info().offset); in InitSectionHeadersOffsetsDebugFrameSectionBias()
1269 EXPECT_EQ(expected_bias, elf->debug_frame_info().bias); in InitSectionHeadersOffsetsDebugFrameSectionBias()
1270 EXPECT_EQ(0x800U, elf->debug_frame_info().size); in InitSectionHeadersOffsetsDebugFrameSectionBias()
1305 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in CheckGnuEhFrame() local
1330 ASSERT_TRUE(elf->Init(&load_bias)); in CheckGnuEhFrame()
1332 EXPECT_EQ(expected_bias, elf->eh_frame_hdr_info().bias); in CheckGnuEhFrame()
1362 std::unique_ptr<ElfInterface> elf(new ElfInterface32(memory_)); in TEST_F() local
1379 ASSERT_TRUE(elf->Init(&load_bias)); in TEST_F()
1381 EXPECT_TRUE(elf->IsValidPc(0)); in TEST_F()
1382 EXPECT_TRUE(elf->IsValidPc(0x5000)); in TEST_F()
1383 EXPECT_TRUE(elf->IsValidPc(0xffff)); in TEST_F()
1384 EXPECT_FALSE(elf->IsValidPc(0x10000)); in TEST_F()
1388 std::unique_ptr<ElfInterface> elf(new ElfInterface32(memory_)); in TEST_F() local
1405 ASSERT_TRUE(elf->Init(&load_bias)); in TEST_F()
1407 EXPECT_FALSE(elf->IsValidPc(0)); in TEST_F()
1408 EXPECT_FALSE(elf->IsValidPc(0x1000)); in TEST_F()
1409 EXPECT_FALSE(elf->IsValidPc(0x1fff)); in TEST_F()
1410 EXPECT_TRUE(elf->IsValidPc(0x2000)); in TEST_F()
1411 EXPECT_TRUE(elf->IsValidPc(0x5000)); in TEST_F()
1412 EXPECT_TRUE(elf->IsValidPc(0x11fff)); in TEST_F()
1413 EXPECT_FALSE(elf->IsValidPc(0x12000)); in TEST_F()
1417 std::unique_ptr<ElfInterface> elf(new ElfInterface32(memory_)); in TEST_F() local
1462 ASSERT_TRUE(elf->Init(&load_bias)); in TEST_F()
1463 elf->InitHeaders(); in TEST_F()
1465 EXPECT_FALSE(elf->IsValidPc(0)); in TEST_F()
1466 EXPECT_FALSE(elf->IsValidPc(0x20ff)); in TEST_F()
1467 EXPECT_TRUE(elf->IsValidPc(0x2100)); in TEST_F()
1468 EXPECT_TRUE(elf->IsValidPc(0x2200)); in TEST_F()
1469 EXPECT_TRUE(elf->IsValidPc(0x22ff)); in TEST_F()
1470 EXPECT_FALSE(elf->IsValidPc(0x2300)); in TEST_F()
1474 std::unique_ptr<ElfInterface> elf(new ElfInterface32(memory_)); in TEST_F() local
1519 ASSERT_TRUE(elf->Init(&load_bias)); in TEST_F()
1520 elf->InitHeaders(); in TEST_F()
1522 EXPECT_FALSE(elf->IsValidPc(0)); in TEST_F()
1523 EXPECT_FALSE(elf->IsValidPc(0x27ff)); in TEST_F()
1524 EXPECT_TRUE(elf->IsValidPc(0x2800)); in TEST_F()
1525 EXPECT_TRUE(elf->IsValidPc(0x2900)); in TEST_F()
1526 EXPECT_TRUE(elf->IsValidPc(0x29ff)); in TEST_F()
1527 EXPECT_FALSE(elf->IsValidPc(0x2a00)); in TEST_F()
1532 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in BuildID() local
1578 ASSERT_TRUE(elf->Init(&load_bias)); in BuildID()
1579 ASSERT_EQ("BUILDID", elf->GetBuildID()); in BuildID()
1592 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in BuildIDTwoNotes() local
1649 ASSERT_TRUE(elf->Init(&load_bias)); in BuildIDTwoNotes()
1650 ASSERT_EQ("BUILDID", elf->GetBuildID()); in BuildIDTwoNotes()
1663 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in BuildIDSectionTooSmallForName() local
1709 ASSERT_TRUE(elf->Init(&load_bias)); in BuildIDSectionTooSmallForName()
1710 ASSERT_EQ("", elf->GetBuildID()); in BuildIDSectionTooSmallForName()
1723 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in BuildIDSectionTooSmallForDesc() local
1769 ASSERT_TRUE(elf->Init(&load_bias)); in BuildIDSectionTooSmallForDesc()
1770 ASSERT_EQ("", elf->GetBuildID()); in BuildIDSectionTooSmallForDesc()
1783 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in BuildIDSectionTooSmallForHeader() local
1829 ASSERT_TRUE(elf->Init(&load_bias)); in BuildIDSectionTooSmallForHeader()
1830 ASSERT_EQ("", elf->GetBuildID()); in BuildIDSectionTooSmallForHeader()
1869 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in CheckLoadBiasInFirstPhdr() local
1871 ASSERT_TRUE(elf->Init(&init_load_bias)); in CheckLoadBiasInFirstPhdr()
1929 std::unique_ptr<ElfInterfaceType> elf(new ElfInterfaceType(memory_)); in CheckLoadBiasInFirstExecPhdr() local
1931 ASSERT_TRUE(elf->Init(&init_load_bias)); in CheckLoadBiasInFirstExecPhdr()
2035 Elf elf(elf_memory); in TEST_F() local
2036 ASSERT_TRUE(elf.Init()); in TEST_F()
2037 ASSERT_TRUE(elf.valid()); in TEST_F()
2038 auto section = elf.interface()->debug_frame(); in TEST_F()
2102 Elf elf(elf_memory); in TEST_F() local
2103 ASSERT_TRUE(elf.Init()); in TEST_F()
2104 ASSERT_TRUE(elf.valid()); in TEST_F()
2105 auto section = elf.interface()->debug_frame(); in TEST_F()
2125 Elf elf(elf_memory); in TEST_F() local
2126 ASSERT_TRUE(elf.Init()); in TEST_F()
2127 ASSERT_TRUE(elf.valid()); in TEST_F()
2129 ASSERT_TRUE(elf.interface()->debug_frame() == nullptr); in TEST_F()