Date: Sun, 15 Apr 2012 17:43:22 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: John Marino <draco@marino.st> Cc: kan@freebsd.org, Pedro Giffuni <pfg@freebsd.org>, freebsd-toolchain@freebsd.org Subject: Re: DragonFly added DT_GNU_HASH support to rtld Message-ID: <20120415144322.GU2358@deviant.kiev.zoral.com.ua> In-Reply-To: <4F5C7764.2@marino.st> References: <4F3C5A3A.6050107@FreeBSD.org> <20120216154730.GL3283@deviant.kiev.zoral.com.ua> <4F5C7764.2@marino.st>
next in thread | previous in thread | raw e-mail | index | archive | help
--+MW5NjnblUaFJVG7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 11, 2012 at 10:59:00AM +0100, John Marino wrote: > Hi Konstantin, >=20 > It seems that no BSD supported DT_GNU_HASH despite this option being=20 > available on the base binutils (FreeBSD's 2.17.50 binutils supports it).= =20 > This gnu extension is a big performance improvement over the specified= =20 > SysV hash. >=20 > The guy porting libreoffice to pkgsrc was finding -Wl,--hash-style=3Dgnu= =20 > to be the default build for that package. Indeed, using the standard=20 > hash results in very long startup times for something like Writer (> 8=20 > seconds launched from a SSD) >=20 > The result is that we brought in DT_GNU_HASH support to our real-time=20 > linker this weekend. We're still waiting to see how that improves=20 > libreoffice startup times. >=20 > full commit: > >http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7629c6317998f850= ebca23c296822ba08af09e5b >=20 >=20 > Modification to base compiler so all system libs and binaries can take=20 > advantage of it: > >http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4687ecd9561d76f3= d02ccb4f7adeecd5e3afdd8f >=20 >=20 > For a while, binaries with dynamic symbol tables will have both types of= =20 > hashes embedded. At some point in the future, we may switch over to=20 > only generating the GNU hash. This will break forward compatibility,=20 > but that happens rather frequently for other reasons anyway. >=20 > I was a bit surprised FreeBSD didn't already have this functionality=20 > given the performance benefits, so hopefully these DragonFly commits=20 > will be interesting for you. >=20 I finally ported the Dragonfly commit to FreeBSD. There were several changes reverted in dragonfly version of the extracted matched_symbol() function which were restored. I also blindly converted all non-x86 arches. The matched_symbol() extraction is the good opportunity to apply the style(9) formatting to the large chunk of rtld code. Any testers, esp. on non-x86 architectures, are welcome. You would need to modify gcc spec file for you architecture, see corresponding x86 changes in contrib/gcc/config/i386. For me, patch successfully worked on the machine were I disabled sysv hashes at all. http://people.freebsd.org/~kib/misc/rtld-gnu_hash.1.patch --+MW5NjnblUaFJVG7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+K3ooACgkQC3+MBN1Mb4haUACg4ghZ+fyg8IWHKK3sU6Llffod fisAnjE/ACZRQ0QSrgc2qTXmS1ols5GA =lFUl -----END PGP SIGNATURE----- --+MW5NjnblUaFJVG7--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120415144322.GU2358>