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

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

On 03/30/12 15:46, Konstantin Belousov wrote:
> On Fri, Mar 30, 2012 at 03:42:22PM -0400, Richard Yao wrote:
>> On 03/30/12 15:07, Konstantin Belousov wrote:
>>>> Is this a bug?
>>> No. This is by design.
>>>
>>> Why do you consider this a bug ?
>>
>> It occurs on i386, but not amd64. It could be that something is wrong
>> with how things are being compiled i386, or it could be that i386
>> requires things to be compiled this way. I do not know which.
>>
> Again, let me repeat my question. Why do you consider the presence
> of relocations against text section a problem ?

The linker emits warnings:
i686-gentoo-freebsd9.0-ld: warning: creating a DT_TEXTREL in object.

Furthermore, this triggers a QA check in Gentoo/FreeBSD's package manager=
=2E

 * QA Notice: The following files contain runtime text relocations
 *  Text relocations force the dynamic linker to perform extra
 *  work at startup, waste system resources, and may pose a security
 *  risk.  On some architectures, the code may not even function
 *  properly, if at all.
 *  For more information, see http://hardened.gentoo.org/pic-fix-guide.xm=
l
 *  Please include the following list of files in your report:
 * TEXTREL boot/modules/if_vtnet.ko
 * TEXTREL boot/modules/virtio_blk.ko
 * TEXTREL boot/modules/virtio.ko
 * TEXTREL boot/modules/virtio_balloon.ko
 * TEXTREL boot/modules/virtio_pci.ko

I wrote that ebuild as part of something entirely unrelated. If it is a
feature, I can disable the QA check, but I should at least know why the
text relocations are needed.

Gentoo maintainers are expected to patch text relocations and send
patches upstream. The only exception is in the case of binary packages,
which they cannot patch.

Investigating the text relocations in my port of emulators/virtio-kmod
revealed that all kernel modules on i386 Gentoo/FreeBSD have text
relocations, yet none have them on amd64 FreeBSD, so I do not know
whether this is a bug or a feature.


--------------enigD28983ED4DAC2DD9BEF3FD00
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/

iQIcBAEBAgAGBQJPdhN2AAoJELFAT5FmjZuEqOAQALyYO2l11/G9VxS0XFf12kFo
u20lqhWkCrRbhZU3HKc99p5RLfQVcPZsgj63RURBlI1h1Exo/CL6hQzYzSArWTO5
7oZttbSWmzL7wDecfzIr6PbJlM2kpBnGizFj4IDGpYSN7ca1DI3spAO8nCM0rDv4
2rMmgPqgRnNsKwP1hJxjzyxkflaAj36TR0YNBlV9cArbo7c7ZRuYZ8Zaf+9w0WFS
zCYkDANA31jHE/5J5j6QWiEKYWVe5axmZvIoYNzhxUeE2708QnYPqL/+SiNyfJfy
TxP6b3GT74jSvwJKQBI3Ci5q+gQqro6iQCwGOVT3pceYUpJcAcYzkSnlYT3bZVfu
sgtYy6177wTYwUdlXrPBUb7zKQKqTg4R36xvi8XorxABBYmhGVyD57kH/RX7BzMS
BsKtxQLiwohJiJ3hSEFEmjiAjTmn9JntCSuluIsRNpkPF/XnQtzptoCSHZY/QQPn
bigEIS4la8vJqFtYOzp2ckaX11cZIQwf1Hci/xtRr3ao7bzYPIYH6BGauBALIh1n
VAnknxXTc3/WskZFyQXfSq9UAlJMWD0G0nygm0D7q0SNIN2dGLT54JkkBDc6+L67
9U05anPBx1xi7cMREJ/wNIJVHwDtlx6hmX091n4Bv8VnQ3k/JjZTS+uGWMZH7MoP
j6MAXkdxlZLC6vSTbEFn
=BOcF
-----END PGP SIGNATURE-----

--------------enigD28983ED4DAC2DD9BEF3FD00--



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