Skip to content

Commit

Permalink
Fix the replace -> add order
Browse files Browse the repository at this point in the history
  • Loading branch information
fzakaria committed Dec 17, 2021
1 parent 188af43 commit 02d6697
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/patchelf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,7 @@ void ElfFile<ElfFileParamNames>::shrinkWrap()

std::string soname = matches.str(1);
std::string location = matches.str(2);
debug("Found %s => %s\n", soname.c_str(), location.c_str());

// if the ELF file has this soname, then merely replace it
if (std::find(needed.begin(), needed.end(), soname) != needed.end()) {
Expand All @@ -1799,8 +1800,10 @@ void ElfFile<ElfFileParamNames>::shrinkWrap()
addNeededSet.insert(location);
}
}
addNeeded(addNeededSet);

//TODO: The order matters here. Why?
replaceNeeded(replaceNeededMap);
addNeeded(addNeededSet);
}

template<ElfFileParams>
Expand Down

0 comments on commit 02d6697

Please sign in to comment.