From a365bcb7d7025da51b33165ef7ebc7180199a05e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 19 Sep 2016 17:31:37 +0200 Subject: Remove apparently incorrect usage of "static" --- src/patchelf.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/patchelf.cc b/src/patchelf.cc index 80d680e..b489111 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -956,7 +956,6 @@ void ElfFile::modifySoname(sonameMode op, const std::string & assert(strTabAddr == rdi(shdrDynStr.sh_addr)); /* Walk through the dynamic section, look for the DT_SONAME entry. */ - static std::vector neededLibs; dyn = (Elf_Dyn *) (contents + rdi(shdrDynamic.sh_offset)); Elf_Dyn * dynSoname = 0; char * soname = 0; @@ -964,8 +963,7 @@ void ElfFile::modifySoname(sonameMode op, const std::string & if (rdi(dyn->d_tag) == DT_SONAME) { dynSoname = dyn; soname = strTab + rdi(dyn->d_un.d_val); - } else if (rdi(dyn->d_tag) == DT_INIT) - neededLibs.push_back(std::string(strTab + rdi(dyn->d_un.d_val))); + } } if (op == printSoname) { @@ -1074,7 +1072,7 @@ void ElfFile::modifyRPath(RPathOp op, unless you use its '--enable-new-dtag' option, in which case it generates a DT_RPATH and DT_RUNPATH pointing at the same string. */ - static std::vector neededLibs; + std::vector neededLibs; dyn = (Elf_Dyn *) (contents + rdi(shdrDynamic.sh_offset)); Elf_Dyn * dynRPath = 0, * dynRunPath = 0; char * rpath = 0; @@ -1107,7 +1105,7 @@ void ElfFile::modifyRPath(RPathOp op, /* For each directory in the RPATH, check if it contains any needed library. */ if (op == rpShrink) { - static std::vector neededLibFound(neededLibs.size(), false); + std::vector neededLibFound(neededLibs.size(), false); newRPath = ""; -- cgit v0.12