Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2012 13:38:14 -0400
From:      Richard Yao <ryao@cs.stonybrook.edu>
To:        <freebsd-stable@FreeBSD.org>
Subject:   Text relocations in kernel modules
Message-ID:  <4F75EF86.6090909@cs.stonybrook.edu>
In-Reply-To: <4F75E404.8000104@cs.stonybrook.edu>
References:  <4F75E404.8000104@cs.stonybrook.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
--------------enig184EAF1AF49918C2F5CC19CF
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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.

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:

# readelf -d /boot/modules/virtio.ko

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

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=
=2E

I don't have a reference i386 install, but according to frogs in
##freebsd on freenode, his i386 FreeBSD also has text relocations.

Is this a bug?

Yours truly,
Richard Yao

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=
=2E
> 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 a=
s
> 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



--------------enig184EAF1AF49918C2F5CC19CF
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPde+KAAoJELFAT5FmjZuENIIP/At2AdwgslMCfDneVx7oG5l1
2VYQAJA92Ca0osizn+t39FBSra9XXTCVcFlfTCdBZhiAaBJxva8hPsBhE/Z+uUPF
b55moMncXYmIOgEYssJHk9nEonPI3R30pPVOxHobCLGILpKCpTpqT8rqxfTmAbwQ
tQv5/8BVHvH2QDCAn9DhY4AQLOHW66L68x/sUHYWj4ivWQMGr8nQqlu8ssoDg733
5j1/FQwYdHPwvI0ob3Wb66NAQWuyNNYdXfKUdqTwWPKeSljDVYAK85f9W6S9kh2/
ywaruq2VfR69LjFBKNvfRgt3ANkv0/YMFboiwXC2Zn3DnIiYKTw/kAheJE6u4Fc8
6rhkZdV/299mWpdV4IEqSb+3zs0Vz71oWnzTBuCVGrFTd1PkpUPv6V+xwyCpp0hh
Whw25Tm0QVqFh0mwvLTgvNhv8+/HVbwZ37npoDc9XZ9R0+UXJ5oz9R0BVZjVaysn
r7hI2wjB9MtaKgw3jSbhUa1ZBNXP+xi2kgzYRBDTEICR66Mq2woDBhfxyoQKdryn
MgeGycIFmOlrOO3nDZyrR06ZQWBT9F8+rXiL2VJSxMuxFURKMrAYdUvY7D5peM6n
x5ojTCDB2l7Mb0w/ed/auNj8ZX6z82gQtkSjRUE1eJzLpFDAGkpp/Bj6kKh8Vwuj
B5qMTuOOUkpwNED++g+/
=Wj1E
-----END PGP SIGNATURE-----

--------------enig184EAF1AF49918C2F5CC19CF--



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