0001-Remove-apparently-incorrect-usage-of-static.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 2480efa8411523cf046094492192a5ee451aae5d Mon Sep 17 00:00:00 2001
  2. From: Eelco Dolstra <eelco.dolstra@logicblox.com>
  3. Date: Mon, 19 Sep 2016 17:31:37 +0200
  4. Subject: [PATCH] Remove apparently incorrect usage of "static"
  5. [Upstream-commit: https://github.com/NixOS/patchelf/commit/a365bcb7d7025da51b33165ef7ebc7180199a05e
  6. This patch also removes the DT_INIT symbols from needed_libs (DT_INIT
  7. points to library initialisation function, not to needed libraries...)]
  8. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
  9. ---
  10. src/patchelf.cc | 8 +++-----
  11. 1 file changed, 3 insertions(+), 5 deletions(-)
  12. diff --git a/src/patchelf.cc b/src/patchelf.cc
  13. index 136098f..c870638 100644
  14. --- a/src/patchelf.cc
  15. +++ b/src/patchelf.cc
  16. @@ -941,7 +941,6 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const string & newS
  17. assert(strTabAddr == rdi(shdrDynStr.sh_addr));
  18. /* Walk through the dynamic section, look for the DT_SONAME entry. */
  19. - static vector<string> neededLibs;
  20. dyn = (Elf_Dyn *) (contents + rdi(shdrDynamic.sh_offset));
  21. Elf_Dyn * dynSoname = 0;
  22. char * soname = 0;
  23. @@ -949,8 +948,7 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const string & newS
  24. if (rdi(dyn->d_tag) == DT_SONAME) {
  25. dynSoname = dyn;
  26. soname = strTab + rdi(dyn->d_un.d_val);
  27. - } else if (rdi(dyn->d_tag) == DT_INIT)
  28. - neededLibs.push_back(string(strTab + rdi(dyn->d_un.d_val)));
  29. + }
  30. }
  31. if (op == printSoname) {
  32. @@ -1058,7 +1056,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, string newRPath)
  33. unless you use its `--enable-new-dtag' option, in which case it
  34. generates a DT_RPATH and DT_RUNPATH pointing at the same
  35. string. */
  36. - static vector<string> neededLibs;
  37. + vector<string> neededLibs;
  38. dyn = (Elf_Dyn *) (contents + rdi(shdrDynamic.sh_offset));
  39. Elf_Dyn * dynRPath = 0, * dynRunPath = 0;
  40. char * rpath = 0;
  41. @@ -1091,7 +1089,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, string newRPath)
  42. /* For each directory in the RPATH, check if it contains any
  43. needed library. */
  44. if (op == rpShrink) {
  45. - static vector<bool> neededLibFound(neededLibs.size(), false);
  46. + vector<bool> neededLibFound(neededLibs.size(), false);
  47. newRPath = "";
  48. --
  49. 1.9.1