[PATCH] D22683: [ELF] Symbol assignment within input section list

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 14:50:23 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:813-816
@@ -755,1 +812,6 @@
+  else
+    // The section definition contains only symbols or nothing at all.
+    // Make all symbols global and discard the section.
+    std::move(Cmd->Commands.begin(), Cmd->Commands.end(),
+              std::back_inserter(Opt.Commands));
 }
----------------
evgeny777 wrote:
> ruiu wrote:
> > evgeny777 wrote:
> > > ruiu wrote:
> > > > Why do you need to handle this case as a special case?
> > > You can have script like this:
> > > 
> > > ```
> > > SECTIONS { .dummy { a = .; b = . + 2; } }
> > > ```
> > > 
> > > There are no input sections, so output section will never be created, so you can't add symbols anywhere.
> > > 
> > Is it a real use case? I'm inclined not to add code to handle special cases.
> I don't know. This mostly addresses Davide test case (linkerscript-provide-in-sections.s). This is also what gold does in such cases.
> If you want to remove this, is it ok to remove the test case then?
Yeah, please remove it from this patch. We can add it later if we actually need it.


https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list