If you build your own shared libraries from .a files, do not allow the option --whole-archive to be applied to a dynamic-link library (DLL), such as psxdll.a. Doing so will create a bad import table. Use --no-whole-archive after the required non-DLL .a files are loaded.