Skip to content

Commit 02d6697

Browse files
committed
Fix the replace -> add order
1 parent 188af43 commit 02d6697

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/patchelf.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1791,6 +1791,7 @@ void ElfFile<ElfFileParamNames>::shrinkWrap()
17911791

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

17951796
// if the ELF file has this soname, then merely replace it
17961797
if (std::find(needed.begin(), needed.end(), soname) != needed.end()) {
@@ -1799,8 +1800,10 @@ void ElfFile<ElfFileParamNames>::shrinkWrap()
17991800
addNeededSet.insert(location);
18001801
}
18011802
}
1802-
addNeeded(addNeededSet);
1803+
1804+
//TODO: The order matters here. Why?
18031805
replaceNeeded(replaceNeededMap);
1806+
addNeeded(addNeededSet);
18041807
}
18051808

18061809
template<ElfFileParams>

0 commit comments

Comments
 (0)