[PATCH] D70020: [lld] Better support for group semantic wrt. notes

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 17:50:10 PST 2019


MaskRay added inline comments.


================
Comment at: lld/ELF/InputFiles.cpp:509
 
+  SmallVector<ArrayRef<Elf_Word>, 4> groups;
+
----------------
Maybe we should just use `std::vector`. When an object file contains section groups, there can be many. 4 is probably not better than 0. The code size increase is probably unnecessary.


================
Comment at: lld/ELF/InputFiles.cpp:638
+        for (InputSection *note : notes) {
+          note->dependentSections.push_back(
+              cast<InputSection>(this->sections[secIndex]));
----------------
I think `note->dependentSections` only carries one-bit information: whether it is in a group or not. How many sections and what sections it depends on does not matter.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70020





More information about the llvm-commits mailing list