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

    <tr>
        <th>Summary</th>
        <td>
            [PowerPC] relocation R_PPC64_TOC16_DS out of range: 43024 is not in [-32768, 32767]
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    FreeBSD 13.1 / powerpc64le
lld 13.0.0 and 14.0.1:
```
ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__scrape_1002: .text+0x38): relocation R_PPC64_TOC16_DS out of range: 43024 is not in [-32768, 32767]
>>> referenced by mtype.ml:25 (typing/mtype.ml:25)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__freshen_1358: .text+0xd4): relocation R_PPC64_TOC16_DS out of range: 43032 is not in [-32768, 32767]
>>> referenced by mtype.ml:33 (typing/mtype.ml:33)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__freshen_1358: .text+0xe0): relocation R_PPC64_TOC16_DS out of range: 42496 is not in [-32768, 32767]
>>> referenced by mtype.ml:33 (typing/mtype.ml:33)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__freshen_1358: .text+0xe4): relocation R_PPC64_TOC16_DS out of range: 43080 is not in [-32768, 32767]
>>> referenced by mtype.ml:34 (typing/mtype.ml:34)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_1387: .text+0x1a0): relocation R_PPC64_TOC16_DS out of range: 42984 is not in [-32768, 32767]
>>> referenced by mtype.ml:39 (typing/mtype.ml:39)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_1387: .text+0x1c0): relocation R_PPC64_TOC16_DS out of range: 42816 is not in [-32768, 32767]
>>> referenced by ident.ml:43 (typing/ident.ml:43)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_1387: .text+0x28c): relocation R_PPC64_TOC16_DS out of range: 42928 is not in [-32768, 32767]
>>> referenced by mtype.ml:40 (typing/mtype.ml:40)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_sig_1388: .text+0x2dc): relocation R_PPC64_TOC16_DS out of range: 43120 is not in [-32768, 32767]
>>> referenced by mtype.ml:50 (typing/mtype.ml:50)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_sig_1388: .text+0x3bc): relocation R_PPC64_TOC16_DS out of range: 42976 is not in [-32768, 32767]
>>> referenced by mtype.ml:58 (typing/mtype.ml:58)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_sig_1388: .text+0x7f8): relocation R_PPC64_TOC16_DS out of range: 43000 is not in [-32768, 32767]
>>> referenced by mtype.ml:95 (typing/mtype.ml:95)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_sig_1388: .text+0x938): relocation R_PPC64_TOC16_DS out of range: 42928 is not in [-32768, 32767]
>>> referenced by mtype.ml:77 (typing/mtype.ml:77)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__strengthen_decl_1389: .text+0xa40): relocation R_PPC64_TOC16_DS out of range: 42928 is not in [-32768, 32767]
>>> referenced by mtype.ml:106 (typing/mtype.ml:106)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__make_aliases_absent_2251: .text+0xa6c): relocation R_PPC64_TOC16_DS out of range: 42488 is not in [-32768, 32767]
>>> referenced by mtype.ml:112 (typing/mtype.ml:112)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(envaux.o):(function camlEnvaux__reset_cache_1254: .text+0x18): relocation R_PPC64_TOC16_DS out of range: 43248 is not in [-32768, 32767]
>>> referenced by envaux.ml:27 (typing/envaux.ml:27)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__make_aliases_absent_2251: .text+0xb6c): relocation R_PPC64_TOC16_DS out of range: 42928 is not in [-32768, 32767]
>>> referenced by mtype.ml:112 (typing/mtype.ml:112)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(envaux.o):(function camlEnvaux__reset_cache_1254: .text+0x30): relocation R_PPC64_TOC16_DS out of range: 43344 is not in [-32768, 32767]
>>> referenced by envaux.ml:29 (typing/envaux.ml:29)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(envaux.o):(function camlEnvaux__env_from_summary_1256: .text+0x70): relocation R_PPC64_TOC16_DS out of range: 43320 is not in [-32768, 32767]
>>> referenced by envaux.ml:31 (typing/envaux.ml:31)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__make_aliases_absent_sig_2252: .text+0xcd4): relocation R_PPC64_TOC16_DS out of range: 42928 is not in [-32768, 32767]
>>> referenced by mtype.ml:130 (typing/mtype.ml:130)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(envaux.o):(function camlEnvaux__env_from_summary_1256: .text+0x88): relocation R_PPC64_TOC16_DS out of range: 43368 is not in [-32768, 32767]
>>> referenced by envaux.ml:31 (typing/envaux.ml:31)

ld.lld: error: wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.07.1/compilerlibs/ocamlcommon.a(mtype.o):(function camlMtype__scrape_for_type_of_2268: .text+0xd0c): relocation R_PPC64_TOC16_DS out of range: 42528 is not in [-32768, 32767]
>>> referenced by mtype.ml:145 (typing/mtype.ml:145)

ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
```
The reproduction archive is available at http://people.freebsd.org/~pkubaj/ocaml-repro.tar.zst
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztmUtvpDgQxz8NfbGCjG0ePvQhz9tqopm5IwNFmgnglm3y2E-_ZUhmtltCWRGkpKOVWo2hTLn846_ChQtdPW9vDMDFjysS8TAiAbshe_0IZl8mooWAXgX0vG0rb6UhJarHpsBmFPDzyRok9OU3da5C7I9WAsZo4xuP5r5qjEXfgzX4v9fG-bNW9Xd40KXqWjw-anP_enqGY6Q4CLspdbdvWjBtU9hXK17rdB-qgGWde95DqAMmfUAsq4e-dI3uie_3lzfmuS2NwmNEKfPhhA6eXMAu6BPPpvuIgRYdj_d9z29vLxOR__x2GSX51Q-iB0d0TQwGC76v4JQJ0ljSa0eangTxxRlnaYK-LolvpEF89YKGX08_HKAGA30JFSmeyRQ0TpqfsxiZZ3jejCwOLD64yc9nJVsbsDvo84jH2SHaSixDy9lqaDmfQ8v5KaMFugQtEzL5H-1baBeqNqProRWzaMXnR2sdTurOTXSz9JBupJ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