From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 15 19:16:28 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B8AC106564A for ; Thu, 15 Jul 2010 19:16:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 046C58FC1A for ; Thu, 15 Jul 2010 19:16:27 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o6FJGOIR023951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Jul 2010 22:16:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o6FJGOJW008007; Thu, 15 Jul 2010 22:16:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o6FJGOVh008006; Thu, 15 Jul 2010 22:16:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Jul 2010 22:16:24 +0300 From: Kostik Belousov To: "Andrey V. Elsukov" Message-ID: <20100715191624.GY2381@deviant.kiev.zoral.com.ua> References: <20100715143235.GU2381@deviant.kiev.zoral.com.ua> <4C3F5514.70308@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OEa2bCMk+rg6xBXy" Content-Disposition: inline In-Reply-To: <4C3F5514.70308@yandex.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Dmitry Krivenok Subject: Re: Kernel linker and undefined references in KLD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jul 2010 19:16:28 -0000 --OEa2bCMk+rg6xBXy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 15, 2010 at 10:36:04PM +0400, Andrey V. Elsukov wrote: > On 15.07.2010 18:32, Kostik Belousov wrote: > > The kernel linker ignores weak attribute of the symbol, as you see. > > There is more bugs in this department, in regard of the list of > > exported symbols from the modules. > >=20 > > I have a patch that fixes the issues, but I am leery to commit it, since > > the fix effectively breaks significant set of the modules. >=20 > Hi, Kostik >=20 > i want to remind that some time ago there was a report about another > bug. >=20 > #include > #include > #include > #include >=20 > static int > tst_modevent(module_t mod, int type, void *unused) > { > switch (type) { > case MOD_LOAD: > return (EINVAL); > case MOD_UNLOAD: > break; > }; > return (0); > } > static moduledata_t tstmod =3D { > "tst", > tst_modevent, > 0 > }; >=20 > DECLARE_MODULE(tst, tstmod, SI_SUB_ROOT_CONF, SI_ORDER_ANY); >=20 > # kldload -v ./tst.ko > Loaded ./tst.ko, id=3D16 >=20 > I think loading of this module should be rejected on MOD_LOAD, > but it doesn't. Did you tried this ? It works for me. There was a thread about the issue where apparently submitter used binutils 2.20.1. The solution of reverting r103230 was mentioned by peter. --OEa2bCMk+rg6xBXy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkw/XocACgkQC3+MBN1Mb4g77wCfbThSeOK4hcqZ1zLusP/r/cLZ UJkAniaNr3hMFExzLK2sDjyFNyWMqA5y =I0pQ -----END PGP SIGNATURE----- --OEa2bCMk+rg6xBXy--