[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 09:29:28 PDT 2016


pcc added inline comments.

================
Comment at: ELF/InputFiles.cpp:452
@@ +451,3 @@
+    // sequentially starting from 1, so we predict that the largest identifier
+    // will be VerdefCount+1.
+    unsigned VerdefCount = VerdefSec->sh_info;
----------------
grimar wrote:
> VerdefCount + 1
The comment was incorrect, it should have read VerdefCount. Updated.

================
Comment at: ELF/InputFiles.h:278
@@ +277,3 @@
+  // Used for symbol versioning
+
+  struct NeededVer {
----------------
grimar wrote:
> Excessive empty line, no dot at the end of comment.
I wanted to delimit these members from the ones used for `--as-needed`. But I can probably do that by moving them above the `--as-needed` members instead.

================
Comment at: ELF/OutputSections.cpp:1508
@@ +1507,3 @@
+    return;
+  Out<ELFT>::VerNeed->addSymbol(SS);
+}
----------------
grimar wrote:
> I would write:
> ```
> if (auto *SS = dyn_cast<SharedSymbol<ELFT>>(B))
>   Out<ELFT>::VerNeed->addSymbol(SS);
> ```
Yes. Also moved this code to the caller and removed this function.


http://reviews.llvm.org/D19464





More information about the llvm-commits mailing list