kernel module linking (general, ipfw table, netgraph)

freeuser freebsduser at gmx.com
Thu Sep 6 14:03:43 UTC 2018


On 06/09/2018 13:23, Andrey V. Elsukov wrote:
> On 06.09.2018 14:57, Eugene Grosbein wrote:
>>> I am building my module using /usr/src/sys/modules/netgraph/sample and
>>> /usr/src/sys/netgraph/ng_sample.* as templates. On the other hand,
>>> ng_socket
>>> uses kern_kldload, "sysctl -b kern.function_list | tr '\0' '\n' | grep
>>> kern_kldload"
>>> shows it and it works without any problems.
>>>
>>> Why is that? What have i not noticed that must be done?
>> Perhaps, this is KBI mismatch due to VIMAGE kernel option
>> that changes symbols like add_table_entry to V_add_table_entry
>> and your kernel module should be built WITH_VIMAGE defined too
>> to be loadable to such a kernel.
> I think VIMAGE only affects variables, but not functions.
> The problem is probably due to missing dependency. Look at ng_ipfw
> implementation. It depends from ipfw kernel module. Try add such
> dependency to your module.
>

Yes, by adding "MODULE_DEPEND.." fixed linking issues. Thank you very much!



More information about the freebsd-hackers mailing list