root@s32g399ardb3:/usr/lib/lxc# cd rootfs
root@s32g399ardb3:/usr/lib/lxc/rootfs# ls
README ipc-shm-dev.ko ipc-shm-sample.ko
root@s32g399ardb3:/usr/lib/lxc/rootfs# ./ipc-shm-dev.ko
-sh: ./ipc-shm-dev.ko: cannot execute binary file: Exec format error
root@s32g399ardb3:/usr/lib/lxc/rootfs# insmod /lib/modules/`uname -r`/extra/ipc-shm-dev.ko
insmod: ERROR: could not load module /lib/modules/6.6.12-rt20-g649905a72693-dirty/extra/ipc-shm-dev.ko: No such file or directory
root@s32g399ardb3:/usr/lib/lxc/rootfs# insmod ipc-shm-dev.ko
[ 247.213335] Invalid ELF header magic: != ELF
insmod: ERROR: could not insert module ipc-shm-dev.ko: Invalid module format
root@s32g399ardb3:/usr/lib/lxc/rootfs# insmod ipc-shm-sample.ko
[ 280.353533] module ipc_shm_sample: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
insmod: ERROR: could not insert module ipc-shm-sample.ko: Invalid module format
root@s32g399ardb3:/usr/lib/lxc/rootfs# [ 316.576628] EXT4-fs (mmcblk0p2): error count since last fsck: 307
[ 316.582351] EXT4-fs (mmcblk0p2): initial error at time 1651167745: ext4_validate_block_bitmap:421
[ 316.591183] EXT4-fs (mmcblk0p2): last error at time 1718268511: ext4_lookup:1855: inode 60435
^C^C
root@s32g399ardb3:/usr/lib/lxc/rootfs# logout
Auto Linux BSP 40.0 s32g399ardb3 ttyLF0
s32g399ardb3 login: root
Last login: Thu Jun 13 08:48:36 UTC 2024 on ttyLF0
root@s32g399ardb3:~# file /lib/modules/6.6.12-rt20-g649905a72693-dirty/extra/ipc-shm-dev.ko
/lib/modules/6.6.12-rt20-g649905a72693-dirty/extra/ipc-shm-dev.ko: cannot open `/lib/modules/6.6.12-rt20-g649905a72693-dirty/extra/ipc-shm-dev.ko' (No such file or directory)
root@s32g399ardb3:~# file /lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko
/lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=1c4514d4a9208259f43e2f9e5247c13965d0a8be, with debug_info, not stripd
root@s32g399ardb3:~# insmod /lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko
[ 1084.389200] module ipc_shm_dev: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
insmod: ERROR: could not insert module /lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko: Invalid module format
root@s32g399ardb3:~# insmod /lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko
[ 1664.001059] module ipc_shm_dev: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
insmod: ERROR: could not insert module /lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko: Invalid module format
root@s32g399ardb3:~# file /lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko
/lib/modules/6.6.12-rt20-g649905a72693-dirty/ipc-shm-dev.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=1c4514d4a9208259f43e2f9e5247c13965d0a8be, with debug_info, not stripd
root@s32g399ardb3:~# insmod ipc-shm-sample.ko
insmod: ERROR: could not load module ipc-shm-sample.ko: No such file or directory
Thanks for the questions.
May I know which version BSP you are using for the test? How the modules generated? By Yocto or built yourselves?
Best Regards
Chenyin