-.globl ldso_stub___ ## fct @\\
-ldso_stub___ ## fct: @\\
- b ldso_stub__ ## fct ## stub @\\
-.symbol_stub ldso_stub__ ## fct ## stub: @\\
-.indirect_symbol _ ## fct @\\
- lis r11,ha16(ldso_stub__ ## fct ## $lazy_ptr) @\\
- lwz r12,lo16(ldso_stub__ ## fct ## $lazy_ptr)(r11) @\\
- mtctr r12 @\\
- addi r11,r11,lo16(ldso_stub__ ## fct ## $lazy_ptr) @\\
- bctr @\\
-.lazy_symbol_pointer @\\
-ldso_stub__ ## fct ## $lazy_ptr: @\\
- .indirect_symbol _ ## fct @\\
- .long dyld_stub_binding_helper"
-
-;;; KLUDGE: set up the vital fifth argument, passed on the
+.globl _ldso_stub___ ## fct @\\
+_ldso_stub___ ## fct: @\\
+ b ldso_stub__ ## fct ## stub @\\
+.symbol_stub ldso_stub__ ## fct ## stub: @\\
+.indirect_symbol _ ## fct @\\
+ lis r11,ha16(ldso_stub__ ## fct ## $lazy_ptr) @\\
+ lwz r12,lo16(ldso_stub__ ## fct ## $lazy_ptr)(r11) @\\
+ mtctr r12 @\\
+ addi r11,r11,lo16(ldso_stub__ ## fct ## $lazy_ptr) @\\
+ bctr @\\
+.lazy_symbol_pointer @\\
+ldso_stub__ ## fct ## $lazy_ptr: @\\
+ .indirect_symbol _ ## fct @\\
+ .long dyld_stub_binding_helper"
+
+;;; darwin x86 assembler is weird and follows the ppc assembler syntax
+#!+(and darwin x86) "
+#define LDSO_STUBIFY(fct) \\
+.text ; \\
+ .align 4 ; \\
+.globl _ldso_stub___ ## fct ; \\
+_ldso_stub___ ## fct: ; \\
+ jmp L ## fct ## $stub ; \\
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5 ; \\
+L ## fct ## $stub: ; \\
+ .indirect_symbol _ ## fct ; \\
+ hlt ; \\
+ hlt ; \\
+ hlt ; \\
+ hlt ; \\
+ hlt ; \\
+ .subsections_via_symbols ; "
+
+;;; darwin x86-64
+#!+(and darwin x86-64) "
+#define LDSO_STUBIFY(fct) \\
+ .align 4 ; \\
+.globl _ldso_stub___ ## fct ; \\
+_ldso_stub___ ## fct: ; \\
+ jmp _ ## fct ; \\
+.L ## fct ## e1: ; "
+
+;;; KLUDGE: set up the vital fifth argument, passed on the