[PATCH] D22660: [ELF/LinkerScript] Support ONLY_IF_{RO, RW} directive

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 19:53:37 PDT 2016


davide added inline comments.

================
Comment at: ELF/LinkerScript.cpp:282
@@ +281,3 @@
+         Constraint == ReadOnly) {
+      Sec->DiscardFromOutput = true;
+      return;
----------------
ruiu wrote:
> Why don't you set Live flag of the section to false?
>From what I see OutputSections have no Live flag, so, I assume you mean InputSections.
I'm not very familiar with the gc code, so I'll ask you. Is marking a single InputSection "dead" enough to prevent the output section to appear in the output?
You set the Live flag to false while processing `\DISCARD\` in order to avoid input sections to appear in the output, but the semantic is a little bit different here.

Thanks!


https://reviews.llvm.org/D22660





More information about the llvm-commits mailing list