It is a requirement of 'halcmd loadrt' that the name of the file (foo.ko) must match the name of the component reported by hal_init() (foo). If these do not match, the comp loads but halcmd emits the cryptic message:
<stdin>:1: module 'foo' not loaded
The behavior is probably fine, but the docs for 'halcmd loadrt' and comp(1) should note this requirement.
Also check if this issue affects 'halcmd loadusr'.