Trying to build the EtherCAT master driver (realtime I/O driver) on a RT Linux (SL6.3) I keep bumping into a missing symbol issue when building the EtherCAT kernel modules:
# make modules
make -C "/usr/src/kernels/3.8.13-rt27.40.el6rt.x86_64" M="/root/etherlabmaster-code-08aa7305b9baba37bdd9eb4d8c2a8762aa56a7e2" modules
make[1]: Entering directory `/usr/src/kernels/3.8.13-rt27.40.el6rt.x86_64'
Building modules, stage 2.
MODPOST 4 modules
WARNING: "__fentry__" [/root/etherlabmaster-code-08aa7305b9baba37bdd9eb4d8c2a8762aa56a7e2/master/ec_master.ko] undefined!
WARNING: "__fentry__" [/root/etherlabmaster-code-08aa7305b9baba37bdd9eb4d8c2a8762aa56a7e2/examples/mini/ec_mini.ko] undefined!
WARNING: "__fentry__" [/root/etherlabmaster-code-08aa7305b9baba37bdd9eb4d8c2a8762aa56a7e2/devices/ec_generic.ko] undefined!
WARNING: "__fentry__" [/root/etherlabmaster-code-08aa7305b9baba37bdd9eb4d8c2a8762aa56a7e2/devices/e1000e/ec_e1000e.ko] undefined!
make[1]: Leaving directory `/usr/src/kernels/3.8.13-rt27.40.el6rt.x86_64'
# grep -Hin "fentry" /boot/config-`uname -r`
/boot/config-3.8.13-rt27.40.el6rt.x86_64:4797:CONFIG_HAVE_FENTRY=y
# strings /boot/System.map-3.8.13-rt27.40.el6rt.x86_64 | grep -i "fentry"
-- nothing --
#
I'm using GCC v 4.9.1, as you can see, the kernel config file does contain an entry related to 'fentry' and is enabled.
Weird thing is that I would expect the System.map to contain the __fentry__ symbol declared in there, but it isn't!?
I've tried building the EtherCAT driver against the kernel 3.10-rt & 3.14-rt, same issue, it's complaining about about the __fentry__ symbol missing.
If I go ahead and launch the EtherCAT service, I get the following:
# service ethercat start
Starting EtherCAT master 1.5.2 FATAL: Error inserting ec_master (/lib/modules/3.8.13-rt27.40.el6rt.x86_64/ethercat/master/ec_master.ko): Unknown symbol in module, or unknown parameter (see dmesg)
failed
# dmesg | tail
...
ec_master: Unknown symbol __fentry__ (err 0)
stringson binaries ... if the binary is a file type that it recognises (e.g. ELF) then it will only look in certain sections (to quote from my man pageonly those sequences that are in loadable, initialized data sections) ... usestrings --all fileto make sure you get them all, on any type of file (I usestrings - fileas that is what I grew up with :-) – Murray Jensen Feb 4 '16 at 0:26strings --allstill results with the same output. – fduff Feb 4 '16 at 6:23arch/x86/kernel/entry_64.Sfor some clues ...__fentry__is defined in that file, but only ifCC_USING_FENTRYis defined ... this in turn is only defined ifCONFIG_FUNCTION_TRACERandCONFIG_HAVE_FENTRYare defined. I'm guessing that somehow you've got a mismatch between the kernel config that is running and the config you are using to build the modules ... – Murray Jensen Feb 4 '16 at 12:06