Add ELF TLS support in new x64 backend.
This follows the implementation in the legacy x86 backend, including hardcoded sequence that is compatible with what the linker expects. We could potentially do better here, but it is likely not necessary. Thanks to @bjorn3 for a bugfix to an earlier version of this.
This commit is contained in:
@@ -3904,6 +3904,17 @@ fn test_x64_emit() {
|
||||
let trap_code = TrapCode::UnreachableCodeReached;
|
||||
insns.push((Inst::Ud2 { trap_code }, "0F0B", "ud2 unreachable"));
|
||||
|
||||
insns.push((
|
||||
Inst::ElfTlsGetAddr {
|
||||
symbol: ExternalName::User {
|
||||
namespace: 0,
|
||||
index: 0,
|
||||
},
|
||||
},
|
||||
"66488D3D00000000666648E800000000",
|
||||
"elf_tls_get_addr User { namespace: 0, index: 0 }",
|
||||
));
|
||||
|
||||
// ========================================================
|
||||
// Actually run the tests!
|
||||
let mut flag_builder = settings::builder();
|
||||
|
||||
Reference in New Issue
Block a user