[PATCH] D65018: [LLD] [COFF] Unbreak sorting of mingw comdat .tls sections after SVN r363457

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 13:46:52 PDT 2019


rnk added inline comments.


================
Comment at: COFF/Writer.cpp:827
-    // imply separate alphabetical sorting of those section chunks though.
-    if (config->mingw && sc && sc->isCOMDAT())
       name = name.split('$').first;
----------------
To improve the readability, I'd make the condition a helper. I suppose it needs sc and name. You can elaborate on the whitelist/blacklist reasoning there.


================
Comment at: COFF/Writer.cpp:833
+    // .eh_frame.
+    if (config->mingw && sc && sc->isCOMDAT() && name.startswith(".eh_frame$"))
       name = name.split('$').first;
----------------
I think I would apply the same logic to the standard sections of .text, .data, .rdata, .pdata, and .xdata. Otherwise we'll make three unneeded PartialSections for every inline function on x64 and do more sorting than necessary.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65018/new/

https://reviews.llvm.org/D65018





More information about the llvm-commits mailing list