;;;; from Lisp.
;;;;
;;;; (But note this is only the Linux version, as per the FIXME
;;;; note in the BSD version in undefineds.h.)
;;;;
;;;; from Lisp.
;;;;
;;;; (But note this is only the Linux version, as per the FIXME
;;;; note in the BSD version in undefineds.h.)
;;;;
;;;; 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
;;;; 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
- sethi %hi(~A),%g1 ; \\
- jmpl %g1+%lo(~A),%g0 ; \\
- nop /* delay slot*/ ; \\
+ sethi %hi(~A),%g1 ; \\
+ jmpl %g1+%lo(~A),%g0 ; \\
+ nop /* delay slot*/ ; \\
(make-list 9 :initial-element fct)))
(defvar *preludes* '("
/* This is an automatically generated file, please do not hand-edit it.
* See the program tools-for-build/ldso-stubs.lisp. */
(make-list 9 :initial-element fct)))
(defvar *preludes* '("
/* This is an automatically generated file, please do not hand-edit it.
* See the program tools-for-build/ldso-stubs.lisp. */
;;; osf1 has ancient cpp that doesn't do ##
#!+(and osf1 alpha) "
#define LDSO_STUBIFY(fct) \\
.globl ldso_stub__/**/fct ; \\
ldso_stub__/**/fct: ; \\
;;; osf1 has ancient cpp that doesn't do ##
#!+(and osf1 alpha) "
#define LDSO_STUBIFY(fct) \\
.globl ldso_stub__/**/fct ; \\
ldso_stub__/**/fct: ; \\
.L/**/fct/**/e1: ;"
;;; but there's no reason we need to put up with that on modern (Linux) OSes
#!+(and linux alpha) "
#define LDSO_STUBIFY(fct) \\
.globl ldso_stub__ ## fct ; \\
.L/**/fct/**/e1: ;"
;;; but there's no reason we need to put up with that on modern (Linux) OSes
#!+(and linux alpha) "
#define LDSO_STUBIFY(fct) \\
.globl ldso_stub__ ## fct ; \\
-.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"
+
+;;; 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
;;; 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 ;"))
+#define LDSO_STUBIFY(fct) \\
+ .globl ldso_stub__ ## fct ; \\
+ .type ldso_stub__ ## fct,@function ; \\
+ .ent ldso_stub__ ## fct ; \\
+ldso_stub__ ## fct: ; \\
+ .set noat ; \\
+ addiu $29,-48 ; \\
+ sw $28,40($29) ; \\
+ sw $31,44($29) ; \\
+ lw $25,64($29) ; \\
+ lw $1,68($29) ; \\
+ sw $25,16($29) ; \\
+ sw $1,20($29) ; \\
+ lw $25,72($29) ; \\
+ lw $1,76($29) ; \\
+ sw $25,24($29) ; \\
+ sw $1,28($29) ; \\
+ .set at ; \\
+ la $25, fct ; \\
+ jalr $25 ; \\
+ lw $31,44($29) ; \\
+ lw $28,40($29) ; \\
+ addiu $29,48 ; \\
+ jr $31 ; \\
+ .end ldso_stub__ ## fct ; \\
+ .size ldso_stub__ ## fct,.-ldso_stub__ ## fct ;"))
"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
"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
;;
;; 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
;;
;; 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