<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/77286>77286</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lld][ELF] lld reports error when region name in Memory Command contains symbol -
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Yunzezhu94
      </td>
    </tr>
</table>

<pre>
    When link with linker script like:
```
MEMORY
{
        A-XXXX : ORIGIN = 0x0        , LENGTH = 0x20000
        B-YYYY : ORIGIN = 0x200000 , LENGTH = 0x40000
        C-ZZZZ : ORIGIN = 0x400000 , LENGTH = 0x80000
}
```
lld reports error:
`: expected, but got -`
while gnu ld will not report error with same linker script.
This is because when processing tokens lld treats string as Expr and split in function tokenizeExpr, so symbol - , rather than symbol : is regard as end of region name.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0k99uozwQxZ_G3IwSOQYCXHCRNEm_Sv0jVZW-JHcGT8BbYyPbbNo-_cqE7bbKLkLCMPM78jkeuHOy0YglSdck3UR88K2x5WHQH_jRDkUSVUa8l_-3qEFJ_Qpn6dtxhRZcbWXvQclXJPGK0A2hK7Kk0z2-Pmwfnp4PUylbTwtarGb7_X4PJF7B0_Pd7d0jkHgD9I3CdBF2A_fbx9uX_6YKo5TST349OxwOh2t-7KLXdPKNvpkdj8fjNZ38g86_0Nnmr0aVEmCxN9Y7QGuN_ZZIvAJ867H2KIJ4NXhojIfZJ35upUJo9ABKwFkqBdr4SfCid0ne8Q6_xz-_CLy00oF0UGHNB4dwDifWW1Ojc1I34M0ragdhm94i9w6ct6HAHWzfegtcC3C9kh6khtOgay-NvmDyA0NL2Lkz4N67yiiYjTFZ7lu04FuufxeCWenAYsOtCPKoBZhT-BAUNe9wHokyFkVc8AjLRUaTjMZFQqO2FGJZsXhZsTSnBauzPFks-alCQUVxOtE6kiWjLKELmtM8ZYzOc8rpIkuFEJicsFqShGLHpZor9bObG9tE0rkByyxj-TJSvELlxmlnTClBGAtjb8vQPauGxpGEKum8-8N76dX4g4T-dEPS9fZ-R9INXJ35JfUvRkOWD9gZ-w43putCxrXRnkvtPnOMBqvK1vvehZFhO8J2jfTtUM1r0xG2C_uYHrPemh9Ye8J2oylH2G709SsAAP__GT0mvQ">