Skip to content

Commit 1071237

Browse files
committed
Renamed findSection3 to getSectionIndex
1 parent 05e8f67 commit 1071237

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/patchelf.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,14 @@ void ElfFile<ElfFileParamNames>::sortShdrs()
352352
for (unsigned int i = 1; i < rdi(hdr()->e_shnum); ++i)
353353
if (rdi(shdrs[i].sh_link) != 0)
354354
wri(shdrs[i].sh_link,
355-
findSection3(linkage[getSectionName(shdrs[i])]));
355+
getSectionIndex(linkage[getSectionName(shdrs[i])]));
356356

357357
/* And the st_info mappings. */
358358
for (unsigned int i = 1; i < rdi(hdr()->e_shnum); ++i)
359359
if (rdi(shdrs.at(i).sh_info) != 0 &&
360360
(rdi(shdrs.at(i).sh_type) == SHT_REL || rdi(shdrs.at(i).sh_type) == SHT_RELA))
361361
wri(shdrs.at(i).sh_info,
362-
findSection3(info.at(getSectionName(shdrs.at(i)))));
362+
getSectionIndex(info.at(getSectionName(shdrs.at(i)))));
363363

364364
/* And the .shstrtab index. Note: the match here is done by checking the offset as searching
365365
* by name can yield incorrect results in case there are multiple sections with the same
@@ -485,7 +485,7 @@ Elf_Shdr & ElfFile<ElfFileParamNames>::findSectionHeader(const SectionName & sec
485485
template<ElfFileParams>
486486
std::optional<std::reference_wrapper<Elf_Shdr>> ElfFile<ElfFileParamNames>::findSection2(const SectionName & sectionName)
487487
{
488-
auto i = findSection3(sectionName);
488+
auto i = getSectionIndex(sectionName);
489489
if (i)
490490
return shdrs.at(i);
491491
return {};
@@ -1051,7 +1051,7 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
10511051
}
10521052
const std::string & section = sectionsByOldIndex.at(shndx);
10531053
assert(!section.empty());
1054-
auto newIndex = findSection3(section); // inefficient
1054+
auto newIndex = getSectionIndex(section); // inefficient
10551055
//debug("rewriting symbol %d: index = %d (%s) -> %d\n", entry, shndx, section.c_str(), newIndex);
10561056
wri(sym->st_shndx, newIndex);
10571057
/* Rewrite st_value. FIXME: we should do this for all

0 commit comments

Comments
 (0)