<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68974>68974</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLVM should generate RELA-type relocations on x86_64
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ambasta
</td>
</tr>
</table>
<pre>
With llvm + mold, linking `libmozsqlite` fails with ```REL-type relocation table is not supported for this target```
```
clang version 17.0.2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/17/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
System configuration file directory: /etc/clang
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/13
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/usr/bin/ld.mold" --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -shared -o libmozsqlite3.so /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/13 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/lib -L/lib -L/usr/lib -plugin /usr/lib/llvm/17/bin/../lib64/LLVMgold.so -plugin-opt=mcpu=znver1 -plugin-opt=O3 -plugin-opt=thinlto -plugin-opt=-function-sections=1 -plugin-opt=-data-sections=1 -z relro -z defs --gc-sections -h libmozsqlite3.so /var/tmp/portage/www-client/firefox-118.0.2/work/firefox_build/config/external/sqlite/libmozsqlite3_so.list -plugin-opt=-import-instr-limit=10 -plugin-opt=-import-hot-multiplier=30 -lpthread -O1 --as-needed --compress-debug-sections=zlib -rpath=/usr/lib64/firefox --enable-new-dtags -z pack-relative-relocs -z noexecstack -z text -z relro -z nocopyreloc -Bsymbolic-functions -rpath-link /var/tmp/portage/www-client/firefox-118.0.2/work/firefox_build/dist/bin -rpath-link /usr/lib --version-script libmozsqlite3.so.symbols -lm -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-pc-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crtn.o
mold: fatal: /tmp/lto-llvm-be7713.o: REL-type relocation table is not supported for this target
```
On discussion at the mold issue tracker, it has been pointed out that LLVM should be generating RELA-type relocations, instead of REL-type relocations on x86_64 (https://github.com/rui314/mold/issues/653#issuecomment-1761300733)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVl1v6zYP_jXKDSHDlpI4vshF27x-MaDDAXaG7bKQZdrWKkueJDdJf_0g2-hHTtazng0o1FgiKfIh9ZDCe9UaxD3Z3JLNYSXG0Fm3F30lfBCrytbn_e8qdKD1Uw-E3UJvdU3YHWhlHpVpgWxTrarePvs_tQpItik0QmkPx6hGtun898v_7mk4DwgOtZUiKGsgiEojKA_GBvDjMFgXsIbGOgid8hCEazG8mCDpgaQ3y_p-U2phWnhC56PdLE_ShM0nv842-A2cdtuH7ZoOkmplxhNtzbiIdA5FDb2tUUfBwXp1mo9-Mj4IrbE-KBePCCtH7wgrtariqp96wsosJ6yslJl17qxpVDu6OcZGaVw0MUjCyslVwsor7tDpLJFNO1v6evYBe5DfGIRaOZTBuvMV07MqapQRzP_f3YGao5j0r0TRSnndnxgaX4ISpla1CAj9qIOKivwGEsJvyTrtt-uLWz8SAsLYiwcRNVbqOpnLigGlnfAd9eEccTu0ZgRKsaONEz3SrnZAe0DdPMz-AvWdcFgDtfC2DHni7SfjZGWSfLtoVW3XEVsXVPJ5k9KFCltlviYW6P2ntD8r_1EAs63ZyuXu2xs-Ovuh26-La1W9eHRxEdBBj60y33tqF-m5v__t59bqOq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