[PATCH] D95749: [ELF] Make SHF_GNU_RETAIN sections GC roots

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 01:47:07 PST 2021


jhenderson added inline comments.


================
Comment at: lld/ELF/MarkLive.cpp:267
+      continue;
+    }
     if (sec->flags & SHF_LINK_ORDER)
----------------
Nit: should we have a blank line after this if statement? It's somewhat unrelated to SHF_LINK_ORDER after all.


================
Comment at: lld/test/ELF/gc-sections-retain.s:26
+
+# ERR: error: {{.*}}.o:(.nonalloc): sh_link points to discarded section {{.*}}.o:(.discard)
+
----------------
Should we use `FileCheck -DFILE=%t1.o` to check the files in the error message are correct?


================
Comment at: lld/test/ELF/gc-sections-retain.s:37
+
+.ifdef NONALLOC
+.section .discard,"a", at progbits
----------------
Maybe it would be simpler to use split-file to create two input files? The ifdef makes the test somewhat less readable to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95749/new/

https://reviews.llvm.org/D95749



More information about the llvm-commits mailing list