X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fldso-stubs.S;h=98f73f1551186f4de9b863a4f7aeeac63840c728;hb=f10dce4be24d44e1db0fb3d5b1d3689d6caa062a;hp=37006fb3e34ad39503941c301dafaf79a5857c49;hpb=db0691b05cc99ce010ecae78bb532b594aea1859;p=sbcl.git diff --git a/src/runtime/ldso-stubs.S b/src/runtime/ldso-stubs.S index 37006fb..98f73f1 100644 --- a/src/runtime/ldso-stubs.S +++ b/src/runtime/ldso-stubs.S @@ -26,6 +26,7 @@ */ #define LANGUAGE_ASSEMBLY #include "sbcl.h" + .text #if defined LISP_FEATURE_X86 @@ -58,7 +59,7 @@ ldso_stub__ ## fct: ; \ .L ## fct ## e1: ; \ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; -#elif defined LISP_FEATURE_PPC +#elif ((defined LISP_FEATURE_PPC) && (defined LISP_FEATURE_LINUX)) #define LDSO_STUBIFY(fct) \ .globl ldso_stub__ ## fct ; \ .type ldso_stub__ ## fct,@function ; \ @@ -66,6 +67,24 @@ ldso_stub__ ## fct: ; \ b fct ; \ .L ## fct ## e1: ; \ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; + +#elif ((defined LISP_FEATURE_PPC) && (defined LISP_FEATURE_DARWIN)) +#define LDSO_STUBIFY(fct) @\ +.text @\ +.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 #elif defined LISP_FEATURE_SPARC @@ -80,6 +99,33 @@ ldso_stub__ ## fct: ; \ nop /* delay slot*/ ; \ .L ## fct ## e1: ; \ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; + +#elif defined LISP_FEATURE_MIPS + +/* KLUDGE: set up the vital fifth argument, passed on the + stack. Do this unconditionally, even if the stub is for a + function with few arguments: it can't hurt. We only do this for + the fifth argument, as the first four are passed in registers + and we apparently don't ever need to pass six arguments to a + libc function. -- CSR, 2003-10-29 */ + +#define LDSO_STUBIFY(fct) \ +.globl ldso_stub__ ## fct ; \ + .type ldso_stub__ ## fct,@function ; \ +ldso_stub__ ## fct: ; \ + addiu $29,-48 ; \ + sw $28,40($29) ; \ + sw $31,44($29) ; \ + lw $25,64($29) ; \ + sw $25,16($29) ; \ + la $25, fct ; \ + jalr $25 ; \ + lw $31,44($29) ; \ + lw $28,40($29) ; \ + addiu $29,48 ; \ + jr $31 ; \ +.L ## fct ## e1: ; \ + .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; #else #error unsupported CPU architecture @@ -104,10 +150,12 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(connect) LDSO_STUBIFY(cosh) LDSO_STUBIFY(creat) +#ifndef LISP_FEATURE_DARWIN LDSO_STUBIFY(dlclose) LDSO_STUBIFY(dlerror) LDSO_STUBIFY(dlopen) LDSO_STUBIFY(dlsym) +#endif LDSO_STUBIFY(dup) LDSO_STUBIFY(dup2) LDSO_STUBIFY(execve) @@ -165,6 +213,7 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(send) LDSO_STUBIFY(setitimer) LDSO_STUBIFY(setpgrp) + LDSO_STUBIFY(setsid) #if !defined(SVR4) LDSO_STUBIFY(sigsetmask) #endif @@ -198,7 +247,7 @@ ldso_stub__ ## fct: ; \ * Note: There might be some other functions in this category as well. * E.g. I notice tanh() and acos() in the list above.. -- WHN 2001-06-07 */ -#if !defined __i386__ +#if !defined LISP_FEATURE_X86 LDSO_STUBIFY(sin) LDSO_STUBIFY(cos) LDSO_STUBIFY(tan)