-;;; FIXME: the relation between #'lookup-foreign-symbol and
-;;; #'lookup-maybe-prefix-foreign-symbol seems more than slightly
-;;; illdefined
-
-(defun lookup-foreign-symbol (name)
- #!+(or alpha x86)
- (let ((prefixes
- #!+linux #(;; FIXME: How many of these are actually
- ;; needed? The first four are taken from rather
- ;; disorganized CMU CL code, which could easily
- ;; have had redundant values in it..
- "_"
- "__"
- "__libc_"
- "ldso_stub__"
- ;; ..and the fifth seems to match most
- ;; actual symbols, at least in RedHat 6.2.
- "")
- #!+freebsd #("" "ldso_stub__")
- #!+openbsd #("_")))
- (or (some (lambda (prefix)
- (gethash (concatenate 'string prefix name)
- *cold-foreign-symbol-table*
- nil))
- prefixes)
- *foreign-symbol-placeholder-value*
- (progn
- (format *error-output* "~&The foreign symbol table is:~%")
- (maphash (lambda (k v)
- (format *error-output* "~&~S = #X~8X~%" k v))
- *cold-foreign-symbol-table*)
- (format *error-output* "~&The prefix table is: ~S~%" prefixes)
- (error "The foreign symbol ~S is undefined." name))))
- #!-(or x86 alpha) (error "non-x86/alpha unsupported in SBCL (but see old CMU CL code)"))
+(defun cold-foreign-symbol-address-as-integer (name)
+ (or (find-foreign-symbol-in-table name *cold-foreign-symbol-table*)
+ *foreign-symbol-placeholder-value*
+ (progn
+ (format *error-output* "~&The foreign symbol table is:~%")
+ (maphash (lambda (k v)
+ (format *error-output* "~&~S = #X~8X~%" k v))
+ *cold-foreign-symbol-table*)
+ (error "The foreign symbol ~S is undefined." name))))