See the example (4 files) in the LispWorks library at
examples/delivery/dynamic-library/linux/
This example creates a LispWorks dynamic library and also a test program for loading it on Linux.
To build and run the example, follow the instructions in
rundll.c
.
LispWorks Delivery User Guide - 13 Dec 2011