summaryrefslogtreecommitdiff
path: root/src/patchelf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/patchelf.cc')
-rw-r--r--src/patchelf.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index 06f41c6..6148abd 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -1636,6 +1636,10 @@ void ElfFile<ElfFileParamNames>::replaceNeeded(const std::map<std::string, std::
debug("found .gnu.version_r with %i entries, strings in %s\n", verNeedNum, versionRStringsSName.c_str());
unsigned int verStrAddedBytes = 0;
+ // It may be that it is .dynstr again, in which case we must take the already
+ // added bytes into account.
+ if (versionRStringsSName == ".dynstr")
+ verStrAddedBytes += dynStrAddedBytes;
auto need = (Elf_Verneed *)(fileContents->data() + rdi(shdrVersionR.sh_offset));
while (verNeedNum > 0) {