[PATCH] D24450: [ELF] Linkerscript: improve handling of ASSERT and symbol assignment outside SECTIONS block

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 02:23:05 PDT 2016


atanasyan added inline comments.

================
Comment at: ELF/Writer.cpp:258
@@ -259,1 +257,3 @@
+    Script<ELFT>::X->processCommands(Factory);
+  }
 
----------------
>> Is it important that we call processCommands in the beginning of the LinkerScript::createSections but after the Writer::createSections?
> Yes. You can now use section size and alignment in expressions, even though you may have no SECTIONS block at all.

OK. Is it possible to rewrite the code like that? The idea is to make clear that we always call the `processCommands`.

```
if (ScriptConfig->HasSections)
  Script<ELFT>::X->createSections(Factory);
else
  createSections();
Script<ELFT>::X->processCommands(Factory);
```


https://reviews.llvm.org/D24450





More information about the llvm-commits mailing list