Lines Matching refs:ret
109 int ret = 0; in readSectionHeadersAll() local
111 ret = readElfHeader(elfFile, &eh); in readSectionHeadersAll()
112 if (ret) return ret; in readSectionHeadersAll()
128 int entries, ret = 0; in readSectionByIdx() local
130 ret = readSectionHeadersAll(elfFile, shTable); in readSectionByIdx()
131 if (ret) return ret; in readSectionByIdx()
146 int ret = 0; in readSectionHeaderStrtab() local
148 ret = readElfHeader(elfFile, &eh); in readSectionHeaderStrtab()
149 if (ret) return ret; in readSectionHeaderStrtab()
151 ret = readSectionByIdx(elfFile, eh.e_shstrndx, strtab); in readSectionHeaderStrtab()
152 if (ret) return ret; in readSectionHeaderStrtab()
159 int ret; in getSymName() local
162 ret = readSectionHeaderStrtab(elfFile, secStrTab); in getSymName()
163 if (ret) return ret; in getSymName()
175 int ret; in readSectionByName() local
177 ret = readSectionHeadersAll(elfFile, shTable); in readSectionByName()
178 if (ret) return ret; in readSectionByName()
180 ret = readSectionHeaderStrtab(elfFile, secStrTab); in readSectionByName()
181 if (ret) return ret; in readSectionByName()
204 int ret; in readSectionByType() local
207 ret = readSectionHeadersAll(elfFile, shTable); in readSectionByType()
208 if (ret) return ret; in readSectionByType()
232 int ret, numElems; in readSymTab() local
236 ret = readSectionByType(elfFile, SHT_SYMTAB, secData); in readSymTab()
237 if (ret) return ret; in readSymTab()
281 int ret = readSectionByName("progs", elfFile, pdData); in readProgDefs() local
282 if (ret == -2) return 0; in readProgDefs()
283 if (ret) return ret; in readProgDefs()
291 int ret; in getSectionSymNames() local
296 ret = readSymTab(elfFile, 1 /* sort */, symtab); in getSectionSymNames()
297 if (ret) return ret; in getSectionSymNames()
300 ret = readSectionHeadersAll(elfFile, shTable); in getSectionSymNames()
301 if (ret) return ret; in getSectionSymNames()
305 ret = getSymName(elfFile, shTable[i].sh_name, name); in getSectionSymNames()
306 if (ret) return ret; in getSectionSymNames()
323 ret = getSymName(elfFile, symtab[i].st_name, s); in getSectionSymNames()
324 if (ret) return ret; in getSectionSymNames()
335 int entries, ret = 0; in readCodeSections() local
337 ret = readSectionHeadersAll(elfFile, shTable); in readCodeSections()
338 if (ret) return ret; in readCodeSections()
342 ret = readProgDefs(elfFile, pd); in readCodeSections()
343 if (ret) return ret; in readCodeSections()
345 ret = getSectionSymNames(elfFile, "progs", progDefNames); in readCodeSections()
346 if (!pd.empty() && ret) return ret; in readCodeSections()
353 ret = getSymName(elfFile, shTable[i].sh_name, name); in readCodeSections()
354 if (ret) return ret; in readCodeSections()
363 ret = readSectionByIdx(elfFile, i, cs_temp.data); in readCodeSections()
364 if (ret) return ret; in readCodeSections()
368 ret = getSectionSymNames(elfFile, oldName, csSymNames); in readCodeSections()
369 if (ret || !csSymNames.size()) return ret; in readCodeSections()
380 ret = getSymName(elfFile, shTable[i + 1].sh_name, name); in readCodeSections()
381 if (ret) return ret; in readCodeSections()
384 ret = readSectionByIdx(elfFile, i + 1, cs_temp.rel_data); in readCodeSections()
385 if (ret) return ret; in readCodeSections()
400 int ret = 0; in getSymNameByIdx() local
402 ret = readSymTab(elfFile, 0 /* !sort */, symtab); in getSymNameByIdx()
403 if (ret) return ret; in getSymNameByIdx()
411 int ret; in createMaps() local
417 ret = readSectionByName("maps", elfFile, mdData); in createMaps()
418 if (ret == -2) return 0; // no maps to read in createMaps()
419 if (ret) return ret; in createMaps()
423 ret = getSectionSymNames(elfFile, "maps", mapNames); in createMaps()
424 if (ret) return ret; in createMaps()
447 ret = bpf_obj_pin(fd, mapPinLoc.c_str()); in createMaps()
448 if (ret) return -errno; in createMaps()
449 ret = chown(mapPinLoc.c_str(), (uid_t)md[i].uid, (gid_t)md[i].gid); in createMaps()
450 if (ret) return -errno; in createMaps()
451 ret = chmod(mapPinLoc.c_str(), md[i].mode); in createMaps()
452 if (ret) return -errno; in createMaps()
458 return ret; in createMaps()
509 int ret = getSectionSymNames(elfFile, "maps", mapNames); in applyMapRelo() local
510 if (ret) return; in applyMapRelo()
520 ret = getSymNameByIdx(elfFile, symIndex, symName); in applyMapRelo()
521 if (ret) return; in applyMapRelo()
536 int ret, fd; in loadCodeSections() local
599 ret = bpf_obj_pin(fd, progPinLoc.c_str()); in loadCodeSections()
600 if (ret) return -errno; in loadCodeSections()
621 int ret; in loadProg() local
629 ret = readSectionByName("critical", elfFile, critical); in loadProg()
630 *isCritical = !ret; in loadProg()
632 ret = readSectionByName("license", elfFile, license); in loadProg()
633 if (ret) { in loadProg()
635 return ret; in loadProg()
642 ret = readCodeSections(elfFile, cs); in loadProg()
643 if (ret) { in loadProg()
645 return ret; in loadProg()
651 ret = createMaps(elfPath, elfFile, mapFds); in loadProg()
652 if (ret) { in loadProg()
653 ALOGE("Failed to create maps: (ret=%d) in %s\n", ret, elfPath); in loadProg()
654 return ret; in loadProg()
662 ret = loadCodeSections(elfPath, cs, string(license.data())); in loadProg()
663 if (ret) ALOGE("Failed to load programs, loadCodeSections ret=%d\n", ret); in loadProg()
665 return ret; in loadProg()