[lld] [ELF] Reject error-prone meta characters in input section description (PR #84130)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 09:23:32 PST 2024


================
@@ -91,24 +91,31 @@ SECTIONS {
   .text : { *([.]abc .ab[v-y] ) }
 }
 
-## Test a few non-wildcard meta characters rejected by GNU ld.
+## Test a few non-wildcard characters rejected by GNU ld.
 
 #--- lbrace.lds
-# RUN: ld.lld -T lbrace.lds a.o -o out
+# RUN: not ld.lld -T lbrace.lds a.o 2>&1 | FileCheck %s --check-prefix=ERR-LBRACE --match-full-lines --strict-whitespace
+#      ERR-LBRACE:{{.*}}: section pattern is expected
+# ERR-LBRACE-NEXT:>>>   .text : { *(.a* { ) }
----------------
MaskRay wrote:

Thanks for the suggestion. Updated. Changed `s.size() == 1` to `!s.empty()` to be clearer that we just guard again `""` special case.

https://github.com/llvm/llvm-project/pull/84130


More information about the llvm-commits mailing list