From owner-freebsd-hackers@freebsd.org Thu Sep 6 09:08:12 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 E213CFF4521 for ; Thu, 6 Sep 2018 09:08:12 +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 2CE1D8DD5F for ; Thu, 6 Sep 2018 09:08:12 +0000 (UTC) (envelope-from freebsduser@gmx.com) Received: from janis.lv.lv ([80.232.239.9]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MVeCF-1gNrm7432N-00YwLC for ; Thu, 06 Sep 2018 11:02:53 +0200 To: freebsd-hackers@freebsd.org From: freeuser Subject: kernel module linking (general, ipfw table, netgraph) Message-ID: Date: Thu, 6 Sep 2018 12:02:29 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:MWOdBqhcM3SQfq4i4B1AZuk8pVl6WVAthShpCizYTa4lX4AH2TY yq3533kJXIodD4qYeT5RRkdYQHVCqaK53Lbuktmga6fLlA5ftBmTBw+ISLxqmB6y+byjgRW ihUJXjAIAd95XKSj6zOk4W9AX/uqEZlq+5CG10LltZ9tvYIB+rj2hSo/qy4z+Vn/PcBPWp1 VjOG4Xaj1IxgxjNgBlk1w== X-UI-Out-Filterresults: notjunk:1;V01:K0:6JRelgeLqOc=:Dq3xcNwAPVAQdGQIuXUkfm XvA2rV89sBfKBJ9QeXMbWFwsk5pMUZ7O4zzXyxgluM2sTaXDMaKFQPK9MNkVsalNCiHxIMn1j J4Z4ev4i1mjcF7XV1Gm6GhSSoJcEiT3Gcu7DZ5CcD7cWp7gPpjd0bOIcqpyxyxulM9rroWwZ2 POuPBV9GTYGMHu1tyY3rlg2DmJ0EbYna0xqR3NRL2nd9rqj3DHV+DGGc8+thEXp6xPPhpLCwM QjWBitL80JOWM+6RmdXc8eQJEefdrEEFcTgBoszxz4Y1cmWJK/ELURdZSEADMKrFKWFi18y/A DLK7XMgEsJHXpyhuKWFtQF5RgMeyZyvO02UoSSsofsP/GNlI6YjROCXLM+frZTfVVk92tNJ88 8w8jBNFt6dXmt4A/N+59EgsD5X/0df883NpgNktLdrldngmQ6buc752DxwPIjdvIvyRxRkriH 1vdOqTOToTHqPO/usR2wLD+h5avZ5aIoGbNC7zSfvLqSAAHovPMUCmwQ+VMuJwUuLkY0yIIOS ZsKiHUdnaEgGrs+nFRvubsDjLDZod9yuBSJFlhQAbgU5ZZfi+8qWv05k1r/Nkg5P1IS5gDLc5 xW7yZ+OX7p7gZIQUxCD2Vg3dofDkGeHVn5Ssva47eAfN9K1oMIzdv85RSJiQFqVYETAdTWR92 o7wWD6e8TjaYYu8pyyx8whDQFYlQWi16RT3Dnfi8YJvkN0E9tB/LtMSkdGxlKc4jcrbAPaDI+ eXobgxFixTfmmJfDnRMnJHkXs0o/BKyariJGiudU6Sx4WUYVOsseZfwlgPzvIQ7pB3IeVHnzF FKDESTH X-Mailman-Approved-At: Thu, 06 Sep 2018 10:33:48 +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 09:08:13 -0000 Hello, I'm working on a netgraph kernel module that modifies ipfw table contents. But i can not load the module, because   kldload: an error occurred while loading the module. Please check dmesg(8)   for more details. dmesg informs: .. link_elf_obj: symbol add_table_entry undefined linker_load_file: Unsupported file type add_table_entry is a function that modifies ipfw table, the thing is that i have included the relevant header files, but i don't understand how should i deal with linking. I assumed that this function will be available for module since "sysctl -b kern.function_list | tr '\0' '\n' | grep add_table" shows it. 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? Thank you, freeuser