[PATCH] D43863: [ELF] - Do not remove empty sections that use symbols in expressions.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 02:57:33 PST 2018


jhenderson added inline comments.


================
Comment at: test/ELF/linkerscript/empty-sections-expressions.s:12-14
+# RUN: echo "SECTIONS { .debug_info foo : { *(.debug_info) } }" > %t2.script
+# RUN: not ld.lld -o %t --script %t2.script %t.o 2>&1 | FileCheck %s --check-prefix=ERR
+# ERR: symbol not found: foo
----------------
I think I'd personally prefer the test define foo and then checks to make sure that the section is emitted in this case, as that demonstrates the end effect better. We could change the underlying mechanism to detect errors and still remove the section, but then this test doesn't actually test the claimed behaviour.


https://reviews.llvm.org/D43863





More information about the llvm-commits mailing list