Skip to content
Snippets Groups Projects
Commit 2e1e9491 authored by emarsden's avatar emarsden
Browse files

Fixes to REINITIALIZE-GLOBAL-TABLE: ignore invalid entries in the
*GLOBAL-TABLE*, and reload files in the same order as they were initially
loaded.

From Lynn Quamm.
parent dd722bc9
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/foreign.lisp,v 1.47 2004/06/01 16:11:29 emarsden Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/foreign.lisp,v 1.48 2004/06/13 09:55:20 emarsden Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -637,19 +637,21 @@ to skip undefined symbols which don't have an address." ...@@ -637,19 +637,21 @@ to skip undefined symbols which don't have an address."
;; stale handles in the saved image. ;; stale handles in the saved image.
(setf (car lib-entry) (int-sap 0))))) (setf (car lib-entry) (int-sap 0)))))
;;; Open all the libraries in *global-table* ;;; Open all the libraries in *GLOBAL-TABLE*. We open them in the same
;;; order as the first time they were loaded, so that any dependencies
;;; on load order are respected.
(defun reinitialize-global-table () (defun reinitialize-global-table ()
(loop for lib-entry in *global-table* (loop for lib-entry in (reverse *global-table*)
for (sap . lib-path) = lib-entry for (sap . lib-path) = lib-entry
for new-sap = (dlopen (namestring lib-path) when lib-path
(logior rtld-now rtld-global)) do (let ((new-sap (dlopen (namestring lib-path)
do (progn (logior rtld-now rtld-global))))
(when (zerop (sap-int new-sap)) (when (zerop (sap-int new-sap))
;; We're going down ;; We're going down
(error "Couldn't open library ~S: ~S" lib-path (dlerror))) (error "Couldn't open library ~S: ~S" lib-path (dlerror)))
(setf (car lib-entry) new-sap))) (setf (car lib-entry) new-sap)))
(alien:alien-funcall (alien:extern-alien "os_resolve_data_linkage" (alien:alien-funcall (alien:extern-alien "os_resolve_data_linkage"
(alien:function c-call:void)))) (alien:function c-call:void))))
(defun alternate-get-global-address (symbol) (defun alternate-get-global-address (symbol)
(ensure-lisp-table-opened) (ensure-lisp-table-opened)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment