From owner-freebsd-hackers@freebsd.org Thu Sep 6 14:03:43 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50DE0FFC3F1 for ; Thu, 6 Sep 2018 14:03:43 +0000 (UTC) (envelope-from freebsduser@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9674787F7 for ; Thu, 6 Sep 2018 14:03:42 +0000 (UTC) (envelope-from freebsduser@gmx.com) Received: from janis.lv.lv ([80.232.239.9]) by mail.gmx.com (mrgmx003 [212.227.17.184]) with ESMTPSA (Nemesis) id 0M7YF5-1fdTyC1UIB-00xKMc; Thu, 06 Sep 2018 16:03:03 +0200 Subject: Re: kernel module linking (general, ipfw table, netgraph) To: "Andrey V. Elsukov" , Eugene Grosbein , freebsd-hackers@freebsd.org References: <5B91163D.9030905@grosbein.net> <039ee1d8-c357-c7ae-4049-2aa4ca91a5c4@yandex.ru> From: freeuser Message-ID: <241f0387-1451-c327-0340-0ce03c7ddcd0@gmx.com> Date: Thu, 6 Sep 2018 17:02:40 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <039ee1d8-c357-c7ae-4049-2aa4ca91a5c4@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Provags-ID: V03:K1:vUXPG0FCIDcVGBkaTHTvaAxp8htB7vVe3RiWRvSsfOsj4ab2m65 hXYCTNGlyEk67O+zxiaYjgMAalV6RtPENi0vQOBqxMTuRZwKcCtgkCd2KV7vT4onBQj0+kl zdphAHUNjAx9SMg04FNcSjCLcJknc+3d+//uc1LXZx0XU40EDjXMLs7mVE2pMB2BKuo/uXi jos58h3rvjxQ9lx7bW/8Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:dkFUlwTskP0=:q43wtppMBmbobioSPMGgb5 8Rrn/z8wMmPmz+lmJ9ah4XBBQk8tx07lruUymvxV8BUFy3+LuUpjBWdV5Awebz76FE7byfrnw M2b3EiCBRBDDb9NUqEA9HqZ4APaU39EHAAetWtQTRa1CN60sCXjJ3ZTaodLFOF60DVDkF9jHV BPDcaX+7uuIrAE9Hot3W8yeMB5WJKbNcnOFssihYAD8mI6sNc5D/a6x0jYZcVthIAkFt2EFse 1+vd5sgjqCilOne/Wk8YyR29hi0ZT+9vVk4uJTauFDjjxduZteMYa4SBp0SGeZ6mzh53LfNAp euLgFTxcs9WSoxmfCZo0IVKIj8OqPj3ddDI/c0VRBjpGcFXtjYbGYiTfdtBAw22XdqkJJJDXn P77RTDJBddfw/LUoiu12+jXqyOUbZwKZqCCw4epBxPq6CV9KB7qNVaYm46fYpnBtE01UG23zt az+KtSdCKk/XmESLd23xQCZRunoTWOhpWjTcyAODso94LSvhkfcPy3ALJwatxDqcbxRNNPVnJ WtTzKSV8mrOw0ynU8p9haPdRDYnPOhFhULhEKCqs08npZm4qZn7DNngUHRDTlkj0vKtAZSrmT ChHgbhGiKHWRdkq1Ifuz5U50uEX0b5l7WYGi/9PRzio2107tt82HcAeTo/CpaB2bjoGHZmrXv BcwO8+pl2Mryv5OPt4ijmDXo8B15xv+Xv+SqZT9RITSthCCCrRyYmKqFf7X8ry9/Fwk8K9ZWY 3OfAOpytcPCuWpLc2Esyj7MycbNy8HCC2K6GT9oBApXcAAWXfJelBL2KUX7AAjsEvFaksDeh0 tkNEH89 X-Mailman-Approved-At: Thu, 06 Sep 2018 15:07:53 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2018 14:03:43 -0000 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!