@@ -352,14 +352,14 @@ void ElfFile<ElfFileParamNames>::sortShdrs()
352
352
for (unsigned int i = 1 ; i < rdi (hdr ()->e_shnum ); ++i)
353
353
if (rdi (shdrs[i].sh_link ) != 0 )
354
354
wri (shdrs[i].sh_link ,
355
- findSection3 (linkage[getSectionName (shdrs[i])]));
355
+ getSectionIndex (linkage[getSectionName (shdrs[i])]));
356
356
357
357
/* And the st_info mappings. */
358
358
for (unsigned int i = 1 ; i < rdi (hdr ()->e_shnum ); ++i)
359
359
if (rdi (shdrs.at (i).sh_info ) != 0 &&
360
360
(rdi (shdrs.at (i).sh_type ) == SHT_REL || rdi (shdrs.at (i).sh_type ) == SHT_RELA))
361
361
wri (shdrs.at (i).sh_info ,
362
- findSection3 (info.at (getSectionName (shdrs.at (i)))));
362
+ getSectionIndex (info.at (getSectionName (shdrs.at (i)))));
363
363
364
364
/* And the .shstrtab index. Note: the match here is done by checking the offset as searching
365
365
* 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
485
485
template <ElfFileParams>
486
486
std::optional<std::reference_wrapper<Elf_Shdr>> ElfFile<ElfFileParamNames>::findSection2(const SectionName & sectionName)
487
487
{
488
- auto i = findSection3 (sectionName);
488
+ auto i = getSectionIndex (sectionName);
489
489
if (i)
490
490
return shdrs.at (i);
491
491
return {};
@@ -1051,7 +1051,7 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
1051
1051
}
1052
1052
const std::string & section = sectionsByOldIndex.at (shndx);
1053
1053
assert (!section.empty ());
1054
- auto newIndex = findSection3 (section); // inefficient
1054
+ auto newIndex = getSectionIndex (section); // inefficient
1055
1055
// debug("rewriting symbol %d: index = %d (%s) -> %d\n", entry, shndx, section.c_str(), newIndex);
1056
1056
wri (sym->st_shndx , newIndex);
1057
1057
/* Rewrite st_value. FIXME: we should do this for all
0 commit comments