Home
last modified time | relevance | path

Searched refs:elfFile (Results 1 – 3 of 3) sorted by relevance

/packages/modules/UprobeStats/src/bpfloader/
DUprobeStatsBpfLoad.cpp120 static int readElfHeader(ifstream &elfFile, Elf64_Ehdr *eh) { in readElfHeader() argument
121 elfFile.seekg(0); in readElfHeader()
122 if (elfFile.fail()) in readElfHeader()
125 if (!elfFile.read((char *)eh, sizeof(*eh))) in readElfHeader()
132 static int readSectionHeadersAll(ifstream &elfFile, in readSectionHeadersAll() argument
137 ret = readElfHeader(elfFile, &eh); in readSectionHeadersAll()
141 elfFile.seekg(eh.e_shoff); in readSectionHeadersAll()
142 if (elfFile.fail()) in readSectionHeadersAll()
148 if (!elfFile.read((char *)shTable.data(), (eh.e_shnum * eh.e_shentsize))) in readSectionHeadersAll()
155 static int readSectionByIdx(ifstream &elfFile, int id, vector<char> &sec) { in readSectionByIdx() argument
[all …]
/packages/modules/Connectivity/bpf/loader/
DNetBpfLoad.cpp270 static int readElfHeader(ifstream& elfFile, Elf64_Ehdr* eh) { in readElfHeader() argument
271 elfFile.seekg(0); in readElfHeader()
272 if (elfFile.fail()) return -1; in readElfHeader()
274 if (!elfFile.read((char*)eh, sizeof(*eh))) return -1; in readElfHeader()
280 static int readSectionHeadersAll(ifstream& elfFile, vector<Elf64_Shdr>& shTable) { in readSectionHeadersAll() argument
284 ret = readElfHeader(elfFile, &eh); in readSectionHeadersAll()
287 elfFile.seekg(eh.e_shoff); in readSectionHeadersAll()
288 if (elfFile.fail()) return -1; in readSectionHeadersAll()
293 if (!elfFile.read((char*)shTable.data(), (eh.e_shnum * eh.e_shentsize))) return -ENOMEM; in readSectionHeadersAll()
299 static int readSectionByIdx(ifstream& elfFile, int id, vector<char>& sec) { in readSectionByIdx() argument
[all …]
/packages/modules/Connectivity/tests/cts/net/native/src/
DBpfCompatTest.cpp31 std::ifstream elfFile(elfPath, std::ios::in | std::ios::binary); in doBpfStructSizeTest() local
32 ASSERT_TRUE(elfFile.is_open()); in doBpfStructSizeTest()
34 EXPECT_EQ(mapSz, readSectionUint("size_of_bpf_map_def", elfFile, 0)); in doBpfStructSizeTest()
35 EXPECT_EQ(progSz, readSectionUint("size_of_bpf_prog_def", elfFile, 0)); in doBpfStructSizeTest()