[PATCH] D38170: [ELF] - Drop SHF_LINK_ORDER flag from output.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 05:04:30 PDT 2017


grimar added inline comments.


================
Comment at: ELF/Driver.cpp:976
 
+static void scanLinkOrder() {
+  for (InputSectionBase *S : InputSections) {
----------------
ruiu wrote:
> This is not something I meant by "drop it early when it is processed". It just drops the flag at an arbitrary point instead of when SHF_LINK_ORDER is processed. Also, this kind of code shouldn't be in the driver.
It is processed in `OutputSection::finalize()` because at that place we know the order of output sections and can sort input sections in according to order flags. I could drop the flag there, but it would make this patch useless, since its aim not just to drop the flag (it is itself harmless in output I believe), but do that before we create sections in `adjustSectionsBeforeSorting`, so that SHF_LINK_ORDER flag do not spread on them.


https://reviews.llvm.org/D38170





More information about the llvm-commits mailing list