[PATCH] D44376: [ELF] - Drop special flags for empty output sections.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 13:24:19 PDT 2018


ruiu added inline comments.


================
Comment at: lld/trunk/ELF/LinkerScript.cpp:859-862
+    if (IsEmpty && isDiscardable(*Sec)) {
       Sec->Live = false;
       Cmd = nullptr;
     }
----------------
I believe this patch is correct, but this logic seems a bit weird to me. If an section is empty, we reset the section flag, but we also discard the section. If the section is discarded, why does its flag matter? Why do you have to reset it just before discarding it?


Repository:
  rL LLVM

https://reviews.llvm.org/D44376





More information about the llvm-commits mailing list