On linkage-table ports SBCL is able to deal with forward-references to aliens – which is to say, compile and load code referring to aliens before the shared object containing the alien in question has been loaded.
This is handled by
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
undefined_alien_function for routines. These are in turn
responsible for catching attempts to access the undefined alien, and
signalling the appropriate error.
These placeholder addresses get recorded in the linkage-table.
When new shared objects are loaded
called, which in turn attempts to resolve all currently undefined
aliens, and registers the correct addresses for them in the