That's what PIKE_MODULE_RELOC is for. Although it should probably be modified to make stuff relative to the libdir rather than the module path, since using the latter caused a lot of problems (which is why PIKE_MODULE_RELOC is not enabled by default).