[PATCH] D19464: ELF: Create .gnu.version and .gnu.version_r sections when linking against versioned DSOs.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 12:37:10 PDT 2016


pcc added a comment.

http://reviews.llvm.org/D19490 fixes the issue I mentioned.


================
Comment at: ELF/InputFiles.h:251-253
@@ -245,3 +250,5 @@
   std::vector<StringRef> Undefs;
   StringRef SoName;
+  const Elf_Shdr *VersymSec = nullptr;
+  const Elf_Shdr *VerdefSec = nullptr;
 
----------------
ruiu wrote:
> A versioned symbol is identified only by its filename (soname) and version string, so I think it is better to add the version string field to this class, instead of adding raw VerdefSec and VerdefSec fields. It is I think easier to understand.
A DSO may contain multiple version definitions, so we can't just store a single version string here. The version of each symbol is stored in a field of type `const Elf_Verdef *` that I added to `SharedSymbol`.

================
Comment at: ELF/InputFiles.h:282
@@ +281,3 @@
+  // data structures in the output file.
+  std::map<const Elf_Verdef *, NeededVer> Verdefs;
+
----------------
ruiu wrote:
> Why don't you use DenseMap?
I need to be able to enumerate the values in this map deterministically. See comment at OutputSections.cpp:1559.


http://reviews.llvm.org/D19464





More information about the llvm-commits mailing list