X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fldso-stubs.S;h=73ef19f081df5783364fed779b6db5929470e1a8;hb=1b650be8b800cf96e2c268ae317fb26d0bf36827;hp=360cf9cc8870c02a4ad630ebe08e4499facd8db2;hpb=83fd554b67913275d8dc06edcad8b2f065c89c49;p=sbcl.git diff --git a/src/runtime/ldso-stubs.S b/src/runtime/ldso-stubs.S index 360cf9c..73ef19f 100644 --- a/src/runtime/ldso-stubs.S +++ b/src/runtime/ldso-stubs.S @@ -2,8 +2,11 @@ * stubs for C-linkage library functions which we need to refer to * from Lisp * - * These exist for the benefit of Lisp code that needs to refer to - * foreign symbols when dlsym() is not available (i.e. when dumping + * (But note this is only the Linux version, as per the FIXME + * note in the BSD version in undefineds.h.) + * + * These stubs exist for the benefit of Lisp code that needs to refer + * to foreign symbols when dlsym() is not available (i.e. when dumping * cold-sbcl.core, when we may be running in a host that's not SBCL, * or on platforms that don't have it at all). If the runtime is * dynamically linked, library functions won't be linked into it, so @@ -21,13 +24,12 @@ * provided with absolutely no warranty. See the COPYING and CREDITS * files for more information. */ +#define LANGUAGE_ASSEMBLY +#include "sbcl.h" - .file "ldso-stubs.S" - .version "01.01" -gcc2_compiled.: .text -#if defined __i386__ +#if defined LISP_FEATURE_X86 #define LDSO_STUBIFY(fct) \ .align 16 ; \ @@ -38,11 +40,17 @@ ldso_stub__ ## fct: ; \ .L ## fct ## e1: ; \ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; -#elif defined alpha - - /* I _hope_ this is correct - I haven't checked in the manual - * yet. It works to the point of building and passing tests, - * at any rate - dan 2001.05.10 */ +#elif ((defined LISP_FEATURE_OSF1) && (defined LISP_FEATURE_ALPHA)) +/* osf1 has ancient cpp that doesn't do ## */ +#define LDSO_STUBIFY(fct) \ +.globl ldso_stub__/**/fct ; \ +ldso_stub__/**/fct: ; \ + jmp fct ; \ +.L/**/fct/**/e1: ; + + +#elif ((defined LISP_FEATURE_LINUX) && (defined LISP_FEATURE_ALPHA)) +/* but there's no reason we need to put up with that on modern (Linux) OSes */ #define LDSO_STUBIFY(fct) \ .globl ldso_stub__ ## fct ; \ .type ldso_stub__ ## fct,@function ; \ @@ -50,6 +58,47 @@ ldso_stub__ ## fct: ; \ jmp fct ; \ .L ## fct ## e1: ; \ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; + +#elif ((defined LISP_FEATURE_PPC) && (defined LISP_FEATURE_LINUX)) +#define LDSO_STUBIFY(fct) \ +.globl ldso_stub__ ## fct ; \ + .type ldso_stub__ ## fct,@function ; \ +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 + + /* This is an attempt to follow DB's hint of sbcl-devel + * 2001-09-18. -- CSR */ +#define LDSO_STUBIFY(fct) \ +.globl ldso_stub__ ## fct ; \ + .type ldso_stub__ ## fct,@function ; \ +ldso_stub__ ## fct: ; \ + sethi %hi(fct),%g1 ; \ + jmpl %g1+%lo(fct),%g0 ; \ + nop /* delay slot*/ ; \ +.L ## fct ## e1: ; \ + .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; #else #error unsupported CPU architecture @@ -74,10 +123,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) @@ -135,13 +186,15 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(send) LDSO_STUBIFY(setitimer) LDSO_STUBIFY(setpgrp) - LDSO_STUBIFY(sigblock) - LDSO_STUBIFY(sigpause) + LDSO_STUBIFY(setsid) +#if !defined(SVR4) LDSO_STUBIFY(sigsetmask) +#endif LDSO_STUBIFY(sinh) LDSO_STUBIFY(socket) LDSO_STUBIFY(stat) LDSO_STUBIFY(strerror) + LDSO_STUBIFY(strlen) LDSO_STUBIFY(symlink) LDSO_STUBIFY(sync) LDSO_STUBIFY(tanh) @@ -177,4 +230,8 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(log) LDSO_STUBIFY(log10) LDSO_STUBIFY(sqrt) -#endif \ No newline at end of file +#endif +#if defined alpha + LDSO_STUBIFY(ieee_get_fp_control) + LDSO_STUBIFY(ieee_set_fp_control) +#endif