vendorBpfLoader: change single line, end-of-line /* */ comments to //

Test: TreeHugger
Flag: EXEMPT cleanup
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibc2b32b3a07a1115489b373a97827625fa27ff10
This commit is contained in:
Maciej Żenczykowski 2025-07-16 08:35:34 -07:00
commit b902e1c254

View file

@ -110,7 +110,7 @@ typedef struct {
vector<char> rel_data;
optional<struct bpf_prog_def> 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<Elf64_Shdr>& shTable) {
Elf64_Ehdr eh;
int ret = 0;
@ -133,7 +133,7 @@ static int readSectionHeadersAll(ifstream& elfFile, vector<Elf64_Shdr>& 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<Elf64_Shdr>& 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<char>& sec) {
vector<Elf64_Shdr> shTable;
int ret = readSectionHeadersAll(elfFile, shTable);
@ -156,7 +156,7 @@ static int readSectionByIdx(ifstream& elfFile, int id, vector<char>& sec) {
return 0;
}
/* Read whole section header string table */
// Read whole section header string table
static int readSectionHeaderStrtab(ifstream& elfFile, vector<char>& strtab) {
Elf64_Ehdr eh;
int ret = readElfHeader(elfFile, &eh);
@ -168,7 +168,7 @@ static int readSectionHeaderStrtab(ifstream& elfFile, vector<char>& 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<char> 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<char>& data) {
vector<char> secStrTab;
vector<Elf64_Shdr> 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<codeSection>& cs) {
vector<Elf64_Shdr> shTable;
int entries, ret = 0;
@ -399,7 +399,7 @@ static int readCodeSections(ifstream& elfFile, vector<codeSection>& 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<unique_fd> &mapFds, vector<co
ret = getSymNameByIdx(elfFile, symIndex, symName);
if (ret) return;
/* Find the map fd and apply relo */
// Find the map fd and apply relo
for (int j = 0; j < (int)mapNames.size(); j++) {
if (!mapNames[j].compare(symName)) {
applyRelo(cs[k].data.data(), rel[i].r_offset, mapFds[j]);