Sfoglia il codice sorgente

Merge branch 'LD_SO_ASM_REM' into 'master'

Get rid of assembly code in call_inits_finis

See merge request redox-os/relibc!282
Jeremy Soller 4 anni fa
parent
commit
d7089a09bf
1 ha cambiato i file con 2 aggiunte e 12 eliminazioni
  1. 2 12
      src/ld_so/linker.rs

+ 2 - 12
src/ld_so/linker.rs

@@ -865,16 +865,6 @@ impl Linker {
 }
 
 unsafe extern "C" fn call_inits_finis(addr: usize) {
-    #[cfg(target_arch = "x86_64")]
-    asm!("
-        cmp qword ptr [rdi], 0
-        je end
-        call [rdi]
-end:    nop
-        "
-        :
-        :
-        :
-        : "intel", "volatile"
-    );
+    let func = transmute::<usize, *const Option<extern "C" fn()>>(addr);
+    (*func).map(|x| x());
 }