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

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 05:23:31 PDT 2016


evgeny777 added a comment.

I have feeling that by now HasContents has no meaning at all. Even without this patch there are occasions when HasContents is false, but linker script is not empty. Like when you have only symbol assignments.


================
Comment at: ELF/Writer.cpp:258
@@ -259,1 +257,3 @@
+    Script<ELFT>::X->processCommands(Factory);
+  }
 
----------------
atanasyan wrote:
> Is it important that we call `processCommands` in the beginning of the `LinkerScript::createSections` but after the `Writer::createSections`? If it does not matter, for my taste it is better to remove the `processCommands` call from the `LinkerScript::createSections` and do it here to accentuate that we always process commands from linker scripts.
> 
> ```
>   Script<ELFT>::X->processCommands(Factory);
>   if (ScriptConfig->HasSections)
>     Script<ELFT>::X->createSections(Factory);
>   else
>     createSections();
> ```
Yes. You can now use section size and alignment in expressions, even though you may have no SECTIONS block at all. 





Repository:
  rL LLVM

https://reviews.llvm.org/D24450





More information about the llvm-commits mailing list