[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 13:16:46 PDT 2016


pcc added inline comments.

================
Comment at: ELF/Symbols.h:350-356
@@ -347,1 +349,9 @@
 
+  // This field is initially a pointer to the symbol's version definition. As
+  // symbols are added to the version table, this field is replaced with the
+  // version identifier to be stored in .gnu.version in the output file.
+  union {
+    const Elf_Verdef *Verdef;
+    uint16_t VersionId;
+  };
+
----------------
ruiu wrote:
> Ah, sorry, I intended to add comment here. Instead of adding uncooked Verdef, why don't you add the version string here?
Two mostly minor reasons.

1. We need to store an ELF hash in `Elf_Vernaux` (see OutputSections.cpp:1564). While we could compute it ourselves, there's no need to do that if we can use the hash from the input.

2. It allows us to use a pointer as our map key in `Verdefs` rather than a string.


http://reviews.llvm.org/D19464





More information about the llvm-commits mailing list