Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 2010 22:16:24 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        "Andrey V. Elsukov" <bu7cher@yandex.ru>
Cc:        freebsd-hackers@freebsd.org, Dmitry Krivenok <krivenok.dmitry@gmail.com>
Subject:   Re: Kernel linker and undefined references in KLD
Message-ID:  <20100715191624.GY2381@deviant.kiev.zoral.com.ua>
In-Reply-To: <4C3F5514.70308@yandex.ru>
References:  <AANLkTikhrbdbBEFl-I97nBzdvZx6qBaafDUsveRmYyp3@mail.gmail.com> <20100715143235.GU2381@deviant.kiev.zoral.com.ua> <4C3F5514.70308@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <sys/param.h>
> #include <sys/kernel.h>
> #include <sys/module.h>
> #include <sys/systm.h>
>=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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100715191624.GY2381>