[PATCH] D23751: [ELF] Linkerscript: define symbols outside SECTIONS

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 21 22:51:40 PDT 2016


phosek added inline comments.

================
Comment at: ELF/LinkerScript.cpp:274-278
@@ -263,7 +273,7 @@
   for (const std::unique_ptr<BaseCommand> &Base1 : Opt.Commands) {
     if (auto *Cmd = dyn_cast<SymbolAssignment>(Base1.get())) {
       if (shouldDefine<ELFT>(Cmd))
         addRegular<ELFT>(Cmd);
       continue;
     }
 
----------------
ruiu wrote:
> Now this can be removed, no?
Currently, there are two vectors that may contain assignments, `Assignments` and `Command` so we need both loops. I was thinking about using just one, but that doesn't seem to work since we need to iterate over assignments done within `SECTIONS` in `assignAddresses` in the correct order because of the `.`.


https://reviews.llvm.org/D23751





More information about the llvm-commits mailing list