[PATCH] D70146: [ELF] Improve --gc-sections compatibility with GNU ld regarding section groups

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 23:12:05 PST 2019


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lld/ELF/InputFiles.cpp:594
 
   for (size_t i = 0, e = objSections.size(); i < e; ++i) {
     if (this->sections[i] == &InputSection::discarded)
----------------
This is not your code, but could you please add a comment for this block since you add more code to this function? This block handles SHF_LINK_ORDER section flags.


================
Comment at: lld/ELF/InputSection.h:147
+  // used by --gc-sections.
+  InputSectionBase *nextInGroup = nullptr;
+
----------------
I'd probably name this sectionGroupNextMember or something like that, so that it is clear that "group" means "section group".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70146





More information about the llvm-commits mailing list