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

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 14:48:07 PDT 2016


evgeny777 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));
 }
----------------
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?


https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list