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

    <tr>
        <th>Summary</th>
        <td>
            [lld][X86] unknown relocation (18) -- X86_64_TPOFF64 when linking code with TLS under large code model
        </td>
    </tr>

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

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

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

<pre>
    LLD aborts when it encounters a `X86_64_TPOFF64` relocation, which is emitted for TLS accesses under a large code model. To reproduce the crash, try linking the attached object file:
```sh
./build/bin/ld.lld tls64.o
```

This produces the error:
```
ld.lld: error: large.o:(function main: .ltext+0x2): unknown relocation (18) against symbol x
```
[tls64.zip](https://github.com/llvm/llvm-project/files/13850215/tls64.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk81upDgQgJ_GXEpBxmCaPnBIb4tTpF1p-5Bb5J8CvDF2yzbbyTz9yJBMZjKjkUZCWP6pctWnzyJGMznEnvAT4edCrGn2oXeLjwZDIb1-7R8eziCkDynCbUYHJgE65VeXMEQQQFr62LVPbfN0-efvYWgb0lIIaL0SyXhH2F9wm42awUTAxaSEGkYf4PLwLwilMEaMsDqNAQRYESYE5TXC4jXaEi4eAl6D16tCSDOCCiLOOWsKr2CNezZu2jZESkLNqMHL_1AlGI1FUt8Teib0nrR0_-K8L5SEDXI1VufROMIGq0trNSQb26b0n8Leptv_MpsIbyXF7WoMwYef79qne15S3387trdZ-hzBunF1KpOCRRiXd0ub8CURdqIvjLBjXlrds_M39x1XIKyrOsKOICZhXEwQXxfpLbz8unJ-2hv7Yq6Enwnr5pSucatgIGyYTJpXWSq_ZBL2__fh7hp8pknYkHlGwoaq7jhlFSds-EjJjoXua32sj6LAvjrQhnPeNk0x9xrrdjzIujtIVIp1sq5F242UHjrOucTC9Iyyhla0rXhDm7ocJaUUW1EdpW7GuiENxUUYW-aKSh-mwsS4Yn84MFoVVki0cVOYsUyasexy6Lf65TpF0lBrYoof8ckku1mfz_Mz4afHriX8_FvQd3fwo-n7g3h3cLP2ZtK8qb0b_dnnYg22_2PyW7cZ_dbw1wAAAP__GKcmuw">