[PATCH] D24127: [ELF] - Linkerscript: create multiple output sections for inputs with different attributes.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 18:22:22 PDT 2016


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

Sorry for the belated response. Let's try this. LGTM.


================
Comment at: ELF/LinkerScript.cpp:366
@@ -366,2 +365,3 @@
+static std::vector<OutputSectionBase<ELFT> *>
 findSection(OutputSectionCommand &Cmd,
             ArrayRef<OutputSectionBase<ELFT> *> Sections) {
----------------
findSection*s*

================
Comment at: ELF/LinkerScript.cpp:368
@@ -367,2 +367,3 @@
             ArrayRef<OutputSectionBase<ELFT> *> Sections) {
+  std::vector<OutputSectionBase<ELFT> *> Out;
   for (OutputSectionBase<ELFT> *Sec : Sections) {
----------------
Out -> Ret (it is more conventional.)

================
Comment at: ELF/LinkerScript.cpp:369-373
@@ -368,6 +368,7 @@
+  std::vector<OutputSectionBase<ELFT> *> Out;
   for (OutputSectionBase<ELFT> *Sec : Sections) {
     if (Sec->getName() != Cmd.Name)
       continue;
     if (checkConstraint(Sec->getFlags(), Cmd.Constraint))
-      return Sec;
+      Out.push_back(Sec);
   }
----------------
  for (OutputSectionBase<ELFT> *Sec : Sections)
    if (Sec->getName() == Cmd.Name && checkConstraint(Sec->getFlags(), Cmd.Constraint))
      Out.push_back(Sec);


https://reviews.llvm.org/D24127





More information about the llvm-commits mailing list