[PATCH] D13958: Mere SHF_STRING

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 15:11:47 PDT 2015


ruiu added a comment.

Generally looks good, but can you add a few comments as I pointed out in the previous review?


================
Comment at: ELF/OutputSections.cpp:720-724
@@ -719,5 +719,7 @@
 template <class ELFT> void MergeOutputSection<ELFT>::writeTo(uint8_t *Buf) {
-  for (const std::pair<ArrayRef<uint8_t>, uintX_t> &P : Offsets) {
-    ArrayRef<uint8_t> Data = P.first;
+  if (shouldTailMerge()) {
+    StringRef Data = Builder.data();
     memcpy(Buf, Data.data(), Data.size());
-    Buf += Data.size();
+    return;
+  }
+  for (const std::pair<StringRef, size_t> &P : Builder.getMap()) {
----------------
This path should work for !shouldTailMerge() too, no?


http://reviews.llvm.org/D13958





More information about the llvm-commits mailing list