emacs.d/clones/www.sbcl.org/sbcl-internals/Lazy-Alien-Resolution.html

69 lines
2.9 KiB
HTML
Raw Normal View History

2023-01-18 20:30:47 +01:00
<html lang="en">
<head>
<title>Lazy Alien Resolution - SBCL Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="SBCL Internals">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Foreign-Linkage.html#Foreign-Linkage" title="Foreign Linkage">
<link rel="prev" href="Linkage_002dtable.html#Linkage_002dtable" title="Linkage-table">
<link rel="next" href="Callbacks.html#Callbacks" title="Callbacks">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual is part of the SBCL software system. See the `README'
file for more information.
This manual is in the public domain and is provided with
absolutely no warranty. See the `COPYING' and `CREDITS' files for
more information.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Lazy-Alien-Resolution"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Callbacks.html#Callbacks">Callbacks</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Linkage_002dtable.html#Linkage_002dtable">Linkage-table</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Foreign-Linkage.html#Foreign-Linkage">Foreign Linkage</a>
<hr>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">4.2 Lazy Alien Resolution</h3>
<p>On linkage-table ports SBCL is able to deal with forward-references to
aliens &ndash; which is to say, compile and load code referring to aliens
before the shared object containing the alien in question has been
loaded.
<p>This is handled by <code>ENSURE-DYNAMIC-FOREIGN-SYMBOL-ADDRESS</code>, which
first tries to resolve the address in the loaded shared objects, but
failing that records the alien as undefined and returns the address of
a read/write/execute protected guard page for variables, and address
of <code>undefined_alien_function</code> for routines. These are in turn
responsible for catching attempts to access the undefined alien, and
signalling the appropriate error.
<p>These placeholder addresses get recorded in the linkage-table.
<p>When new shared objects are loaded <code>UPDATE-LINKAGE-TABLE</code> is
called, which in turn attempts to resolve all currently undefined
aliens, and registers the correct addresses for them in the
linkage-table.
</body></html>