Maybe module.h shouldn't be including elf.h, that afaik is needed by thearch-specific module loaders and not by all modules. A split intomodule.h for the modules and moduleloader.h for the arch-spec-loaders?