Hello,
at BananaPi my investigations show a difference between the layout of the "struct module" in module.h used for kernel production on one hand and provided for user module production on the other. The layout could be influenced by a lot of configuration switches.
For modules coming with kernel, the objdump tool shows in the kernel object file the section for relocating the module structure in this way:
RELOCATION RECORDS FOR [.gnu.linkonce.this_module]:
OFFSET TYPE VALUE
000000cc R_ARM_ABS32 init_module
000002cc R_ARM_ABS32 cleanup_module
and for an externally produced (failing) module:
RELOCATION RECORDS FOR [.gnu.linkonce.this_module]:
OFFSET TYPE VALUE
000000cc R_ARM_ABS32 init_module
000002c4 R_ARM_ABS32 cleanup_module
So the entry point of the exit procedure is stored at offset 2c4 instead of 2cc, overwriting pointer of the linked list of modules.
Because after an updated the problem had disappeared, I stopped my work to find out more details, e.g. which switch was not consistent.
Regards,
Rainer