Skip to content

Commit 0a64a88

Browse files
yuta-hayamaMic92
authored andcommitted
Set interpreter only when necessary
If the given interpreter is already set, nothing needs to be done. As with modifySoname(), it skips unnecessary processing.
1 parent fd9c6de commit 0a64a88

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/patchelf.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,11 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const std::string &
14591459
template<ElfFileParams>
14601460
void ElfFile<ElfFileParamNames>::setInterpreter(const std::string & newInterpreter)
14611461
{
1462+
if (getInterpreter() == newInterpreter) {
1463+
debug("given interpreter is already set\n");
1464+
return;
1465+
}
1466+
14621467
std::string & section = replaceSection(".interp", newInterpreter.size() + 1);
14631468
setSubstr(section, 0, newInterpreter + '\0');
14641469
changed = true;

0 commit comments

Comments
 (0)