(when (<= sb!vm:linkage-table-space-start
addr
sb!vm:linkage-table-space-end)
- (dohash ((name-and-datap info) *linkage-info* :locked t)
- (let ((table-addr (linkage-info-address info)))
- (when (and (<= table-addr addr)
- (< addr (+ table-addr sb!vm:linkage-table-entry-size)))
- (return-from sap-foreign-symbol (car name-and-datap))))))
+ (dohash ((name-and-datap table-addr) *linkage-info* :locked t)
+ (when (and (<= table-addr addr)
+ (< addr (+ table-addr sb!vm:linkage-table-entry-size)))
+ (return-from sap-foreign-symbol (car name-and-datap)))))
#!+os-provides-dladdr
(with-alien ((info (struct dl-info
(filename c-string)
(loop for table-address from sb!vm::linkage-table-space-start
by sb!vm::linkage-table-entry-size
and reference in sb!vm::*required-runtime-c-symbols*
- do (setf (gethash reference *linkage-info*)
- (make-linkage-info :datap (cdr reference)
- :address table-address)))
+ do (setf (gethash reference *linkage-info*) table-address))
#!+os-provides-dlopen
(setf *runtime-dlhandle* (dlopen-or-lose))
#!+os-provides-dlopen
(defvar *linkage-info* (make-hash-table :test 'equal :synchronized t))
-(defstruct linkage-info datap address)
-
(defun write-linkage-table-entry (table-address real-address datap)
(/show0 "write-linkage-table-entry")
(let ((reloc (int-sap table-address))
(hash-table-count *linkage-info*)
name))
(write-linkage-table-entry table-address real-address datap)
- (setf (gethash (cons name datap) *linkage-info*)
- (make-linkage-info :address table-address :datap datap))))
+ (setf (gethash (cons name datap) *linkage-info*) table-address)))
;;; Add a foreign linkage entry if none exists, return the address
;;; in the linkage table.
(defun ensure-foreign-symbol-linkage (name datap)
(/show0 "ensure-foreign-symbol-linkage")
(with-locked-system-table (*linkage-info*)
- (let ((info (or (gethash (cons name datap) *linkage-info*)
- (link-foreign-symbol name datap))))
- (linkage-info-address info))))
+ (or (gethash (cons name datap) *linkage-info*)
+ (link-foreign-symbol name datap))))
;;; Update the linkage-table. Called during initialization after all
;;; shared libraries have been reopened, and after a previously loaded
;;; FIXME: Should figure out how to write only those entries that need
;;; updating.
(defun update-linkage-table ()
- (dohash ((name-and-datap info) *linkage-info* :locked t)
+ (dohash ((name-and-datap table-address) *linkage-info* :locked t)
(let* ((name (car name-and-datap))
(datap (cdr name-and-datap))
- (table-address (linkage-info-address info))
(real-address
(ensure-dynamic-foreign-symbol-address name datap)))
(aver (and table-address real-address))