bjorn3 opened issue #6778:
Steps to Reproduce
Write an AArch64 object file with a function using a TLS variable and link it using lld.
Expected Results
It links.
Actual Results
= note: ld.lld: error: /home/gh-bjorn3/rust/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/example/mini_core.mini_core.427c9c3b2a3159b4-cgu.0.rcgu.o:(function get_tls: .text+0x6d4): unknown relocation (513) against symbol mini_core::get_tls::A ld.lld: error: /home/gh-bjorn3/rust/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/example/mini_core.mini_core.427c9c3b2a3159b4-cgu.0.rcgu.o:(function get_tls: .text+0x6d8): unknown relocation (514) against symbol mini_core::get_tls::A collect2: error: ld returned 1 exit status
Versions and Environment
Cranelift version or commit: 92ccdcb8d68b586715957c2335031bc057e4876d
Operating system: Linux
Architecture: AArch64
Extra Info
Cranelift uses
R_AARCH64_TLSGD_ADR_PAGE21
andR_AARCH64_TLSGD_ADD_LO12_NC
relocations for TLS, which seems to be unsupported by lld. Instead I think TLSDESC has to be used. This is an improvement on the traditional__tls_get_addr
based TLS lookup: https://www.fsfla.org/~lxoliva/writeups/TLS/paper-lk2006.pdf
bjorn3 added the bug label to Issue #6778.
bjorn3 added the cranelift label to Issue #6778.
alexcrichton closed issue #6778:
Steps to Reproduce
Write an AArch64 object file with a function using a TLS variable and link it using lld.
Expected Results
It links.
Actual Results
= note: ld.lld: error: /home/gh-bjorn3/rust/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/example/mini_core.mini_core.427c9c3b2a3159b4-cgu.0.rcgu.o:(function get_tls: .text+0x6d4): unknown relocation (513) against symbol mini_core::get_tls::A ld.lld: error: /home/gh-bjorn3/rust/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/example/mini_core.mini_core.427c9c3b2a3159b4-cgu.0.rcgu.o:(function get_tls: .text+0x6d8): unknown relocation (514) against symbol mini_core::get_tls::A collect2: error: ld returned 1 exit status
Versions and Environment
Cranelift version or commit: 92ccdcb8d68b586715957c2335031bc057e4876d
Operating system: Linux
Architecture: AArch64
Extra Info
Cranelift uses
R_AARCH64_TLSGD_ADR_PAGE21
andR_AARCH64_TLSGD_ADD_LO12_NC
relocations for TLS, which seems to be unsupported by lld. Instead I think TLSDESC has to be used. This is an improvement on the traditional__tls_get_addr
based TLS lookup: https://www.fsfla.org/~lxoliva/writeups/TLS/paper-lk2006.pdf
Last updated: Dec 23 2024 at 12:05 UTC