<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81804>81804</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLD parser accepts too much in input section wildcard patterns
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
lld:ELF
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mysterymath
</td>
</tr>
</table>
<pre>
We ran across an instance of strange parser behavior in LLD; it apparently is willing to accept the following as an input section wildcard:
```
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*)) }
PROVIDE_HIDDEN(__code_end = .)
```
There is a missing parenthesis after `.text*`; there should be three, not two. But LLD doesn't issue a diagnostic; it silently considers the all of the linker script up until the next paren as part of the pattern.
This appears to be considerably more lenient than GNU LD's wildcard pattern:
https://github.com/bminor/binutils-gdb/blob/363baa11378c6383eada19f6bc851fc7230c5dea/ld/ldlex.l#L95
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U01v4zYQ_TXUZRBDImVLOuiQrOxtAK-32KYtejIociyxpUiBHG3if19QdtIWWBQwhpyx5uO9x5ExmsEhtmz7xLZdJhcafWinayQM10nSmPVeX9vfEYJ0IFXwMYJ0YFwk6RSCv0CkIN2AMMsQMUCPo_xufADj4HjsmHgCQyDnWQZ0ZK9gIrwaa40bgDxIpXAmoBHh4q31ryku703mhSCiIuNdytFKBs3EI8s7lj-yXX7_3Vz-yHj9y9dvL-enP86Px-fPpy_708u_YqfHL3vG6w3hG61fN4w3wKruXmC18PO3r789d_vzT89dtz8xXp_Pyms8o9PARAeblPfDAVb7MmLAhFHCZGJMaG7IR4wpeiEMwHb5xxS7PFFEa1oc_WI19Ag0BkTGP4HzBPTqN_C0UOITtMfoGK8ITIwLggRt5OB8JKPuZEdjb1Qr76LRGOLKr7Q26ZWu1ri_MEBUwcwEywyLI2PXvxy-0W3kJMMsA70nzZIIg9v8F24CNc8oUxOfRn9vKnt7hckHBIvOoEsiSwefT7_CsWO8ih-Svlf-kHYkmmPy-IHxw2BoXPqN8hPjh34yzod0MW4hY-PDoPvkWp8OsRO9lEUhqlrtRC1Qalk0l12v6m1xURUXudpqlIwfrF6NxbeNZVwcm22mW6Eb0cgM26LKq2bLS15mY7utL5XKuVa6wl2PuRCq5IWWVb1tcl7XmWl5zsucFyUXhSjLzU7kAnVfqlrLCy8aVuY4SWM31n6fNj4M2apeWxd1XmZW9mjjuoWc98vAOGf8E-Pc2vTe98dDimy7LLQp_6FfhsjK3JpI8Z-KZMhim97IfRVvu5V08TAtakwr-eOlelcgZkuw7f_Qn5rdj4c5-D9REeOHFUtk_LDC-TsAAP__pF1kMg">