Explorar el Código

Add triple underscore tls_get_addr for x86

Jeremy Soller hace 2 años
padre
commit
afb5094cda
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      src/header/dl-tls/mod.rs

+ 7 - 0
src/header/dl-tls/mod.rs

@@ -38,3 +38,10 @@ pub unsafe extern "C" fn __tls_get_addr(ti: *mut dl_tls_index) -> *mut c_void {
         (*ti).ti_offset
     );
 }
+
+// x86 can define a version that does not require stack alignment
+#[cfg(target_arch = "x86")]
+#[no_mangle]
+pub unsafe extern "C" fn ___tls_get_addr(ti: *mut dl_tls_index) -> *mut c_void {
+    __tls_get_addr(ti)
+}