From b902e1c254e9fbd4d4517d573b28cacc60b46695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Wed, 16 Jul 2025 08:35:34 -0700 Subject: [PATCH] vendorBpfLoader: change single line, end-of-line /* */ comments to // MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test: TreeHugger Flag: EXEMPT cleanup Signed-off-by: Maciej Żenczykowski Change-Id: Ibc2b32b3a07a1115489b373a97827625fa27ff10 --- loader/Loader.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/loader/Loader.cpp b/loader/Loader.cpp index f62347d..a5b3d50 100644 --- a/loader/Loader.cpp +++ b/loader/Loader.cpp @@ -110,7 +110,7 @@ typedef struct { vector rel_data; optional prog_def; - unique_fd prog_fd; /* fd after loading */ + unique_fd prog_fd; // fd after loading } codeSection; static int readElfHeader(ifstream& elfFile, Elf64_Ehdr* eh) { @@ -122,7 +122,7 @@ static int readElfHeader(ifstream& elfFile, Elf64_Ehdr* eh) { return 0; } -/* Reads all section header tables into an Shdr array */ +// Reads all section header tables into an Shdr array static int readSectionHeadersAll(ifstream& elfFile, vector& shTable) { Elf64_Ehdr eh; int ret = 0; @@ -133,7 +133,7 @@ static int readSectionHeadersAll(ifstream& elfFile, vector& shTable) elfFile.seekg(eh.e_shoff); if (elfFile.fail()) return -1; - /* Read shdr table entries */ + // Read shdr table entries shTable.resize(eh.e_shnum); if (!elfFile.read((char*)shTable.data(), (eh.e_shnum * eh.e_shentsize))) return -ENOMEM; @@ -141,7 +141,7 @@ static int readSectionHeadersAll(ifstream& elfFile, vector& shTable) return 0; } -/* Read a section by its index - for ex to get sec hdr strtab blob */ +// Read a section by its index - for ex to get sec hdr strtab blob static int readSectionByIdx(ifstream& elfFile, int id, vector& sec) { vector shTable; int ret = readSectionHeadersAll(elfFile, shTable); @@ -156,7 +156,7 @@ static int readSectionByIdx(ifstream& elfFile, int id, vector& sec) { return 0; } -/* Read whole section header string table */ +// Read whole section header string table static int readSectionHeaderStrtab(ifstream& elfFile, vector& strtab) { Elf64_Ehdr eh; int ret = readElfHeader(elfFile, &eh); @@ -168,7 +168,7 @@ static int readSectionHeaderStrtab(ifstream& elfFile, vector& strtab) { return 0; } -/* Get name from offset in strtab */ +// Get name from offset in strtab static int getSymName(ifstream& elfFile, int nameOff, string& name) { int ret; vector secStrTab; @@ -182,7 +182,7 @@ static int getSymName(ifstream& elfFile, int nameOff, string& name) { return 0; } -/* Reads a full section by name - example to get the GPL license */ +// Reads a full section by name - example to get the GPL license static int readSectionByName(const char* name, ifstream& elfFile, vector& data) { vector secStrTab; vector shTable; @@ -314,7 +314,7 @@ static int getSectionSymNames(ifstream& elfFile, const string& sectionName, vect ret = readSymTab(elfFile, 1 /* sort */, symtab); if (ret) return ret; - /* Get index of section */ + // Get index of section ret = readSectionHeadersAll(elfFile, shTable); if (ret) return ret; @@ -329,7 +329,7 @@ static int getSectionSymNames(ifstream& elfFile, const string& sectionName, vect } } - /* No section found with matching name*/ + // No section found with matching name if (sec_idx == -1) { ALOGW("No %s section could be found in elf object", sectionName.c_str()); return -1; @@ -349,7 +349,7 @@ static int getSectionSymNames(ifstream& elfFile, const string& sectionName, vect return 0; } -/* Read a section by its index - for ex to get sec hdr strtab blob */ +// Read a section by its index - for ex to get sec hdr strtab blob static int readCodeSections(ifstream& elfFile, vector& cs) { vector shTable; int entries, ret = 0; @@ -399,7 +399,7 @@ static int readCodeSections(ifstream& elfFile, vector& cs) { } } - /* Check for rel section */ + // Check for rel section if (cs_temp.data.size() > 0 && i < entries) { ret = getSymName(elfFile, shTable[i + 1].sh_name, name); if (ret) return ret; @@ -641,7 +641,7 @@ static void applyMapRelo(ifstream& elfFile, vector &mapFds, vector