X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fldso-stubs.S;h=360cf9cc8870c02a4ad630ebe08e4499facd8db2;hb=e48026257ea92807b2a5ee799476be198fc64dd6;hp=f786dd0299596ac10cb0965d543bc174af44ea3c;hpb=fdf07da187cb31fd5bdd872c73245fd72877b1a1;p=sbcl.git diff --git a/src/runtime/ldso-stubs.S b/src/runtime/ldso-stubs.S index f786dd0..360cf9c 100644 --- a/src/runtime/ldso-stubs.S +++ b/src/runtime/ldso-stubs.S @@ -1,8 +1,14 @@ /* - * stubs for C-linkage library functions used by the runtime + * stubs for C-linkage library functions which we need to refer to + * from Lisp * - * These are needed because the locations of the libraries are - * filled in by the dynamic linker ld.so at runtime. + * These 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 + * the map file won't show them. So, we need a bunch of stubs that + * nm(1) _can_ see. */ /* @@ -21,15 +27,34 @@ gcc2_compiled.: .text -#define LDSO_STUBIFY(fct) \ - .align 16 ; \ -.globl ldso_stub__ ## fct ; \ +#if defined __i386__ + +#define LDSO_STUBIFY(fct) \ + .align 16 ; \ +.globl ldso_stub__ ## fct ; \ .type ldso_stub__ ## fct,@function ; \ -ldso_stub__ ## fct: ; \ - jmp fct ; \ -.L ## fct ## e1: ; \ +ldso_stub__ ## fct: ; \ + jmp 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 */ +#define LDSO_STUBIFY(fct) \ +.globl ldso_stub__ ## fct ; \ + .type ldso_stub__ ## fct,@function ; \ +ldso_stub__ ## fct: ; \ + jmp fct ; \ +.L ## fct ## e1: ; \ + .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; + +#else +#error unsupported CPU architecture +#endif + LDSO_STUBIFY(accept) LDSO_STUBIFY(access) LDSO_STUBIFY(acos) @@ -70,7 +95,6 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(getegid) LDSO_STUBIFY(getenv) LDSO_STUBIFY(getgid) - LDSO_STUBIFY(gethostid) LDSO_STUBIFY(gethostbyaddr) LDSO_STUBIFY(gethostbyname) LDSO_STUBIFY(gethostname) @@ -134,3 +158,23 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(utimes) LDSO_STUBIFY(wait3) LDSO_STUBIFY(write) + +/* + * These aren't needed on the X86 because they're microcoded into the + * FPU, so the Lisp VOPs can implement them directly without having to + * call C code. + * + * 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__ + LDSO_STUBIFY(sin) + LDSO_STUBIFY(cos) + LDSO_STUBIFY(tan) + LDSO_STUBIFY(atan) + LDSO_STUBIFY(atan2) + LDSO_STUBIFY(exp) + LDSO_STUBIFY(log) + LDSO_STUBIFY(log10) + LDSO_STUBIFY(sqrt) +#endif \ No newline at end of file