[PATCH] D23716: [ELF] Linkerscript: allow adding start/end symbols to arbitrary section

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 14:15:05 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/LinkerScript.cpp:321
@@ +320,3 @@
+                        OutputSectionBase<ELFT> *Sec) {
+  bool Start = true, LastSymType = Start;
+  for (std::unique_ptr<BaseCommand> &Base : Cmd->Commands) {
----------------
ruiu wrote:
> It seems unnecessarily complicated to me. Why don't you do something like this?
> 
>   // Add start symbols.
>   for (int I = 0, E = Cmd->Commands.size(); I < E; ++I) {
>     if (!isa<SymbolAssignment>(Cmd->Commands[I]))
>       break;
>     ....
>   }
> 
>   // Add end symbols.
>   for (int I = Cmd->Commands.size() - 1; I >= 0; --I) {
>     if (!isa<SymbolAssignment>(Cmd->Commands[I]))
>       break;
>     ....
>   }
> 
That's fine, but what about error diagnostics, you suggested to add last time?


https://reviews.llvm.org/D23716





More information about the llvm-commits mailing list