Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2012 22:07:13 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Richard Yao <ryao@cs.stonybrook.edu>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Text relocations in kernel modules
Message-ID:  <20120330190713.GG2358@deviant.kiev.zoral.com.ua>
In-Reply-To: <4F75EF86.6090909@cs.stonybrook.edu>
References:  <4F75E404.8000104@cs.stonybrook.edu> <4F75EF86.6090909@cs.stonybrook.edu>

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

--Aym+Xj7/WQ8n9Mht
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 30, 2012 at 01:38:14PM -0400, Richard Yao wrote:
> As a disclaimer, I would like to clarify that Gentoo/FreeBSD uses a
> FreeBSD userland and that Gentoo/FreeBSD has nothing to do with Debian
> GNU/kFreeBSD. People seem to think Gentoo/FreeBSD is related to Debian
> GNU/kFreeBSD, which has made collaboration difficult.
>=20
> With that said, Gentoo Portage is warning about text relocations in
> kernel modules. This is in a Gentoo/FreeBSD port of
> emulators/freebsd-kmod that I wrote. For instance, I see:
>=20
> # readelf -d /boot/modules/virtio.ko
>=20
> Dynamic section at offset 0x2f6c contains 13 entries:
>   Tag        Type                         Name/Value
>  0x00000004 (HASH)                       0xd4
>  0x6ffffef5 (GNU_HASH)                   0x238
>  0x00000005 (STRTAB)                     0x4a8
>  0x00000006 (SYMTAB)                     0x298
>  0x0000000a (STRSZ)                      397 (bytes)
>  0x0000000b (SYMENT)                     16 (bytes)
>  0x00000011 (REL)                        0x638
>  0x00000012 (RELSZ)                      1568 (bytes)
>  0x00000013 (RELENT)                     8 (bytes)
>  0x00000016 (TEXTREL)                    0x0
>  0x0000001e (FLAGS)                      TEXTREL
>  0x6ffffffa (RELCOUNT)                   108
>  0x00000000 (NULL)                       0x0
>=20
> Checking /boot/kernel, it seems that all modules have text relocations.
> My Gentoo/FreeBSD install is a 32-bit chroot on a ZFS Guru install of
> amd64 FreeBSD. amd64 FreeBSD does not appear to have any text relocations.
>=20
> I don't have a reference i386 install, but according to frogs in
> ##freebsd on freenode, his i386 FreeBSD also has text relocations.
>=20
> Is this a bug?
No. This is by design.

Why do you consider this a bug ?
>=20
> Yours truly,
> Richard Yao
>=20
> On 03/30/12 12:49, Richard Yao wrote:
> > Dear Ports Maintainers and kuriyama,
> >=20
> > emulators/freebsd-kmod has a typo in pkg-descr, where it says "lodable"
> > instead of "loadable".
> >=20
> > In addition, I have done the work necessary to port
> > emulators/freebsd-kmod to Gentoo/FreeBSD.
> >=20
> > https://bugs.gentoo.org/show_bug.cgi?id=3D410199
> >=20
> > The ebuild contains a few improvements on the original FreeBSD port
> > where we copy only the parts of SYSDIR that we need to build the module.
> > We also do hardlinks instead of copies when Gentoo Portage builds with
> > user privileges.
> >=20
> > The NEEDSUBDIRS part of the ebuild was written by naota AT gentoo.org as
> > part of Gentoo's review process. I have permission from him to upstream
> > the improvements we made on the port. Feel free to adopt any
> > improvements in the attachments in that bug report.
> >=20
> > Lastly, I have sent an email to gentoo-dev AT lists.gentoo.org and
> > gentoo-bsd AT lists.gentoo.org requesting that the FreeBSD specific
> > parts of the portage tree be relicensed under terms of the BSD-2
> > license. With a little luck, it will be possible to upstream
> > improvements made in Gentoo/FreeBSD without any hassle in the future.
> >=20
> > Yours truly,
> > Richard Yao
> >=20
>=20
>=20



--Aym+Xj7/WQ8n9Mht
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (FreeBSD)

iEYEARECAAYFAk92BGEACgkQC3+MBN1Mb4gVEQCg4qgh2gjzAM5PG8mMuia0nlYb
66sAn0FF2iPH6jCHyW0EhePYqnGMvRHv
=g0l2
-----END PGP SIGNATURE-----

--Aym+Xj7/WQ8n9Mht--



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