Fangrui Song 551e20d190
[ELF] Reject error-prone meta characters in input section description
The lexer is overly permissive. When parsing file patterns in an input
section description and there is a missing `)`, we would accept many
non-sensible tokens (e.g. `}`) as patterns, leading to confusion, e.g.
`*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*)) } PROVIDE_HIDDEN(__code_end = .)`
(#81804).

Ideally, the lexer should be stateful to report more errors like GNU ld
and get rid of hacks like `ScriptLexer::maybeSplitExpr`, but that would
require a large rewrite of the lexer. For now, just reject certain
non-wildcard meta characters to detect common mistakes.

Pull Request: https://github.com/llvm/llvm-project/pull/84130
2024-03-06 17:19:59 -08:00
..
2023-05-02 09:34:48 +08:00
2023-08-21 09:11:51 -07:00
2024-01-22 09:09:46 -08:00
2023-07-18 17:57:31 -07:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2022-10-24 10:54:09 -07:00
2023-07-18 17:57:31 -07:00
2022-10-24 10:54:09 -07:00